aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Markdown/CodeBlock.tsx
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2021-01-11 22:15:33 +0200
committerGitHub <noreply@github.com>2021-01-11 22:15:33 +0200
commit5f72950c56ea8853b41b64a092a2e98dbf53cf3f (patch)
tree240101bb69aea59c72e1e6fa328b9c5e1729f367 /src/lib/Markdown/CodeBlock.tsx
parentbc288a43c90ab830019bf077d72081fade76c06e (diff)
parentaa4493b08baae2d41a4c4346b9a5c63b08df471e (diff)
downloadreact-benzin-5f72950c56ea8853b41b64a092a2e98dbf53cf3f.tar.gz
Merge pull request #20 from eug-vs/feat/react-markdown
Feat: use react-markdown library and support context
Diffstat (limited to 'src/lib/Markdown/CodeBlock.tsx')
-rw-r--r--src/lib/Markdown/CodeBlock.tsx13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/lib/Markdown/CodeBlock.tsx b/src/lib/Markdown/CodeBlock.tsx
index 394458e..7431881 100644
--- a/src/lib/Markdown/CodeBlock.tsx
+++ b/src/lib/Markdown/CodeBlock.tsx
@@ -1,8 +1,9 @@
import React from 'react';
-import { Paper } from '@material-ui/core';
+import { Paper, makeStyles } from '@material-ui/core';
-import { makeStyles } from '@material-ui/core/styles';
-import { ParserPropTypes } from './types';
+interface PropTypes {
+ value: string;
+}
const useStyles = makeStyles(theme => ({
root: {
@@ -14,11 +15,13 @@ const useStyles = makeStyles(theme => ({
},
}));
-const CodeBlock: React.FC<ParserPropTypes> = ({ rawLines }) => {
+const CodeBlock: React.FC<PropTypes> = ({ value }) => {
const classes = useStyles();
return (
<Paper variant="outlined" className={classes.root}>
- {rawLines.map(line => <pre>{line}</pre>)}
+ <pre>
+ {value}
+ </pre>
</Paper>
);
};