diff --git a/src/FeatherIcon.js b/src/FeatherIcon.js new file mode 100644 index 0000000..0603e08 --- /dev/null +++ b/src/FeatherIcon.js @@ -0,0 +1,47 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import IconInner from './IconInner'; + +/** + * Feather icon + * otherProps spread will be removed in version 1. + * @param {icon} icon name that matches from feathericons + * @returns FeatherIcon react component + */ +const FeatherIcon = ({ + icon, + size = 24, + className = '', + fill = 'none', + ...otherProps +}) => { + if (!icon) { + return null; + } + + return ( + + + + ); +}; + +FeatherIcon.propTypes = { + icon: PropTypes.string.isRequired, // the icon name that matches exactly from feathericons + size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + className: PropTypes.string, + fill: PropTypes.string, +}; + +export default FeatherIcon; diff --git a/src/index.js b/src/index.js index e09a682..e935682 100644 --- a/src/index.js +++ b/src/index.js @@ -1,47 +1 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import IconInner from './IconInner'; - -/** - * Feather icon - * otherProps spread will be removed in version 1. - * @param {icon} icon name that matches from feathericons - * @returns FeatherIcon react component - */ -const FeatherIcon = ({ - icon, - size = 24, - className = '', - fill = 'none', - ...otherProps -}) => { - if (!icon) { - return null; - } - - return ( - - - - ); -}; - -FeatherIcon.propTypes = { - icon: PropTypes.string.isRequired, // the icon name that matches exactly from feathericons - size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - className: PropTypes.string, - fill: PropTypes.string -}; - -export default FeatherIcon; +export { default } from './FeatherIcon';