feat(settings): auto close popup when opening theme creator

This commit is contained in:
sethburkart123
2024-09-20 16:03:57 +10:00
parent 6267a77a71
commit e49849c18a
@@ -10,6 +10,7 @@
import { deleteTheme } from '@/seqta/ui/themes/deleteTheme' import { deleteTheme } from '@/seqta/ui/themes/deleteTheme'
import { OpenStorePage } from '@/seqta/ui/renderStore' import { OpenStorePage } from '@/seqta/ui/renderStore'
import { themeUpdates } from '@/svelte-interface/hooks/ThemeUpdates' import { themeUpdates } from '@/svelte-interface/hooks/ThemeUpdates'
import { closeExtensionPopup } from '@/SEQTA'
let themes = $state<ThemeList | null>(null); let themes = $state<ThemeList | null>(null);
let { isEditMode } = $props<{ isEditMode: boolean }>(); let { isEditMode } = $props<{ isEditMode: boolean }>();
@@ -32,7 +33,7 @@
try { try {
await deleteTheme(themeId); await deleteTheme(themeId);
if (!themes) return; if (!themes) return;
themes.themes = themes.themes.filter(theme => theme.id !== themeId); themes.themes = themes.themes.filter(theme => theme.id !== themeId);
if (themeId === themes.selectedTheme) { if (themeId === themes.selectedTheme) {
themes.selectedTheme = ''; themes.selectedTheme = '';
@@ -138,7 +139,7 @@
<div class="w-4 h-0.5 bg-white"></div> <div class="w-4 h-0.5 bg-white"></div>
</div> </div>
{/if} {/if}
{#if !isEditMode} {#if !isEditMode}
<div <div
class="absolute z-20 flex w-8 h-8 p-2 text-white transition-all rounded-full delay-[20ms] opacity-0 top-1/4 right-2 bg-black/50 place-items-center group-hover:opacity-100 group-hover:top-1/2 -translate-y-1/2" class="absolute z-20 flex w-8 h-8 p-2 text-white transition-all rounded-full delay-[20ms] opacity-0 top-1/4 right-2 bg-black/50 place-items-center group-hover:opacity-100 group-hover:top-1/2 -translate-y-1/2"
@@ -199,11 +200,11 @@
</button> </button>
<button <button
onclick={() => OpenThemeCreator()} onclick={() => { OpenThemeCreator(); closeExtensionPopup() }}
class="flex items-center justify-center w-full transition aspect-theme rounded-xl bg-zinc-100 dark:bg-zinc-900 dark:text-white" class="flex items-center justify-center w-full transition aspect-theme rounded-xl bg-zinc-100 dark:bg-zinc-900 dark:text-white"
> >
<span class="text-xl font-IconFamily">&#xec60;</span> <span class="text-xl font-IconFamily">&#xec60;</span>
<span class="ml-2">Create your own</span> <span class="ml-2">Create your own</span>
</button> </button>
</div> </div>
</div> </div>