diff --git a/chain-registry b/chain-registry index d469a854..0e5b998f 160000 --- a/chain-registry +++ b/chain-registry @@ -1 +1 @@ -Subproject commit d469a854d19a08df157513e0757c36cccfd44da8 +Subproject commit 0e5b998fc1770ebe727a2208287fa4394a2b9ba4 diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 28ee3c5f..9c70a6fe 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,31 +1,34 @@ +import { useEffect, useMemo, useState } from "react"; import { defaultTheme, lightTheme, Widget } from "widgetv2"; import DiscordButton from "@/components/DiscordButton"; import { LogoGo } from "@/components/LogoGo"; import WidgetButton from "@/components/WidgetButton"; -import { cn } from "@/utils/ui"; - -import { apiURL, endpointOptions } from "@/lib/skip-go-widget"; -import { useEffect, useState } from "react"; import { useURLQueryParams } from "@/hooks/useURLQueryParams"; +import { apiURL, endpointOptions } from "@/lib/skip-go-widget"; +import { isMobile } from "@/utils/os"; +import { cn } from "@/utils/ui"; export default function Home() { const defaultRoute = useURLQueryParams(); - const [theme, setTheme] = useState<'light' | 'dark'>(); + const [theme, setTheme] = useState<"light" | "dark">(); useEffect(() => { - if (typeof window !== 'undefined') { - if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) { - setTheme('light'); + if (typeof window !== "undefined") { + if (window.matchMedia && window.matchMedia("(prefers-color-scheme: light)").matches) { + setTheme("light"); } else { - setTheme('dark'); + setTheme("dark"); } - - window.matchMedia('(prefers-color-scheme: light)').addEventListener('change', event => { + + window.matchMedia("(prefers-color-scheme: light)").addEventListener("change", (event) => { const newColorScheme = event.matches ? "light" : "dark"; setTheme(newColorScheme); }); } }, []); + + const mobile = useMemo(() => isMobile(), []); + if (!theme) return null; return (