From 0f515bdd533e175869bf0160680cae8c6810461d Mon Sep 17 00:00:00 2001 From: abjunior92 Date: Wed, 10 Apr 2024 18:36:20 +0200 Subject: [PATCH] edit footer --- .../DarkModeToggle/DarkModeToggle.tsx | 6 ++-- src/components/Footer.astro | 29 +++++++++++++++++-- 2 files changed, 31 insertions(+), 4 deletions(-) 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"; + +