Skip to content

Commit

Permalink
set light as default mode
Browse files Browse the repository at this point in the history
  • Loading branch information
edeleastar committed Nov 26, 2024
1 parent 7cc32fe commit 62ae305
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/lib/ui/themes/styles/icon-lib.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { IconType } from "$lib/services/models/lo-types";
import { FluentIconLib } from "../icons/fluent-icons";
import { HeroIconLib } from "../icons/hero-icons";

let StandardIconLib = FluentIconLib;
let StandardIconLib: { [key: string]: IconType } = FluentIconLib;
export const themes = ["tutors", "nouveau", "concord", "nosh", "rose", "fennec", "mona", "cerberus"];

export const themeIcons = {
Expand All @@ -19,6 +19,9 @@ export const themeIcons = {
};

export function setDisplayMode(mode: string): void {
if (!mode) {
mode = "light";
}
lightMode.value = mode;
localStorage.modeCurrent = mode;
if (mode === "dark") {
Expand All @@ -40,7 +43,12 @@ export function setIconLibForTheme(theme: string) {
}

export function getIcon(type: string): IconType {
return StandardIconLib[type];
if (StandardIconLib[type]) {
return StandardIconLib[type];
} else {
console.log("No type found for icon", type);
return StandardIconLib.tutors;
}
}

export function addIcon(type: string, icon: IconType) {
Expand Down

0 comments on commit 62ae305

Please sign in to comment.