Add a Markdown component and a SyntaxHighlighter

This commit is contained in:
Mohamed Karray
2019-03-12 18:46:44 +01:00
parent 856f564c8d
commit 6cd29091d5
8 changed files with 81 additions and 4294 deletions

View File

@@ -0,0 +1,26 @@
// @flow
import React from "react";
import ReactSyntaxHighlighter from "react-syntax-highlighter";
import { arduinoLight } from "react-syntax-highlighter/dist/styles/hljs";
type Props = {
language: string,
value: string
};
class SyntaxHighlighter extends React.Component<Props> {
render() {
return (
<ReactSyntaxHighlighter
showLineNumbers="false"
language={this.props.language}
style={arduinoLight}
>
{this.props.value}
</ReactSyntaxHighlighter>
);
}
}
export default SyntaxHighlighter;