feat: create markdown text
This commit is contained in:
parent
ecd0cc2653
commit
38dec259d4
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
)
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue