Sidebar: make it possible to set the sidebar as collapsed (#72)

* Sidebar: make it possible to set the sidebar as collapsed
This commit is contained in:
Giancarlo Buomprisco
2024-10-14 11:31:18 +02:00
committed by GitHub
parent d137df2675
commit b2c27eb25b
19 changed files with 221 additions and 100 deletions

View File

@@ -1,8 +1,11 @@
'use client';
import { useContext } from 'react';
import { useRouter } from 'next/navigation';
import { AccountSelector } from '@kit/accounts/account-selector';
import { SidebarContext } from '@kit/ui/sidebar';
import featureFlagsConfig from '~/config/feature-flags.config';
import pathsConfig from '~/config/paths.config';
@@ -19,13 +22,13 @@ export function HomeAccountSelector(props: {
}>;
userId: string;
collapsed: boolean;
}) {
const router = useRouter();
const { collapsed } = useContext(SidebarContext);
return (
<AccountSelector
collapsed={props.collapsed}
collapsed={collapsed}
accounts={props.accounts}
features={features}
userId={props.userId}