diff --git a/frontend/src/Components/Link/IconButton.js b/frontend/src/Components/Link/IconButton.js deleted file mode 100644 index fffbe13e0..000000000 --- a/frontend/src/Components/Link/IconButton.js +++ /dev/null @@ -1,59 +0,0 @@ -import classNames from 'classnames'; -import PropTypes from 'prop-types'; -import React from 'react'; -import Icon from 'Components/Icon'; -import translate from 'Utilities/String/translate'; -import Link from './Link'; -import styles from './IconButton.css'; - -function IconButton(props) { - const { - className, - iconClassName, - name, - kind, - size, - isSpinning, - isDisabled, - ...otherProps - } = props; - - return ( - - - - ); -} - -IconButton.propTypes = { - ...Link.propTypes, - className: PropTypes.string.isRequired, - iconClassName: PropTypes.string, - kind: PropTypes.string, - name: PropTypes.object.isRequired, - size: PropTypes.number, - title: PropTypes.string, - isSpinning: PropTypes.bool, - isDisabled: PropTypes.bool -}; - -IconButton.defaultProps = { - className: styles.button, - size: 12 -}; - -export default IconButton; diff --git a/frontend/src/Components/Link/IconButton.tsx b/frontend/src/Components/Link/IconButton.tsx new file mode 100644 index 000000000..b6951c00c --- /dev/null +++ b/frontend/src/Components/Link/IconButton.tsx @@ -0,0 +1,41 @@ +import classNames from 'classnames'; +import React from 'react'; +import Icon, { IconProps } from 'Components/Icon'; +import translate from 'Utilities/String/translate'; +import Link, { LinkProps } from './Link'; +import styles from './IconButton.css'; + +export interface IconButtonProps + extends Omit, + Pick { + iconClassName?: IconProps['className']; +} + +export default function IconButton({ + className = styles.button, + iconClassName, + name, + kind, + size = 12, + isSpinning, + ...otherProps +}: IconButtonProps) { + return ( + + + + ); +}