diff options
author | Eugene Sokolov <eug-vs@keemail.me> | 2020-04-06 17:47:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-06 17:47:20 +0300 |
commit | 62df0ff96fc9ab832212d223150862c7667d9ffc (patch) | |
tree | 9159c443e970ea2a0819edffbe2fe5cc101c1001 /src/lib/Markdown/CodeBlock.tsx | |
parent | a72027d21154ba94e26d6b96092afc9704b8288c (diff) | |
parent | 400330fe5ebd6951a97f07b6147b3af6113e034f (diff) | |
download | react-benzin-62df0ff96fc9ab832212d223150862c7667d9ffc.tar.gz |
Merge pull request #8 from eug-vs/developv3.1.0
Markdown parser
Diffstat (limited to 'src/lib/Markdown/CodeBlock.tsx')
-rw-r--r-- | src/lib/Markdown/CodeBlock.tsx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/lib/Markdown/CodeBlock.tsx b/src/lib/Markdown/CodeBlock.tsx new file mode 100644 index 0000000..5b8edec --- /dev/null +++ b/src/lib/Markdown/CodeBlock.tsx @@ -0,0 +1,27 @@ +import React from 'react'; +import { ParserPropTypes } from './types'; +import { Paper } from '@material-ui/core'; + +import { makeStyles } from '@material-ui/core/styles'; + +const useStyles = makeStyles(theme => ({ + root: { + background: theme.palette.background.default, + padding: theme.spacing(1), + overflowX: 'auto', + fontFamily: 'Monospace', + scrollbarColor: 'auto' + }, +})); + +const CodeBlock: React.FC<ParserPropTypes> = ({ rawLines }) => { + const classes = useStyles(); + return ( + <Paper variant="outlined" className={classes.root}> + {rawLines.map(line => <pre>{line}</pre>)} + </Paper> + ); +} + +export default CodeBlock; + |