feat: add custom link component to markdown

This commit is contained in:
RadoslavDimchev 2023-10-25 09:31:33 +03:00
parent eba0f3a949
commit cf390f1cac
1 changed files with 10 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import { Text } from '@status-im/components'
import { useSelector } from 'react-redux'
import { useState } from 'react'
import Markdown from 'react-markdown'
import { Link } from 'react-router-dom'
import { RootState } from '../../../../redux/store'
import { DOCUMENTATIONS } from './documentations'
@ -33,7 +34,7 @@ const ValidatorSetupInstall = () => {
space={'$2'}
>
<Text size={19}>Installing {selectedClient}</Text>
<Markdown>{DOCUMENTATIONS[selectedClient].general}</Markdown>
<Markdown components={{ a: Linkk }}>{DOCUMENTATIONS[selectedClient].general}</Markdown>
<OSCards selectedOS={selectedOS} handleOSCardClick={handleOSCardClick} />
<Markdown children={DOCUMENTATIONS[selectedClient].documentation[selectedOS]} />
</YStack>
@ -41,4 +42,12 @@ const ValidatorSetupInstall = () => {
)
}
const Linkk = (props: any) => {
return (
<Link to={props.href} target="_blank">
{props.children}
</Link>
)
}
export default ValidatorSetupInstall