From ad7e1dcafa37c68099158474004e12997bff8785 Mon Sep 17 00:00:00 2001 From: moloch-- <875022+moloch--@users.noreply.github.com> Date: Fri, 15 Dec 2023 18:01:21 -0600 Subject: [PATCH] Fix theme on dark landing page --- docs/sliver-docs/pages/index.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/sliver-docs/pages/index.tsx b/docs/sliver-docs/pages/index.tsx index c1861afa33..0cb05d869d 100644 --- a/docs/sliver-docs/pages/index.tsx +++ b/docs/sliver-docs/pages/index.tsx @@ -1,10 +1,16 @@ import AsciinemaPlayer from "@/components/asciinema"; import { Themes } from "@/util/themes"; import { Card, CardBody, CardHeader, Divider } from "@nextui-org/react"; -import { useTheme } from "next-themes"; export default function Home() { - const { theme } = useTheme(); + function getThemeState(): Themes { + if (typeof window !== "undefined") { + const loadedTheme = localStorage.getItem("theme"); + const currentTheme = loadedTheme ? (loadedTheme as Themes) : Themes.DARK; + return currentTheme; + } + return Themes.DARK; + } return (