From 3a0b0fed8b20b3c5744a74477746d9a904b36db7 Mon Sep 17 00:00:00 2001 From: wukko Date: Mon, 28 Oct 2024 21:42:07 +0600 Subject: [PATCH] web/settings: convert `LanguageDropdown` to universal `SettingsDropdown` --- .../components/buttons/SettingsToggle.svelte | 10 ++- ...ropdown.svelte => SettingsDropdown.svelte} | 72 +++++++++++-------- .../routes/settings/appearance/+page.svelte | 26 ++++++- 3 files changed, 69 insertions(+), 39 deletions(-) rename web/src/components/settings/{LanguageDropdown.svelte => SettingsDropdown.svelte} (64%) diff --git a/web/src/components/buttons/SettingsToggle.svelte b/web/src/components/buttons/SettingsToggle.svelte index 75a564e5..f9c3cbfd 100644 --- a/web/src/components/buttons/SettingsToggle.svelte +++ b/web/src/components/buttons/SettingsToggle.svelte @@ -39,16 +39,14 @@ updateSetting({ [settingContext]: { [settingId]: !isEnabled, - }, - })} + } + }) + } >

{title}

- + {#if description}
{description}
{/if} diff --git a/web/src/components/settings/LanguageDropdown.svelte b/web/src/components/settings/SettingsDropdown.svelte similarity index 64% rename from web/src/components/settings/LanguageDropdown.svelte rename to web/src/components/settings/SettingsDropdown.svelte index 89f2b44f..585d5e67 100644 --- a/web/src/components/settings/LanguageDropdown.svelte +++ b/web/src/components/settings/SettingsDropdown.svelte @@ -1,57 +1,69 @@ - -
-
+
+

- {$t("settings.language.preferred.title")} + {title}

- onChange(e)} {disabled}> + {#each Object.keys(items) as value} + {/each}
-
- {$t("settings.language.preferred.description")} -
+ + {#if description} +
+ {description} +
+ {/if}