diff options
| author | jackyzha0 <[email protected]> | 2021-03-06 14:44:15 -0800 |
|---|---|---|
| committer | jackyzha0 <[email protected]> | 2021-03-06 14:44:15 -0800 |
| commit | e9a7416fabbbb0155c09ee86e7843a4d87e0c118 (patch) | |
| tree | 4243141cd2f151c65a0b4a8d34213b762aeef516 /frontend/src/components/Inputs/Code.js | |
| parent | code input style finalizations (diff) | |
| download | ctrl-v-e9a7416fabbbb0155c09ee86e7843a4d87e0c118.tar.xz ctrl-v-e9a7416fabbbb0155c09ee86e7843a4d87e0c118.zip | |
code renderer virtualization, better visuals
Diffstat (limited to 'frontend/src/components/Inputs/Code.js')
| -rw-r--r-- | frontend/src/components/Inputs/Code.js | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/frontend/src/components/Inputs/Code.js b/frontend/src/components/Inputs/Code.js index 5b8e06a..d5e063a 100644 --- a/frontend/src/components/Inputs/Code.js +++ b/frontend/src/components/Inputs/Code.js @@ -3,6 +3,7 @@ import styled from 'styled-components' import CharLimit from "../decorators/CharLimit"; import Editor from 'react-simple-code-editor'; import {Highlighter} from "../renderers/Code"; +import {CodeLike, Hover} from "../Form/mixins"; const EditorWrapper = styled(Editor)` overflow: visible !important; @@ -13,30 +14,25 @@ const EditorWrapper = styled(Editor)` } & pre, & code, & > textarea { - font-family: JetBrains Mono !important; - font-size: 14px !important; - line-height: 1.2em !important; + ${CodeLike} min-height: 40vh; } & > textarea { - padding: 0.8em !important; + ${Hover} + padding: 0.6em !important; z-index: 1; - border: none !important; - background-color: transparent !important; outline: none !important; } ` -const DefaultText = `Paste your text here` - export const Code = ({content, id, readOnly, setContentCallback, ...props}) => { return ( <div> <EditorWrapper name="content" readOnly={readOnly} - placeholder={DefaultText} + placeholder="Paste your text here" value={content} id={id} required |