diff --git a/src/components/settings-panel.tsx b/src/components/settings-panel.tsx index 9421c8c..ed04cf8 100644 --- a/src/components/settings-panel.tsx +++ b/src/components/settings-panel.tsx @@ -1,7 +1,9 @@ "use client"; -import { Sparkles, Zap } from "lucide-react"; +import { Monitor, Moon, Sparkles, Sun, Zap } from "lucide-react"; +import { useTheme } from "next-themes"; import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; import { Checkbox } from "@/components/ui/checkbox"; import { Label } from "@/components/ui/label"; import { useIsMobile } from "@/hooks/use-mobile"; @@ -26,6 +28,7 @@ export function SettingsPanel({ settings, }: SettingsPanelProps) { const isMobile = useIsMobile(); + const { setTheme, theme } = useTheme(); const valuePrefix = hasLoadedSettings ? "Current preference" : "Default value"; @@ -156,6 +159,55 @@ export function SettingsPanel({ + +
+
+
+ +
+
+
+

+ Theme preference +

+

+ Choose the appearance LocalCal should use on this device. +

+
+
+ + + +
+
+
+
diff --git a/tests/settings-panel.test.ts b/tests/settings-panel.test.ts new file mode 100644 index 0000000..9e95bb5 --- /dev/null +++ b/tests/settings-panel.test.ts @@ -0,0 +1,11 @@ +import { describe, expect, test } from "bun:test"; +import { readFileSync } from "node:fs"; + +describe("settings panel", () => { + test("theme controls are available from settings after leaving the mobile header", () => { + const source = readFileSync("src/components/settings-panel.tsx", "utf8"); + + expect(source).toContain("Theme preference"); + expect(source).toContain("setTheme("); + }); +});