fix(ui): shared Button states, Theme of the Month inside its card, reuse Button for Generate QR

This commit is contained in:
SethBurkart123 committed 2026-10-29 11:03:46 +11:00
1 parent 0f9b8efc40
commit 38f934c01f
5 files changed
+18 -24

No files matched your search

+1 -1
View File
@@ -14,7 +14,7 @@
type="button" type="button"
onclick={onClick} onclick={onClick}
disabled={disabled} disabled={disabled}
class="px-5 py-1.5 text-[0.75rem] shadow-2xl border dark:bg-[#38373D]/50 bg-[#DDDDDD]/50 border-[#DDDDDD]/30 dark:border-[#38373D]/30 dark:text-white rounded-lg disabled:cursor-not-allowed disabled:opacity-50" class="px-5 py-1.5 text-[0.75rem] shadow-2xl border dark:bg-[#38373D]/50 bg-[#DDDDDD]/50 border-[#DDDDDD]/30 dark:border-[#38373D]/30 dark:text-white rounded-lg transition enabled:hover:brightness-125 enabled:active:scale-[0.96] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 disabled:cursor-not-allowed disabled:opacity-50"
> >
{text} {text}
</button> </button>
@@ -2,6 +2,7 @@
import { fade } from "svelte/transition"; import { fade } from "svelte/transition";
import browser from "webextension-polyfill"; import browser from "webextension-polyfill";
import QRCode from "qrcode"; import QRCode from "qrcode";
import Button from "./Button.svelte";
import { portal } from "../utils/portal"; import { portal } from "../utils/portal";
import { settingsState } from "@/seqta/utils/listeners/SettingsState"; import { settingsState } from "@/seqta/utils/listeners/SettingsState";
@@ -106,13 +107,7 @@
</script> </script>
<div class="flex flex-col gap-1 items-end"> <div class="flex flex-col gap-1 items-end">
<button <Button onClick={generateQrCode} disabled={isLoading} text={isLoading ? "Generating..." : "Generate QR"} />
type="button"
onclick={generateQrCode}
disabled={isLoading}
class="px-5 py-1.5 text-[0.75rem] text-nowrap shadow-2xl border dark:bg-[#38373D]/50 bg-[#DDDDDD]/50 border-[#DDDDDD]/30 dark:border-[#38373D]/30 dark:text-white rounded-lg disabled:opacity-50 disabled:cursor-not-allowed transition-opacity">
{isLoading ? "Generating..." : "Generate QR"}
</button>
{#if errorMessage} {#if errorMessage}
<p class="text-xs text-right text-amber-600 dark:text-amber-400">{errorMessage}</p> <p class="text-xs text-right text-amber-600 dark:text-amber-400">{errorMessage}</p>
{/if} {/if}
@@ -182,20 +182,19 @@
{/if} {/if}
{/each} {/each}
{/if} {/if}
{#if plugin.pluginId === "global-search"}
<SettingRow
title="Theme of the Month"
description="Show the monthly featured theme popup when a new entry is available"
id={15}
Component={Switch}
{searchQuery}
props={{
state: !($settingsState.themeOfTheMonthDisabled ?? false),
onChange: (isOn: boolean) => (settingsState.themeOfTheMonthDisabled = !isOn),
}}
/>
{/if}
</div> </div>
{#if plugin.pluginId === "global-search"}
<SettingRow
title="Theme of the Month"
description="Show the monthly featured theme popup when a new entry is available"
id={15}
Component={Switch}
{searchQuery}
props={{
state: !($settingsState.themeOfTheMonthDisabled ?? false),
onChange: (isOn: boolean) => (settingsState.themeOfTheMonthDisabled = !isOn),
}}
/>
{/if}
</div> </div>
{/each} {/each}
@@ -200,7 +200,7 @@
transition={{ duration: 0.3 }} transition={{ duration: 0.3 }}
> >
<button <button
class="w-full px-4 py-3 mb-4 text-base dark:text-white transition rounded-xl bg-zinc-200 dark:bg-zinc-700/50" class="w-full px-4 py-3 mb-4 text-base dark:text-white transition rounded-xl bg-zinc-200 dark:bg-zinc-700/50 enabled:hover:bg-zinc-300 dark:enabled:hover:bg-zinc-700 enabled:active:scale-[0.99]"
onclick={isFormVisible ? addNewCustomShortcut : toggleForm} onclick={isFormVisible ? addNewCustomShortcut : toggleForm}
> >
{#if isFormVisible} {#if isFormVisible}
+1 -1
View File
@@ -23,7 +23,7 @@
<button <button
onclick={() => selectNoBackground()} onclick={() => selectNoBackground()}
disabled={section === "backgrounds" && !clearTheme} disabled={section === "backgrounds" && !clearTheme}
class="w-full px-4 py-3 mb-4 text-base dark:text-white transition rounded-xl bg-zinc-200 dark:bg-zinc-700/50 disabled:opacity-50"> class="w-full px-4 py-3 mb-4 text-base dark:text-white transition rounded-xl bg-zinc-200 dark:bg-zinc-700/50 enabled:hover:bg-zinc-300 dark:enabled:hover:bg-zinc-700 enabled:active:scale-[0.99] disabled:opacity-50">
{section === "all" {section === "all"
? clearTheme ? 'Clear Theme' : 'Select a Theme' ? clearTheme ? 'Clear Theme' : 'Select a Theme'
: clearTheme ? 'Clear Background' : 'No Background Selected'} : clearTheme ? 'Clear Background' : 'No Background Selected'}