From ba6c2d663b126b6756bfe608fe1e65857ad166ce Mon Sep 17 00:00:00 2001 From: Tywele Date: Thu, 20 Jun 2024 11:30:07 +0200 Subject: [PATCH 1/2] Added home, settings and explore menu entries back into sidebar --- src/lib/components/ui/sidebar/Sidebar.svelte | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/lib/components/ui/sidebar/Sidebar.svelte b/src/lib/components/ui/sidebar/Sidebar.svelte index 066d9d3df..bec16e390 100644 --- a/src/lib/components/ui/sidebar/Sidebar.svelte +++ b/src/lib/components/ui/sidebar/Sidebar.svelte @@ -35,6 +35,22 @@ gap-1 h-fit max-h-screen {$$props.class}" style={$$props.style} > + + + {$t('nav.home')} + + + + + {$t('nav.menu.settings')} + + + + + {$t('nav.communities')} + + +
{#if $profile?.jwt} From 7d151f8ab8e96a902ab227827b7783b6bf0b6a9b Mon Sep 17 00:00:00 2001 From: Tywele Date: Mon, 24 Jun 2024 15:14:46 +0200 Subject: [PATCH 2/2] Added setting to toggle readded menu entries --- src/lib/components/ui/sidebar/Sidebar.svelte | 12 ++++++++---- src/lib/i18n/en.json | 4 ++++ src/lib/settings.ts | 2 ++ src/routes/settings/+page.svelte | 5 +++++ 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/lib/components/ui/sidebar/Sidebar.svelte b/src/lib/components/ui/sidebar/Sidebar.svelte index bec16e390..9af49a353 100644 --- a/src/lib/components/ui/sidebar/Sidebar.svelte +++ b/src/lib/components/ui/sidebar/Sidebar.svelte @@ -35,6 +35,7 @@ gap-1 h-fit max-h-screen {$$props.class}" style={$$props.style} > +{#if $userSettings.legacySidebarNavigation} {$t('nav.home')} @@ -51,6 +52,7 @@
+{/if} {#if $profile?.jwt} @@ -88,13 +90,15 @@ > {$t('account.signup')} - - {$t('nav.menu.settings')} - + > + {$t('nav.menu.settings')} +
+ {/if} {/if} {#if $profileData.profiles.length >= 1}
diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json index 2b1b8c5f0..f393a9827 100644 --- a/src/lib/i18n/en.json +++ b/src/lib/i18n/en.json @@ -547,6 +547,10 @@ "on": "On", "off": "Off", "adaptive": "Adaptive" + }, + "legacySidebarNavigation": { + "title": "Legacy sidebar navigation", + "description": "Use the old sidebar navigation" } }, "app": { diff --git a/src/lib/settings.ts b/src/lib/settings.ts index de5c46b59..f2269fb5b 100644 --- a/src/lib/settings.ts +++ b/src/lib/settings.ts @@ -88,6 +88,7 @@ interface Settings { } language: string | null translator: string | undefined + legacySidebarNavigation: boolean } export const defaultSettings: Settings = { @@ -154,6 +155,7 @@ export const defaultSettings: Settings = { }, language: env.PUBLIC_LANGUAGE ?? null, translator: env.PUBLIC_TRANSLATOR ?? undefined, + legacySidebarNavigation: toBool(env.PUBLIC_LEGACY_SIDEBAR_NAVIGATION) ?? false, } export const userSettings = writable(defaultSettings) diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelte index e6583454d..1424ebe9e 100644 --- a/src/routes/settings/+page.svelte +++ b/src/routes/settings/+page.svelte @@ -88,6 +88,11 @@ bind:selected={$userSettings.dock.noGap} /> +