diff --git a/components/system/components/Typography.js b/components/system/components/Typography.js index c1fc82a7..56cc14a3 100644 --- a/components/system/components/Typography.js +++ b/components/system/components/Typography.js @@ -50,32 +50,19 @@ const onDeepLink = async (object) => { return window.open(slug); }; +const ProcessedLink = ({href, children, dark}) => { + + +} + const Link = ({href, children, dark}) => { return {children} } - -export const ProcessedText = ({ text, dark }) => { - let replacedText; - const remarkReactComponents = { - a: (props) => dark ? : , - h1: function (props) { - return React.createElement('h2', props) - } -}; - console.log('gekki', remarkReactComponents) - return - - - replacedText = StringReplace(text, /(https?:\/\/\S+)/g, (match, i) => ( - - {match} - - )); - - replacedText = StringReplace( +const LinkMention = () => { + replacedText = StringReplace( replacedText, /@(\w*[0-9a-zA-Z-_]+\w*[0-9a-zA-Z-_])/g, (match, i) => ( @@ -89,8 +76,10 @@ export const ProcessedText = ({ text, dark }) => { ) ); +} - //NOTE(martina): previous regex: /#(\w*[0-9a-zA-Z-_]+\w*[0-9a-zA-Z-_])\/(\w*[0-9a-zA-Z-_]+\w*[0-9a-zA-Z-_])/g, +const LinkHash = () => { + //NOTE(martina): previous regex: /#(\w*[0-9a-zA-Z-_]+\w*[0-9a-zA-Z-_])\/(\w*[0-9a-zA-Z-_]+\w*[0-9a-zA-Z-_])/g, replacedText = StringReplace( replacedText, /#(\w*[0-9a-zA-Z-_]+\/\w*[0-9a-zA-Z-_]+)/g, @@ -107,6 +96,21 @@ export const ProcessedText = ({ text, dark }) => { ); } ); +} + +export const ProcessedText = ({ text, dark }) => { + let replacedText; + const remarkReactComponents = { + a: (props) => dark ? : , +}; + + return + + // replacedText = StringReplace(text, /(https?:\/\/\S+)/g, (match, i) => ( + // + // {match} + // + // )); return {replacedText}; };