Skip to content

Commit

Permalink
fix: settings page active sidebar item
Browse files Browse the repository at this point in the history
  • Loading branch information
V-ed committed Nov 8, 2024
1 parent d963da5 commit db1398f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions client/src/routes/(user)/settings/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
export let data;
$: activeUrl = $page.url.pathname.replace('/settings/', '');
$: currentRoute = findDeepRoute(data.routesInfo, activeUrl);
let sessionUser = getSessionUser<ConfirmedSessionUser>();
$: currentRoute = findDeepRoute(data.routesInfo, $page.url.pathname.replace('/settings/', ''));
$: label = currentRoute && ($t(`settings.${currentRoute.name}.name`) as string);
</script>

Expand All @@ -32,11 +32,11 @@

<div class="flex gap-10 flex-col md:flex-row">
<section>
<Sidebar {activeUrl} class="w-full md:w-64">
<Sidebar activeUrl={$page.url.pathname} class="w-full md:w-64">
<SidebarWrapper>
<SidebarGroup>
{#each data.routesInfo as route}
<SidebarItem href={route.url} label={$t(`settings.${route.name}.name`)} active={activeUrl === route.url}>
<SidebarItem href={route.url} label={$t(`settings.${route.name}.name`)}>
<svelte:fragment slot="icon">
{#if route.icon}
<Icon class={route.icon} />
Expand Down

0 comments on commit db1398f

Please sign in to comment.