diff options
author | eug-vs <eug-vs@keemail.me> | 2020-04-05 14:18:45 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-04-05 14:18:45 +0300 |
commit | 62a543258a111f0f45be74b6ec3d887e15f67376 (patch) | |
tree | d468461e78d470c342e77285624b430ceb378b96 | |
parent | 39e1d32c669545ccc30e0d424323c6a01317c4be (diff) | |
download | react-benzin-62a543258a111f0f45be74b6ec3d887e15f67376.tar.gz |
feat: beautify CodeBlock
-rw-r--r-- | src/lib/Markdown/CodeBlock.tsx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/lib/Markdown/CodeBlock.tsx b/src/lib/Markdown/CodeBlock.tsx index 2718647..cbb3078 100644 --- a/src/lib/Markdown/CodeBlock.tsx +++ b/src/lib/Markdown/CodeBlock.tsx @@ -1,11 +1,23 @@ 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(2), + overflowX: 'auto', + }, +})); const CodeBlock: React.FC<ParserPropTypes> = ({ rawLines }) => { + const classes = useStyles(); return ( - <p style={{background: 'rgba(255, 255, 255, .1)', padding: '8px' }}> + <Paper variant="outlined" className={classes.root}> {rawLines.map(line => <> {line} <br/> </>)} - </p> + </Paper> ); } |