diff --git a/src/icons/IconArrowLeft.js b/src/icons/IconArrowLeft.js deleted file mode 100644 index 967579e..0000000 --- a/src/icons/IconArrowLeft.js +++ /dev/null @@ -1,15 +0,0 @@ -import Icon from '@ant-design/icons/es/components/Icon' -import ArrowLeft from 'svgs/ArrowLeft.svg' -import PropTypes from 'shortcuts/PropTypes' - -const IconArrowLeft = (props) => { - const { style, ...otherProps } = props - return -} - -IconArrowLeft.propTypes = { - // eslint-disable-next-line react/forbid-prop-types - style: PropTypes.object, -} - -export default IconArrowLeft diff --git a/src/icons/IconClose.js b/src/icons/IconClose.js deleted file mode 100644 index 1a4c923..0000000 --- a/src/icons/IconClose.js +++ /dev/null @@ -1,15 +0,0 @@ -import Icon from '@ant-design/icons/es/components/Icon' -import Close from 'svgs/Close.svg' -import PropTypes from 'shortcuts/PropTypes' - -const IconClose = (props) => { - const { style, ...otherProps } = props - return -} - -IconClose.propTypes = { - // eslint-disable-next-line react/forbid-prop-types - style: PropTypes.object, -} - -export default IconClose diff --git a/src/icons/IconClose/Close.svg b/src/icons/IconClose/Close.svg new file mode 100644 index 0000000..6706191 --- /dev/null +++ b/src/icons/IconClose/Close.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/icons/IconClose/index.tsx b/src/icons/IconClose/index.tsx new file mode 100644 index 0000000..83c49ce --- /dev/null +++ b/src/icons/IconClose/index.tsx @@ -0,0 +1,6 @@ +import withCustomIcon from 'icons/withCustomIcon' +import Close from 'icons/IconClose/Close.svg' + +const IconClose = withCustomIcon(Close) + +export default IconClose diff --git a/src/icons/withCustomIcon.tsx b/src/icons/withCustomIcon.tsx new file mode 100644 index 0000000..0233fa9 --- /dev/null +++ b/src/icons/withCustomIcon.tsx @@ -0,0 +1,27 @@ +import * as React from 'react' +import Icon, { + CustomIconComponentProps, + IconComponentProps, +} from '@ant-design/icons/lib/components/Icon' + +type WithCustomIconProps = Omit +type SvgIcon = React.ComponentType< + CustomIconComponentProps | React.SVGProps +> + +function withCustomIcon(svgIcon: SvgIcon) { + return (props: WithCustomIconProps) => { + const { style, ...otherProps } = props + return ( + + ) + } +} + +export default withCustomIcon diff --git a/src/svgs/ArrowLeft.svg b/src/svgs/ArrowLeft.svg deleted file mode 100644 index 1641462..0000000 --- a/src/svgs/ArrowLeft.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/svgs/Close.svg b/src/svgs/Close.svg deleted file mode 100644 index a1be20e..0000000 --- a/src/svgs/Close.svg +++ /dev/null @@ -1,3 +0,0 @@ - - -