From 91ca5e1c2b6cd228916647e398eb216fcff578bc Mon Sep 17 00:00:00 2001 From: Kyle Loveless Date: Sun, 13 Oct 2024 11:51:42 -0500 Subject: [PATCH 1/3] remove unneeded class style --- islands/site-header.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/islands/site-header.tsx b/islands/site-header.tsx index ec992a1..51db278 100644 --- a/islands/site-header.tsx +++ b/islands/site-header.tsx @@ -60,7 +60,7 @@ export default function SiteHeader({ children }: Props) { {showMenu && (
From 6d61a44feae4dab54fb5180f04b5c7846b454818 Mon Sep 17 00:00:00 2001 From: Kyle Loveless Date: Sun, 13 Oct 2024 12:23:11 -0500 Subject: [PATCH 2/3] update to deno 2, get theme selector working --- deno.json | 2 +- islands/theme-toggle.tsx | 12 +++++++++--- routes/_app.tsx | 4 +++- util/mod.ts | 14 +++++--------- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/deno.json b/deno.json index 6010b88..d48f234 100644 --- a/deno.json +++ b/deno.json @@ -43,5 +43,5 @@ "jsx": "react-jsx", "jsxImportSource": "preact" }, - "nodeModulesDir": true + "nodeModulesDir": "auto" } diff --git a/islands/theme-toggle.tsx b/islands/theme-toggle.tsx index f866378..4ddac64 100644 --- a/islands/theme-toggle.tsx +++ b/islands/theme-toggle.tsx @@ -1,17 +1,23 @@ -import { useSignal } from "@preact/signals"; +import { signal } from "@preact/signals"; import { Button } from "../components/ui/Button.tsx"; import { Icons } from "../components/icons.tsx"; -export function ThemeToggle() { - const theme = useSignal("light"); +export const theme = signal("dark"); +export function ThemeToggle() { return (