feat: add custom link component to markdown
This commit is contained in:
parent
eba0f3a949
commit
cf390f1cac
|
@ -3,6 +3,7 @@ import { Text } from '@status-im/components'
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import Markdown from 'react-markdown'
|
import Markdown from 'react-markdown'
|
||||||
|
import { Link } from 'react-router-dom'
|
||||||
|
|
||||||
import { RootState } from '../../../../redux/store'
|
import { RootState } from '../../../../redux/store'
|
||||||
import { DOCUMENTATIONS } from './documentations'
|
import { DOCUMENTATIONS } from './documentations'
|
||||||
|
@ -33,7 +34,7 @@ const ValidatorSetupInstall = () => {
|
||||||
space={'$2'}
|
space={'$2'}
|
||||||
>
|
>
|
||||||
<Text size={19}>Installing {selectedClient}</Text>
|
<Text size={19}>Installing {selectedClient}</Text>
|
||||||
<Markdown>{DOCUMENTATIONS[selectedClient].general}</Markdown>
|
<Markdown components={{ a: Linkk }}>{DOCUMENTATIONS[selectedClient].general}</Markdown>
|
||||||
<OSCards selectedOS={selectedOS} handleOSCardClick={handleOSCardClick} />
|
<OSCards selectedOS={selectedOS} handleOSCardClick={handleOSCardClick} />
|
||||||
<Markdown children={DOCUMENTATIONS[selectedClient].documentation[selectedOS]} />
|
<Markdown children={DOCUMENTATIONS[selectedClient].documentation[selectedOS]} />
|
||||||
</YStack>
|
</YStack>
|
||||||
|
@ -41,4 +42,12 @@ const ValidatorSetupInstall = () => {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Linkk = (props: any) => {
|
||||||
|
return (
|
||||||
|
<Link to={props.href} target="_blank">
|
||||||
|
{props.children}
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
export default ValidatorSetupInstall
|
export default ValidatorSetupInstall
|
||||||
|
|
Loading…
Reference in New Issue