style: new style of markdown editor

This commit is contained in:
2023-01-12 15:40:46 +01:00
parent 8a911f5ddb
commit 9d8689da36
3 changed files with 111 additions and 40 deletions
+2 -2
View File
@@ -29,7 +29,7 @@ export const MarkdownEditor = ({ placeholder, source, setSource }: Props) => {
return (
<div class="markdown-editor">
<div class="editor">
<h1>Editor</h1>
<div class="label">Editor</div>
<textarea
onInput={e => setSource(e.target instanceof HTMLTextAreaElement ? e.target.value : '')}
value={source}
@@ -39,7 +39,7 @@ export const MarkdownEditor = ({ placeholder, source, setSource }: Props) => {
></textarea>
</div>
<div class="preview">
<h1>Preview</h1>
<div class="label">Preview</div>
<div class="preview-content">
{source.trim().length ? <Markdown source={source} /> : <div class="placeholder">{placeholder}</div>}
</div>