mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-07-18 10:11:24 +00:00
14 lines
357 B
JavaScript
14 lines
357 B
JavaScript
import { useLayoutEffect } from "react";
|
|
import useSettings from "./useSettings";
|
|
|
|
/**
|
|
* Adds the `theme-mode` attribute to the body element for semi-ui dark theme
|
|
*/
|
|
export default function useThemedPage() {
|
|
const { settings } = useSettings();
|
|
|
|
useLayoutEffect(() => {
|
|
document.body.setAttribute("theme-mode", settings.mode);
|
|
}, [settings]);
|
|
}
|