mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-02 06:07:06 +01:00
659063b335
* Allow Snaps UI to use Markdown for text formatting * Fix yarn audit and dedupe errors * Update LavaMoat policies * Fix lint * Add paragraph wrapper component * Fix lint
24 lines
641 B
JavaScript
24 lines
641 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import ReactMarkdown from 'react-markdown';
|
|
import { TYPOGRAPHY } from '../../../../helpers/constants/design-system';
|
|
import Typography from '../../../ui/typography/typography';
|
|
|
|
const Paragraph = (props) => <Typography {...props} variant={TYPOGRAPHY.H6} />;
|
|
|
|
export const SnapUIMarkdown = ({ children }) => {
|
|
return (
|
|
<ReactMarkdown
|
|
className="snap-ui-markdown__text"
|
|
allowedElements={['p', 'strong', 'em']}
|
|
components={{ p: Paragraph }}
|
|
>
|
|
{children}
|
|
</ReactMarkdown>
|
|
);
|
|
};
|
|
|
|
SnapUIMarkdown.propTypes = {
|
|
children: PropTypes.string,
|
|
};
|