diff --git a/src/components/DarkModeToggle/DarkModeToggle.tsx b/src/components/DarkModeToggle/DarkModeToggle.tsx index 640b9b2..f890eaf 100644 --- a/src/components/DarkModeToggle/DarkModeToggle.tsx +++ b/src/components/DarkModeToggle/DarkModeToggle.tsx @@ -19,7 +19,7 @@ const DarkModeToggle = () => { "duration-100" ); document.documentElement.classList.remove("dark"); - localStorage.theme = "light"; + localStorage.setItem("theme", "light"); setDarkMode(false); } else { document.documentElement.classList.add( @@ -27,9 +27,11 @@ const DarkModeToggle = () => { "transition-colors", "duration-100" ); - localStorage.theme = "dark"; + localStorage.setItem("theme", "dark"); setDarkMode(true); } + + window.dispatchEvent(new Event("themeChange")); } return ( diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 9e2eb96..4244364 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -6,7 +6,7 @@ import { XIcon } from "./icons/XIcon"; + +