mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 22:54:42 -04:00
refactor: split apply-dark-mode hook into multiple hooks
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
bcff03ef99
commit
a23c215d8d
8 changed files with 70 additions and 60 deletions
|
@ -4,12 +4,12 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { CheatsheetContent } from '../components/editor-page/app-bar/cheatsheet/cheatsheet-content'
|
||||
import { useApplyDarkMode } from '../hooks/dark-mode/use-apply-dark-mode'
|
||||
import { useApplyDarkModeStyle } from '../hooks/dark-mode/use-apply-dark-mode-style'
|
||||
import type { NextPage } from 'next'
|
||||
import { Container } from 'react-bootstrap'
|
||||
|
||||
const CheatsheetPage: NextPage = () => {
|
||||
useApplyDarkMode()
|
||||
useApplyDarkModeStyle()
|
||||
|
||||
return (
|
||||
<Container>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
import { RendererToEditorCommunicatorContextProvider } from '../components/editor-page/render-context/renderer-to-editor-communicator-context-provider'
|
||||
import { RenderPageContent } from '../components/render-page/render-page-content'
|
||||
import { useApplyDarkMode } from '../hooks/dark-mode/use-apply-dark-mode'
|
||||
import { useApplyDarkModeStyle } from '../hooks/dark-mode/use-apply-dark-mode-style'
|
||||
import type { NextPage } from 'next'
|
||||
import React from 'react'
|
||||
|
||||
|
@ -13,7 +13,7 @@ import React from 'react'
|
|||
* Renders the actual markdown renderer that receives the content and metadata via iframe communication.
|
||||
*/
|
||||
export const RenderPage: NextPage = () => {
|
||||
useApplyDarkMode()
|
||||
useApplyDarkModeStyle()
|
||||
|
||||
return (
|
||||
<RendererToEditorCommunicatorContextProvider>
|
||||
|
|
|
@ -9,14 +9,17 @@ import { DocumentReadOnlyPageContent } from '../../components/document-read-only
|
|||
import { AppBar, AppBarMode } from '../../components/editor-page/app-bar/app-bar'
|
||||
import { HeadMetaProperties } from '../../components/editor-page/head-meta-properties/head-meta-properties'
|
||||
import { EditorToRendererCommunicatorContextProvider } from '../../components/editor-page/render-context/editor-to-renderer-communicator-context-provider'
|
||||
import { useApplyDarkMode } from '../../hooks/dark-mode/use-apply-dark-mode'
|
||||
import { useApplyDarkModeStyle } from '../../hooks/dark-mode/use-apply-dark-mode-style'
|
||||
import { useSaveDarkModePreferenceToLocalStorage } from '../../hooks/dark-mode/use-save-dark-mode-preference-to-local-storage'
|
||||
import React from 'react'
|
||||
|
||||
/**
|
||||
* Renders a page that contains only the rendered document without an editor or realtime updates.
|
||||
*/
|
||||
export const DocumentReadOnlyPage: React.FC = () => {
|
||||
useApplyDarkMode()
|
||||
useApplyDarkModeStyle()
|
||||
useSaveDarkModePreferenceToLocalStorage()
|
||||
|
||||
return (
|
||||
<EditorToRendererCommunicatorContextProvider>
|
||||
<NoteLoadingBoundary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue