mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 03:27:05 -04:00
Use more show-if
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
7b5b73a289
commit
f2e273fc40
9 changed files with 76 additions and 85 deletions
|
@ -2,6 +2,7 @@ import React from 'react'
|
|||
import { useSelector } from 'react-redux'
|
||||
import { useParams } from 'react-router'
|
||||
import { ApplicationState } from '../../redux'
|
||||
import { ShowIf } from '../common/show-if'
|
||||
import { EditorWindow } from './editor-window/editor-window'
|
||||
import { MarkdownPreview } from './markdown-preview/markdown-preview'
|
||||
import { EditorMode } from './task-bar/editor-view-mode'
|
||||
|
@ -20,8 +21,12 @@ const Editor: React.FC = () => {
|
|||
<TaskBar/>
|
||||
<h1>{id}</h1>
|
||||
<div className={'flex-fill flex-row d-flex'}>
|
||||
{ editorMode === EditorMode.EDITOR || editorMode === EditorMode.BOTH ? <EditorWindow/> : null }
|
||||
{ editorMode === EditorMode.PREVIEW || editorMode === EditorMode.BOTH ? <MarkdownPreview/> : null }
|
||||
<ShowIf condition={editorMode === EditorMode.EDITOR || editorMode === EditorMode.BOTH}>
|
||||
<EditorWindow/>
|
||||
</ShowIf>
|
||||
<ShowIf condition={editorMode === EditorMode.PREVIEW || editorMode === EditorMode.BOTH}>
|
||||
<MarkdownPreview/>
|
||||
</ShowIf>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue