Update the DarkModeSwitcher component to change the icon order.
This commit is contained in:
Vendored
+2
-2
@@ -11,8 +11,8 @@ const setupThemeToggle = () => {
|
|||||||
const themeToggleDarkIcon = document.getElementById('theme-toggle-dark-icon');
|
const themeToggleDarkIcon = document.getElementById('theme-toggle-dark-icon');
|
||||||
const themeToggleLightIcon = document.getElementById('theme-toggle-light-icon');
|
const themeToggleLightIcon = document.getElementById('theme-toggle-light-icon');
|
||||||
if (themeToggleDarkIcon == null || themeToggleLightIcon == null) return;
|
if (themeToggleDarkIcon == null || themeToggleLightIcon == null) return;
|
||||||
const show = dark ? themeToggleDarkIcon : themeToggleLightIcon
|
const show = dark ? themeToggleLightIcon : themeToggleDarkIcon;
|
||||||
const hide = dark ? themeToggleLightIcon : themeToggleDarkIcon
|
const hide = dark ? themeToggleDarkIcon : themeToggleLightIcon;
|
||||||
show.classList.remove('hidden', 'text-transparent');
|
show.classList.remove('hidden', 'text-transparent');
|
||||||
hide.classList.add('hidden', 'text-transparent');
|
hide.classList.add('hidden', 'text-transparent');
|
||||||
if (dark) {
|
if (dark) {
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents.DarkModeSwitcher do
|
|||||||
const themeToggleLightIcon = document.getElementById('theme-toggle-light-icon');
|
const themeToggleLightIcon = document.getElementById('theme-toggle-light-icon');
|
||||||
if (themeToggleDarkIcon != null && themeToggleLightIcon != null) {
|
if (themeToggleDarkIcon != null && themeToggleLightIcon != null) {
|
||||||
let dark = document.documentElement.classList.contains('dark');
|
let dark = document.documentElement.classList.contains('dark');
|
||||||
const show = dark ? themeToggleDarkIcon : themeToggleLightIcon
|
const show = dark ? themeToggleLightIcon : themeToggleDarkIcon;
|
||||||
const hide = dark ? themeToggleLightIcon : themeToggleDarkIcon
|
const hide = dark ? themeToggleDarkIcon : themeToggleLightIcon;
|
||||||
show.classList.remove('hidden', 'text-transparent');
|
show.classList.remove('hidden', 'text-transparent');
|
||||||
hide.classList.add('hidden', 'text-transparent');
|
hide.classList.add('hidden', 'text-transparent');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user