mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-12-06 19:56:45 +10:30
fix(ui): shared Button states, Theme of the Month inside its card, reuse Button for Generate QR
This commit is contained in:
1 parent
0f9b8efc40
commit
38f934c01f
5 files changed
+18
-24
No files matched your search
@@ -14,7 +14,7 @@
|
||||
type="button"
|
||||
onclick={onClick}
|
||||
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}
|
||||
</button>
|
||||
@@ -2,6 +2,7 @@
|
||||
import { fade } from "svelte/transition";
|
||||
import browser from "webextension-polyfill";
|
||||
import QRCode from "qrcode";
|
||||
import Button from "./Button.svelte";
|
||||
import { portal } from "../utils/portal";
|
||||
import { settingsState } from "@/seqta/utils/listeners/SettingsState";
|
||||
|
||||
@@ -106,13 +107,7 @@
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col gap-1 items-end">
|
||||
<button
|
||||
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>
|
||||
<Button onClick={generateQrCode} disabled={isLoading} text={isLoading ? "Generating..." : "Generate QR"} />
|
||||
{#if errorMessage}
|
||||
<p class="text-xs text-right text-amber-600 dark:text-amber-400">{errorMessage}</p>
|
||||
{/if}
|
||||
|
||||
@@ -182,20 +182,19 @@
|
||||
{/if}
|
||||
{/each}
|
||||
{/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>
|
||||
|
||||
{#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>
|
||||
{/each}
|
||||
@@ -200,7 +200,7 @@
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
<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}
|
||||
>
|
||||
{#if isFormVisible}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<button
|
||||
onclick={() => selectNoBackground()}
|
||||
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"
|
||||
? clearTheme ? 'Clear Theme' : 'Select a Theme'
|
||||
: clearTheme ? 'Clear Background' : 'No Background Selected'}
|
||||
|
||||
Reference in new issue
Block a user