web/settings: move switcher description to correct component

This commit is contained in:
wukko 2024-07-10 19:35:23 +06:00
parent d8420116dc
commit c013134b70
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2
7 changed files with 42 additions and 41 deletions

View file

@ -49,7 +49,7 @@
.toggle-parent {
display: flex;
flex-direction: column;
gap: 10px;
gap: 8px;
overflow: hidden;
}

View file

@ -1,12 +1,24 @@
<script lang="ts">
export let big: boolean = false;
export let description: string = "";
</script>
<div id="switcher-container" class="switcher" class:big={big} role="listbox">
<slot></slot>
<div class="switcher-parent">
<div class="switcher" class:big={big} role="listbox">
<slot></slot>
</div>
{#if description}
<div class="settings-content-description subtext">{description}</div>
{/if}
</div>
<style>
.switcher-parent {
display: flex;
flex-direction: column;
gap: 8px;
}
.switcher {
display: flex;
width: auto;

View file

@ -3,7 +3,6 @@
export let sectionId: string;
export let title: string;
export let description: string = "";
let animate = false;
@ -21,17 +20,13 @@
>
<h3 class="settings-content-title">{title}</h3>
<slot></slot>
{#if description.length > 0}
<div class="settings-content-description subtext">{description}</div>
{/if}
</section>
<style>
.settings-content {
display: flex;
flex-direction: column;
gap: 10px;
gap: var(--padding);
padding: calc(var(--settings-padding) / 2);
border-radius: 18px;
}

View file

@ -12,12 +12,8 @@
import LanguageAutoToggle from "$components/settings/LanguageAutoToggle.svelte";
</script>
<SettingsCategory
sectionId="theme"
title={$t("settings.theme")}
description={$t("settings.theme.description")}
>
<Switcher big={true}>
<SettingsCategory sectionId="theme" title={$t("settings.theme")}>
<Switcher big={true} description={$t("settings.theme.description")}>
{#each themeOptions as value}
<SettingsButton
settingContext="appearance"

View file

@ -9,12 +9,8 @@
import SettingsToggle from "$components/buttons/SettingsToggle.svelte";
</script>
<SettingsCategory
sectionId="audio-format"
title={$t("settings.audio.format")}
description={$t("settings.audio.format.description")}
>
<Switcher big={true}>
<SettingsCategory sectionId="audio-format" title={$t("settings.audio.format")}>
<Switcher big={true} description={$t("settings.audio.format.description")}>
{#each audioFormatOptions as value}
<SettingsButton
settingContext="save"

View file

@ -9,12 +9,11 @@
import SettingsToggle from "$components/buttons/SettingsToggle.svelte";
</script>
<SettingsCategory
sectionId="filename"
title={$t("settings.metadata.filename")}
description={$t("settings.metadata.filename.description")}
>
<Switcher big={true}>
<SettingsCategory sectionId="filename" title={$t("settings.metadata.filename")}>
<Switcher
big={true}
description={$t("settings.metadata.filename.description")}
>
{#each filenameStyleOptions as value}
<SettingsButton
settingContext="save"

View file

@ -13,36 +13,41 @@
<SettingsCategory
sectionId="video-quality"
title={$t("settings.video.quality")}
description={$t("settings.video.quality.description")}
>
<Switcher big={true}>
<Switcher big={true} description={$t("settings.video.quality.description")}>
{#each videoQualityOptions as value}
<SettingsButton settingContext="save" settingId="videoQuality" settingValue={value}>
<SettingsButton
settingContext="save"
settingId="videoQuality"
settingValue={value}
>
{$t(`settings.video.quality.${value}`)}
</SettingsButton>
{/each}
</Switcher>
</SettingsCategory>
<SettingsCategory
sectionId="youtube-codec"
title={$t("settings.video.youtube.codec")}
description={$t("settings.video.youtube.codec.description")}
>
<Switcher big={true}>
<Switcher
big={true}
description={$t("settings.video.youtube.codec.description")}
>
{#each youtubeVideoCodecOptions as value}
<SettingsButton settingContext="save" settingId="youtubeVideoCodec" settingValue={value}>
<SettingsButton
settingContext="save"
settingId="youtubeVideoCodec"
settingValue={value}
>
{$t(`settings.video.youtube.codec.${value}`)}
</SettingsButton>
{/each}
</Switcher>
</SettingsCategory>
<SettingsCategory
sectionId="twitter"
title={$t("settings.video.twitter.gif")}>
<SettingsCategory sectionId="twitter" title={$t("settings.video.twitter.gif")}>
<SettingsToggle
settingContext="save"
settingId="twitterGif"
@ -51,9 +56,7 @@
/>
</SettingsCategory>
<SettingsCategory
sectionId="tiktok"
title={$t("settings.video.tiktok.h265")}>
<SettingsCategory sectionId="tiktok" title={$t("settings.video.tiktok.h265")}>
<SettingsToggle
settingContext="save"
settingId="tiktokH265"