chat: code mode uses source code pro

This commit is contained in:
Matilde Park 2020-08-18 17:17:14 -04:00
parent 8c3ef9b87b
commit f7a2e043a3
2 changed files with 11 additions and 5 deletions

View File

@ -121,16 +121,18 @@ export default class ChatEditor extends Component {
return ( return (
<div <div
className="chat fr h-100 flex bg-gray0-d lh-copy pl2 w-100 items-center" className={
style={{ flexGrow: 1, maxHeight: '224px', width: 'calc(100% - 72px)' }} 'chat fr h-100 flex bg-gray0-d lh-copy pl2 w-100 items-center' +
> (props.inCodeMode ? ' code' : '')
}
style={{ flexGrow: 1, maxHeight: '224px', width: 'calc(100% - 72px)' }}>
<CodeEditor <CodeEditor
value={props.message} value={props.message}
options={options} options={options}
onChange={(e, d, v) => this.messageChange(e, d, v)} onChange={(e, d, v) => this.messageChange(e, d, v)}
editorDidMount={(editor) => { editorDidMount={(editor) => {
this.editor = editor; this.editor = editor;
if (!(BROWSER_REGEX.test(navigator.userAgent))) { if (!BROWSER_REGEX.test(navigator.userAgent)) {
editor.focus(); editor.focus();
} }
}} }}

View File

@ -256,7 +256,11 @@ blockquote {
font-family: 'Inter'; font-family: 'Inter';
} }
.chat .CodeMirror.cm-s-code.chat .cm-s-tlon * { .code, .chat.code .react-codemirror2 .CodeMirror * {
font-family: 'Source Code Pro';
}
.chat .CodeMirror.cm-s-code.chat * {
font-family: 'Source Code Pro'; font-family: 'Source Code Pro';
} }