fix: move dark mode and transparent body hook into renderer

These hooks are only necessary for the document and simple renderer. The slideshow handles theming itself.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-06-07 22:57:35 +02:00
parent e1a953c5bf
commit efac46858c
4 changed files with 27 additions and 9 deletions

View file

@ -5,21 +5,13 @@
*/
import { RendererToEditorCommunicatorContextProvider } from '../components/editor-page/render-context/renderer-to-editor-communicator-context-provider'
import { RenderPageContent } from '../components/render-page/render-page-content'
import { useApplyDarkModeStyle } from '../hooks/dark-mode/use-apply-dark-mode-style'
import type { NextPage } from 'next'
import React, { useEffect } from 'react'
import React from 'react'
/**
* Renders the actual markdown renderer that receives the content and metadata via iframe communication.
*/
export const RenderPage: NextPage = () => {
useEffect(() => {
document.body.classList.add('bg-transparent')
return () => document.body.classList.remove('bg-transparent')
}, [])
useApplyDarkModeStyle()
return (
<RendererToEditorCommunicatorContextProvider>
<RenderPageContent />