diff --git a/src/atoms/github-mentions/github-mentions.js b/src/atoms/github-mentions/github-mentions.js deleted file mode 100644 index f866c1a..0000000 --- a/src/atoms/github-mentions/github-mentions.js +++ /dev/null @@ -1,40 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; - -const MENTIONS_PATTERN = /@([a-z0-9]+)/gi; - -export default function GithubMentionsAtom(props) { - console.log('PROPS', props); - const splitText = props.children.split(MENTIONS_PATTERN); - const matches = props.children.match(MENTIONS_PATTERN); - - if (!splitText) return props.children; - - return ( -
- {splitText.reduce((arr, element) => { - if (!element) return arr; - - if (matches.includes(`@${element}`)) { - return [ - ...arr, - ( - @{element} - ), - ]; - } - - return [...arr, element]; - }, [])} -
- ); -} - -GithubMentionsAtom.propTypes = { - /** The content that has mentions that needs transformed to GitHub links */ - children: PropTypes.string.isRequired, -}; - -GithubMentionsAtom.defaultProps = { - children: '', -}; diff --git a/src/atoms/github-mentions/index.js b/src/atoms/github-mentions/index.js deleted file mode 100644 index eeaa18d..0000000 --- a/src/atoms/github-mentions/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './github-mentions';