feat: custom domain management, status monitor, and theme/styling integration

This commit is contained in:
Bot
2026-08-31 04:42:03 +08:00
parent 643770318c
commit 2bab4c713f
17 changed files with 809 additions and 607 deletions
+3 -4
View File
@@ -1,5 +1,5 @@
import { createContext, type ReactNode, useEffect, useState } from "react";
import { DateTime } from "luxon";
import { createContext, type ReactNode, useEffect, useState } from "react";
export type Theme = "dark" | "light" | "system" | "scheduled";
@@ -41,7 +41,8 @@ export function ThemeProvider({
}, 60000);
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
const handler = (e: MediaQueryListEvent) => setIsSystemDark(e.matches);
const handler = (e?: MediaQueryListEvent) =>
setIsSystemDark(e?.matches ?? mediaQuery.matches);
mediaQuery.addEventListener("change", handler);
return () => {
@@ -54,7 +55,6 @@ export function ThemeProvider({
const root = window.document.documentElement;
const updateThemeColor = (nextTheme: "light" | "dark") => {
const themeColor =
nextTheme === "dark" ? "hsl(30 15% 8%)" : "hsl(0 0% 98%)";
document
@@ -94,7 +94,6 @@ export function ThemeProvider({
};
}, [theme, hour, isSystemDark]);
const value = {
theme,
setTheme: (theme: Theme) => {