1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: adapts react markdown to open links in new tab (#5762)

Adapts our current implementations of `ReactMarkdown` to always open
markdown links in new tabs.
This commit is contained in:
Nuno Góis 2024-01-04 14:32:27 +00:00 committed by GitHub
parent 77074a26de
commit ab139553c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -84,7 +84,7 @@ export const Banner = ({ banner, inline, maxHeight }: IBannerProps) => {
<StyledIcon variant={variant}>
<BannerIcon icon={icon} variant={variant} />
</StyledIcon>
<ReactMarkdown>{message}</ReactMarkdown>
<ReactMarkdown linkTarget='_blank'>{message}</ReactMarkdown>
<BannerButton
link={link}
plausibleEvent={plausibleEvent}

View File

@ -30,7 +30,9 @@ export const BannerDialog = ({
setOpen(false);
}}
>
<StyledReactMarkdown>{children}</StyledReactMarkdown>
<StyledReactMarkdown linkTarget='_blank'>
{children}
</StyledReactMarkdown>
</Dialogue>
);
};

View File

@ -34,7 +34,9 @@ export const IntegrationHowToSection: VFC<IIntegrationHowToSectionProps> = ({
>
<IntegrationIcon name={provider.name} /> {title}
</Typography>
<ReactMarkdown>{provider!.howTo || ''}</ReactMarkdown>
<ReactMarkdown linkTarget='_blank'>
{provider!.howTo || ''}
</ReactMarkdown>
</StyledHowDoesItWorkSection>
);
};