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 1 commit
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,22 @@
import PropTypes from 'prop-types';
import React from 'react';
import React, {ReactNode} from 'react';
import useThemeStyles from '@styles/useThemeStyles';
import Section from './Section';

const propTypes = {
type WalletSectionProps = {
/** Contents to display inside the section */
children: PropTypes.node,
children?: ReactNode;

pac-guerreiro marked this conversation as resolved.
Show resolved Hide resolved
/** The icon to display along with the title */
icon: PropTypes.func,
icon?: (props: unknown) => React.ReactNode;

pac-guerreiro marked this conversation as resolved.
Show resolved Hide resolved
/** 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,
title: string;
};

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

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 +32,6 @@ function WalletSection({children, icon, subtitle, title}) {
);
}

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

export default WalletSection;
Loading