Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions src/lib/components/ui/sidebar/Sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@
gap-1 h-fit max-h-screen {$$props.class}"
style={$$props.style}
>
{#if $userSettings.legacySidebarNavigation}
<SidebarButton icon={Home} href="/">
<span slot="label">
{$t('nav.home')}
</span>
</SidebarButton>
<SidebarButton icon={Cog6Tooth} href="/settings">
<span slot="label">
{$t('nav.menu.settings')}
</span>
</SidebarButton>
<SidebarButton icon={GlobeAlt} href="/communities">
<span slot="label">
{$t('nav.communities')}
</span>
</SidebarButton>
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
{/if}
{#if $profile?.jwt}
<SidebarButton icon={UserCircle} href="/profile/user">
<span slot="label">
Expand Down Expand Up @@ -72,13 +90,15 @@
>
<span slot="label">{$t('account.signup')}</span>
</SidebarButton>
<SidebarButton
{#if $userSettings.legacySidebarNavigation === false}
<SidebarButton
href="/settings"
title={$t('nav.menu.settings')}
icon={Cog6Tooth}
>
<span slot="label">{$t('nav.menu.settings')}</span>
</SidebarButton>
>
<span slot="label">{$t('nav.menu.settings')}</span>
</SidebarButton>
{/if}
{/if}
{#if $profileData.profiles.length >= 1}
<hr class="border-slate-200 dark:border-zinc-900 my-1" />
Expand Down
4 changes: 4 additions & 0 deletions src/lib/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,10 @@
"on": "On",
"off": "Off",
"adaptive": "Adaptive"
},
"legacySidebarNavigation": {
"title": "Legacy sidebar navigation",
"description": "Use the old sidebar navigation"
}
},
"app": {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ interface Settings {
}
language: string | null
translator: string | undefined
legacySidebarNavigation: boolean
}

export const defaultSettings: Settings = {
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions src/routes/settings/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@
bind:selected={$userSettings.dock.noGap}
/>
</Setting>
<ToggleSetting
bind:checked={$userSettings.legacySidebarNavigation}
title={$t('settings.navigation.legacySidebarNavigation.title')}
description={$t('settings.navigation.legacySidebarNavigation.description')}
/>
</Section>

<Section title={$t('settings.app.title')}>
Expand Down