fix: fixing glitch on dark mode icon
fixing the glitch when reloading the page on dark mode and the icon changing back to light mode.
This commit is contained in:
parent
09ec9f28e3
commit
c646eb129c
|
|
@ -138,20 +138,19 @@ watch(() => $route.path, (n) => {
|
||||||
<component :is="link.icon" class="w-[20px] h-5" />
|
<component :is="link.icon" class="w-[20px] h-5" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
<ClientOnly>
|
||||||
<Button
|
<Button
|
||||||
class="flex items-center justify-center"
|
class="flex items-center justify-center"
|
||||||
aria-label="Toggle dark mode"
|
aria-label="Toggle dark mode"
|
||||||
:variant="'ghost'"
|
:variant="'ghost'"
|
||||||
:size="'icon'" @click="toggleDark()"
|
:size="'icon'" @click="toggleDark()"
|
||||||
>
|
>
|
||||||
<!-- workaround for bug with component when refreshing the page -->
|
|
||||||
<component
|
<component
|
||||||
:is="RadixIconsMoon"
|
:is="isDark ? RadixIconsSun : RadixIconsMoon"
|
||||||
v-if="!isDark"
|
|
||||||
class="w-[20px] h-5 text-foreground"
|
class="w-[20px] h-5 text-foreground"
|
||||||
/>
|
/>
|
||||||
<RadixIconsSun v-if="isDark" class="w-[20px] h-5 text-foreground" />
|
|
||||||
</Button>
|
</Button>
|
||||||
|
</ClientOnly>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user