mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 11:37:02 -04:00
Replace empty components with hooks (#666)
This commit is contained in:
parent
9e9108ec9a
commit
0d2c2fe0ee
5 changed files with 19 additions and 24 deletions
|
@ -2,10 +2,10 @@ import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react
|
|||
import { useTranslation } from 'react-i18next'
|
||||
import { useSelector } from 'react-redux'
|
||||
import useMedia from 'use-media'
|
||||
import { useApplyDarkMode } from '../../hooks/common/use-apply-dark-mode'
|
||||
import { useDocumentTitle } from '../../hooks/common/use-document-title'
|
||||
import { ApplicationState } from '../../redux'
|
||||
import { setEditorMode } from '../../redux/editor/methods'
|
||||
import { ApplyDarkMode } from '../common/apply-dark-mode/apply-dark-mode'
|
||||
import { DocumentTitle } from '../common/document-title/document-title'
|
||||
import { extractNoteTitle } from '../common/document-title/note-title-extractor'
|
||||
import { MotdBanner } from '../common/motd-banner/motd-banner'
|
||||
import { AppBar, AppBarMode } from './app-bar/app-bar'
|
||||
|
@ -104,11 +104,12 @@ export const Editor: React.FC = () => {
|
|||
}
|
||||
}, [editorSyncScroll])
|
||||
|
||||
useApplyDarkMode()
|
||||
useDocumentTitle(documentTitle)
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<ApplyDarkMode/>
|
||||
<MotdBanner/>
|
||||
<DocumentTitle title={documentTitle}/>
|
||||
<div className={'d-flex flex-column vh-100'}>
|
||||
<AppBar mode={AppBarMode.EDITOR}/>
|
||||
<DocumentBar title={documentTitle} noteContent={markdownContent} updateNoteContent={(newContent) => setMarkdownContent(newContent)}/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue