diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index e98eec6..88c7235 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -71,10 +71,10 @@ export function Navbar({ onNav }: { onNav: (id: string) => void }) {
diff --git a/src/components/ThemeToggle.tsx b/src/components/ThemeToggle.tsx index de29439..28445f2 100644 --- a/src/components/ThemeToggle.tsx +++ b/src/components/ThemeToggle.tsx @@ -1,5 +1,5 @@ // ThemeToggle.tsx -import React from "react"; +import React, { useState } from "react"; import { useTheme } from "../hooks/useTheme"; // Actual primary colors for each theme @@ -13,6 +13,7 @@ const themeColors: Record = { export function ThemeToggle({ compact = false }: { compact?: boolean }) { const { theme, setTheme } = useTheme(); + const [open, setOpen] = useState(false); const themes = ["a", "b", "c", "d", "e"] as const; const crossfadeTo = (next: typeof themes[number]) => { @@ -27,6 +28,7 @@ export function ThemeToggle({ compact = false }: { compact?: boolean }) { // 3) switch theme (your existing logic) setTheme(next as any); + setOpen(false); // 4) remove crossfade flag after the animation window.setTimeout(() => { @@ -37,42 +39,46 @@ export function ThemeToggle({ compact = false }: { compact?: boolean }) { return (
-
- - {compact ? "Theme" : "Toggle Theme"} - - + -
-
    - {themes.map((t) => ( -
  • - -
  • - ))} -
-
-
+
+
    + {themes.map((t) => ( +
  • + +
  • + ))} +
+
); }