From 81d8c5c92bfb8dac40fdc51ef916ed55de813743 Mon Sep 17 00:00:00 2001 From: midblep Date: Mon, 5 Jul 2021 23:34:50 +0200 Subject: [PATCH] improved themeswitcher button indicating --- components/themetoggle.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/components/themetoggle.tsx b/components/themetoggle.tsx index fd83cda..88f95d1 100644 --- a/components/themetoggle.tsx +++ b/components/themetoggle.tsx @@ -16,9 +16,17 @@ export default function ThemeToggle() { window.localStorage.setItem("theme", activeTheme); }, [activeTheme]); - return ( - setActiveTheme(inactiveTheme)} href="#"> - 🌙 - - ) + if(activeTheme == 'light') { + return ( + setActiveTheme(inactiveTheme)} href="#"> + 🌙 + + ) + } else { + return ( + setActiveTheme(inactiveTheme)} href="#"> + ☀️ + + ) + } } \ No newline at end of file