Skip to content

Free, simple, and intuitive online database diagram editor and SQL generator.

357 B
Raw Blame
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]);
}