add word break to messages

This commit is contained in:
Barry Gitarts 2018-11-16 11:35:43 -05:00
parent a7675dfaab
commit ab79bd3f55
1 changed files with 3 additions and 1 deletions

View File

@ -37,7 +37,9 @@ function getYoutubeId(url) {
//TODO use regex for code parsing / detection. Add new line detection for shift+enter
const MessageRender = ({ message }) => (
message[0] === "`" ? <SyntaxHighlighter language='javascript' style={atomDark}>{message.slice(1)}</SyntaxHighlighter> : <Linkify>{message}</Linkify>
message[0] === "`"
? <SyntaxHighlighter language='javascript' style={atomDark}>{message.slice(1)}</SyntaxHighlighter>
: <Linkify><span style={{ wordWrap: 'break-word' }}>{message}</span></Linkify>
)
const ChatBox = ({ username, message, pubkey }) => (
<Fragment>