From 56008676f5d65326e72c1b27ebe051eccf9f88d7 Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 4 Sep 2024 17:50:47 +0600 Subject: [PATCH] web/settings: move sub navigation into its own component --- .../settings/SettingsCategory.svelte | 2 +- web/src/components/sidebar/Sidebar.svelte | 3 +- web/src/components/subnav/PageNav.svelte | 230 +++++++++++ .../PageNavSection.svelte} | 22 +- .../PageNavTab.svelte} | 46 ++- web/src/lib/settings/defaults.ts | 12 - web/src/lib/subnav.ts | 15 + web/src/routes/+error.svelte | 6 +- web/src/routes/settings/+layout.svelte | 367 ++++-------------- web/src/routes/settings/debug/+page.svelte | 4 +- 10 files changed, 363 insertions(+), 344 deletions(-) create mode 100644 web/src/components/subnav/PageNav.svelte rename web/src/components/{settings/SettingsNavSection.svelte => subnav/PageNavSection.svelte} (63%) rename web/src/components/{settings/SettingsNavTab.svelte => subnav/PageNavTab.svelte} (74%) create mode 100644 web/src/lib/subnav.ts diff --git a/web/src/components/settings/SettingsCategory.svelte b/web/src/components/settings/SettingsCategory.svelte index 62166fd5..6a85fcb5 100644 --- a/web/src/components/settings/SettingsCategory.svelte +++ b/web/src/components/settings/SettingsCategory.svelte @@ -38,7 +38,7 @@ display: flex; flex-direction: column; gap: var(--padding); - padding: calc(var(--settings-padding) / 2); + padding: calc(var(--subnav-padding) / 2); border-radius: 18px; transition: opacity 0.2s; } diff --git a/web/src/components/sidebar/Sidebar.svelte b/web/src/components/sidebar/Sidebar.svelte index 82e2869c..9faf1e21 100644 --- a/web/src/components/sidebar/Sidebar.svelte +++ b/web/src/components/sidebar/Sidebar.svelte @@ -1,5 +1,6 @@ + + + + {homeTitle}{stringPageTitle} ~ {$t("general.cobalt")} + + + + + + + + diff --git a/web/src/components/settings/SettingsNavSection.svelte b/web/src/components/subnav/PageNavSection.svelte similarity index 63% rename from web/src/components/settings/SettingsNavSection.svelte rename to web/src/components/subnav/PageNavSection.svelte index 7b138a4e..02c3b4fd 100644 --- a/web/src/components/settings/SettingsNavSection.svelte +++ b/web/src/components/subnav/PageNavSection.svelte @@ -1,34 +1,32 @@ -
+