Skip to content

Commit

Permalink
Merge pull request #32197 from callstack-internal/pac-guerreiro/refac…
Browse files Browse the repository at this point in the history
…tor/migrate-walletsection-to-typescript
  • Loading branch information
cead22 authored Dec 12, 2023
2 parents 09fa50a + 78025b6 commit 798deda
Showing 1 changed file with 7 additions and 17 deletions.
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();
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;

0 comments on commit 798deda

Please sign in to comment.