From 3afa4a917a0d171825eb5ecef15cfae007b83a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ian=20Miller=20=F0=9F=A6=90?= Date: Mon, 24 Jan 2022 23:24:43 -0500 Subject: [PATCH] put index as default export --- src/FeatherIcon.js | 47 +++++++++++++++++++++++++++++++++++++++++++++ src/index.js | 48 +--------------------------------------------- 2 files changed, 48 insertions(+), 47 deletions(-) create mode 100644 src/FeatherIcon.js 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';