Skip to content

Commit 222460e

Browse files
Merge pull request #574 from TheMcnafaha/fix-flashing-icon
fix(header.tsx): flashing theme icon when switching pages in dark mode
2 parents bab3e86 + 79018da commit 222460e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/website/src/components/header/header.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,12 @@ export default component$(
106106
</nav>
107107

108108
<button type="button" aria-label="Toggle dark mode" onClick$={toggleDarkMode}>
109-
{rootStore.mode === 'dark' ? <MoonIcon /> : <SunIcon />}
109+
<div class="hidden dark:block">
110+
<MoonIcon />
111+
</div>
112+
<div class="block dark:hidden ">
113+
<SunIcon />
114+
</div>
110115
</button>
111116
<a
112117
target="_blank"

0 commit comments

Comments
 (0)