Skip to content

Commit

Permalink
fix: Added icons to Calendar Creator sections
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Feb 20, 2024
1 parent 6bf30fe commit eba9cc6
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions src/settings/creator/Creator.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
<script lang="ts">
import type { Calendar } from "src/@types";
import type Calendarium from "src/main";
import { ButtonComponent, Platform } from "obsidian";
import { setContext } from "svelte";
import { onMount } from "svelte";
import { type Writable } from "svelte/store";
import createStore from "./stores/calendar";
import CreatorTitle from "./CreatorTitle.svelte";
import History from "./Utilities/History.svelte";
import General from "./Containers/general/General.svelte";
Expand Down Expand Up @@ -72,6 +67,18 @@
dispatch("cancel");
});
};
const getIcon = (section: CreatorSection) => {
switch (section) {
case "General":
return "badge-info";
case "Dates":
return "calendar";
case "Celestial Bodies":
return "moon";
case "Events":
return "calendar-clock";
}
};
</script>

{#if !Platform.isMobile}
Expand All @@ -85,7 +92,10 @@
class:is-active={SelectedSection === SECTION}
on:click={() => (SelectedSection = SECTION)}
>
{SECTION}
<div class="section">
<div use:setNodeIcon={getIcon(SECTION)} />
{SECTION}
</div>
{#if !validSection(SECTION)}
<div
class="calendarium-warning x-small"
Expand Down Expand Up @@ -179,4 +189,9 @@
justify-content: flex-end;
display: flex;
}
.section {
display: flex;
align-items: center;
gap: 0.25rem;
}
</style>

0 comments on commit eba9cc6

Please sign in to comment.