aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-04-05 14:18:45 +0300
committereug-vs <eug-vs@keemail.me>2020-04-05 14:18:45 +0300
commit62a543258a111f0f45be74b6ec3d887e15f67376 (patch)
treed468461e78d470c342e77285624b430ceb378b96 /src/lib
parent39e1d32c669545ccc30e0d424323c6a01317c4be (diff)
downloadreact-benzin-62a543258a111f0f45be74b6ec3d887e15f67376.tar.gz
feat: beautify CodeBlock
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Markdown/CodeBlock.tsx16
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>
);
}