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

@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { useEffect } from 'react'
/**
* Makes the HTML body transparent.
*/
export const useTransparentBodyBackground = () => {
useEffect(() => {
document.body.classList.add('bg-transparent')
return () => document.body.classList.remove('bg-transparent')
}, [])
}