MyCrypto/common/components/Translate.tsx
greenkeeper[bot] 057a1095d3 Update react-markdown to the latest version 🚀 (#986)
* fix(package): update react-markdown to version 3.1.5

* Fix tsc errors, match original behaviour of V2 as closely as possible
2018-02-05 16:41:33 -06:00

23 lines
503 B
TypeScript

import React from 'react';
import Markdown from 'react-markdown';
import { translateRaw } from 'translations';
interface Props {
translationKey: string;
}
const Translate = ({ translationKey }: Props) => {
const source = translateRaw(translationKey);
return (
<Markdown
escapeHtml={true}
unwrapDisallowed={true}
allowedTypes={['link', 'emphasis', 'strong', 'code', 'root']}
renderers={{ root: 'span' }}
source={source}
/>
);
};
export default Translate;