From 7505183a3d62bf04b9f399e9b399003784893663 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Thu, 11 Jun 2020 12:22:36 -0700 Subject: [PATCH] feat: Create a FeatherIcon component --- src/components/FeatherIcon.js | 34 ++++++++++++++++++++++++++ src/components/FeatherIcon.module.scss | 9 +++++++ 2 files changed, 43 insertions(+) create mode 100644 src/components/FeatherIcon.js create mode 100644 src/components/FeatherIcon.module.scss diff --git a/src/components/FeatherIcon.js b/src/components/FeatherIcon.js new file mode 100644 index 000000000..f6c977635 --- /dev/null +++ b/src/components/FeatherIcon.js @@ -0,0 +1,34 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import cx from 'classnames'; +import styles from './FeatherIcon.module.scss'; + +const FeatherIcon = ({ className, name }) => { + const paths = ICONS[name]; + + return paths ? ( + + {paths} + + ) : null; +}; + +const ICONS = { + copy: ( + <> + + + + ), +}; + +FeatherIcon.propTypes = { + className: PropTypes.string, + name: PropTypes.oneOf(Object.keys(ICONS)), +}; + +export default FeatherIcon; diff --git a/src/components/FeatherIcon.module.scss b/src/components/FeatherIcon.module.scss new file mode 100644 index 000000000..21bf3806e --- /dev/null +++ b/src/components/FeatherIcon.module.scss @@ -0,0 +1,9 @@ +.icon { + fill: none; + stroke: currentColor; + stroke-width: 2; + stroke-linecap: round; + stroke-linejoin: round; + width: 1em; + height: 1em; +}