diff --git a/src/Linkify/Linkify.js b/src/Linkify/Linkify.js new file mode 100644 index 0000000..8d8d215 --- /dev/null +++ b/src/Linkify/Linkify.js @@ -0,0 +1,19 @@ +import React from 'react'; +import styled from 'styled-components'; + +const Container = styled.span` + a { + color: inherit; + text-decoration: underline; + } +`; + +const REGEX = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi; + +const parse = string => string.replace(REGEX, url => `${url}`); + +const Linkify = props => ( + +); + +export default Linkify; diff --git a/src/Linkify/Linkify.mdx b/src/Linkify/Linkify.mdx new file mode 100644 index 0000000..1c1b6a8 --- /dev/null +++ b/src/Linkify/Linkify.mdx @@ -0,0 +1,18 @@ +--- +menu: Components +name: Linkify +--- + +import { Playground, PropsTable } from 'docz' +import Linkify from './Linkify' + +# Linkify + +Automatically parse links contained in a body of text. + +## Example + + + Checkout http://google.com. Another one that is not that great is http://bing.com. + + diff --git a/src/Linkify/index.js b/src/Linkify/index.js new file mode 100644 index 0000000..e9ad8cf --- /dev/null +++ b/src/Linkify/index.js @@ -0,0 +1,3 @@ +import Linkify from './Linkify'; + +export default Linkify; diff --git a/src/index.js b/src/index.js index d144940..c1b95bd 100644 --- a/src/index.js +++ b/src/index.js @@ -21,3 +21,4 @@ export Spinner from './Spinner'; export Swtich from './Form/Switch'; export Tabs from './Tabs'; export ThemeProvider from './ThemeProvider'; +export Linkify from './Linkify';