aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Markdown/CodeBlock.tsx
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-04-05 22:49:24 +0300
committerGitHub <noreply@github.com>2020-04-05 22:49:24 +0300
commitffa56075c7f92ee0e3a5143fbf2e506eba016143 (patch)
tree50ec8eee86570cf3cadfa26c73f25c50334f1543 /src/lib/Markdown/CodeBlock.tsx
parent0a73e37b1bc78fead6a78722568532c327127b54 (diff)
parente9c6eb6be709db76002c41e5bf7d13654493d0a8 (diff)
downloadreact-benzin-ffa56075c7f92ee0e3a5143fbf2e506eba016143.tar.gz
Merge pull request #7 from eug-vs/markdown
Markdown proof of concept
Diffstat (limited to 'src/lib/Markdown/CodeBlock.tsx')
-rw-r--r--src/lib/Markdown/CodeBlock.tsx27
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;
+