1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-01 21:57:06 +01:00
metamask-extension/ui/components/app/flask/snap-ui-markdown/snap-ui-markdown.js
2023-02-02 20:15:26 +00:00

29 lines
669 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import ReactMarkdown from 'react-markdown';
import { TypographyVariant } from '../../../../helpers/constants/design-system';
import Typography from '../../../ui/typography/typography';
const Paragraph = (props) => (
<Typography
{...props}
variant={TypographyVariant.H6}
className="snap-ui-markdown__text"
/>
);
export const SnapUIMarkdown = ({ children }) => {
return (
<ReactMarkdown
allowedElements={['p', 'strong', 'em']}
components={{ p: Paragraph }}
>
{children}
</ReactMarkdown>
);
};
SnapUIMarkdown.propTypes = {
children: PropTypes.string,
};