diff options
author | ludovicm67 <ludovicmuller1@gmail.com> | 2020-01-23 22:03:22 +0100 |
---|---|---|
committer | ludovicm67 <ludovicmuller1@gmail.com> | 2020-01-23 22:03:22 +0100 |
commit | e364674850d527fe3a3c9bb8e3745ee619784636 (patch) | |
tree | 4402137d424dc90f2c09df3ef0950bb7ea41a241 /webui | |
parent | 3413ee448a79686381624a414b18debd09120b9e (diff) | |
download | git-bug-e364674850d527fe3a3c9bb8e3745ee619784636.tar.gz |
webui: fix width for pre tags in bug messages
Diffstat (limited to 'webui')
-rw-r--r-- | webui/src/Content.js | 2 | ||||
-rw-r--r-- | webui/src/bug/Message.js | 1 | ||||
-rw-r--r-- | webui/src/tag/PreTag.js | 16 |
3 files changed, 19 insertions, 0 deletions
diff --git a/webui/src/Content.js b/webui/src/Content.js index 737c5ab2..3a6900bc 100644 --- a/webui/src/Content.js +++ b/webui/src/Content.js @@ -3,6 +3,7 @@ import parse from 'remark-parse'; import html from 'remark-html'; import remark2react from 'remark-react'; import ImageTag from './tag/ImageTag'; +import PreTag from './tag/PreTag'; const Content = ({ markdown }) => { const processor = unified() @@ -11,6 +12,7 @@ const Content = ({ markdown }) => { .use(remark2react, { remarkReactComponents: { img: ImageTag, + pre: PreTag, }, }); diff --git a/webui/src/bug/Message.js b/webui/src/bug/Message.js index db67a3f5..06c12815 100644 --- a/webui/src/bug/Message.js +++ b/webui/src/bug/Message.js @@ -20,6 +20,7 @@ const useStyles = makeStyles(theme => ({ bubble: { flex: 1, marginLeft: theme.spacing(1), + minWidth: 0, }, header: { ...theme.typography.body1, diff --git a/webui/src/tag/PreTag.js b/webui/src/tag/PreTag.js new file mode 100644 index 00000000..c2440df9 --- /dev/null +++ b/webui/src/tag/PreTag.js @@ -0,0 +1,16 @@ +import React from 'react'; +import { makeStyles } from '@material-ui/styles'; + +const useStyles = makeStyles({ + tag: { + maxWidth: '100%', + overflowX: 'auto', + }, +}); + +const PreTag = props => { + const classes = useStyles(); + return <pre className={classes.tag} {...props}></pre>; +}; + +export default PreTag; |