feat: create markdown text

This commit is contained in:
RadoslavDimchev 2023-10-26 08:58:16 +03:00
parent ecd0cc2653
commit 38dec259d4
3 changed files with 18 additions and 6 deletions

View File

@ -1,12 +1,14 @@
import ReactMarkdown from 'react-markdown'
import MarkdownLink from './MarkdownLink'
import MarkdownText from './MarkdownText'
type MarkdownProps = {
children: string
}
const Markdown = ({ children }: MarkdownProps) => {
return <ReactMarkdown children={children} components={{ a: MarkdownLink }} />
return <ReactMarkdown children={children} components={{ a: MarkdownLink, p: MarkdownText }} />
}
export default Markdown

View File

@ -2,11 +2,7 @@ import { Link } from 'react-router-dom'
const MarkdownLink = (props: any) => {
return (
<Link
to={props.href}
target="_blank"
style={{ color: '#647084', textDecoration: 'underline' }}
>
<Link to={props.href} target="_blank" style={{ color: '#647084', textDecoration: 'underline' }}>
{props.children}
</Link>
)

View File

@ -0,0 +1,14 @@
import { Text } from '@status-im/components'
import { Stack } from 'tamagui'
const MarkdownText = (props: any) => {
return (
<Stack style={{ marginTop: '10px' }}>
<Text size={15} color="#647084">
{props.children}
</Text>
</Stack>
)
}
export default MarkdownText