Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TS migration] Migrate 'WalletSection.js' component to TypeScript #32197

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
import PropTypes from 'prop-types';
import React from 'react';
import {SvgProps} from 'react-native-svg';
import useThemeStyles from '@styles/useThemeStyles';
import ChildrenProps from '@src/types/utils/ChildrenProps';
import Section from './Section';

const propTypes = {
/** Contents to display inside the section */
children: PropTypes.node,

type WalletSectionProps = ChildrenProps & {
/** The icon to display along with the title */
icon: PropTypes.func,
icon: React.FC<SvgProps>;

/** The text to display in the subtitle of the section */
subtitle: PropTypes.string,
subtitle: string;

/** The text to display in the title of the section */
title: PropTypes.string.isRequired,
};

const defaultProps = {
children: null,
icon: null,
subtitle: null,
title: string;
};

function WalletSection({children, icon, subtitle, title}) {
function WalletSection({children, icon, subtitle, title}: WalletSectionProps) {
const styles = useThemeStyles();
pac-guerreiro marked this conversation as resolved.
Show resolved Hide resolved
return (
<Section
Expand All @@ -39,8 +31,6 @@ function WalletSection({children, icon, subtitle, title}) {
);
}

WalletSection.defaultProps = defaultProps;
WalletSection.displayName = 'WalletSection';
WalletSection.propTypes = propTypes;

export default WalletSection;
Loading