Sidebar: Collapse logo when sidebar is collapsed

This commit is contained in:
gbuomprisco
2024-10-15 16:58:09 +08:00
parent 03cd7fcd3f
commit 93cb011260

View File

@@ -1,5 +1,6 @@
import { If } from '@kit/ui/if';
import { Sidebar, SidebarContent, SidebarNavigation } from '@kit/ui/sidebar';
import { cn } from '@kit/ui/utils';
import { AppLogo } from '~/components/app-logo';
import { ProfileAccountDropdownContainer } from '~/components/personal-account-dropdown-container';
@@ -25,7 +26,14 @@ export function HomeSidebar(props: HomeSidebarProps) {
<div className={'flex items-center justify-between space-x-2'}>
<If
condition={featuresFlagConfig.enableTeamAccounts}
fallback={<AppLogo className={'py-2'} />}
fallback={
<AppLogo
className={cn({
'max-w-full': collapsed,
'py-2': !collapsed,
})}
/>
}
>
<HomeAccountSelector userId={user.id} accounts={accounts} />
</If>
@@ -42,10 +50,7 @@ export function HomeSidebar(props: HomeSidebarProps) {
<div className={'absolute bottom-4 left-0 w-full'}>
<SidebarContent>
<ProfileAccountDropdownContainer
user={user}
account={workspace}
/>
<ProfileAccountDropdownContainer user={user} account={workspace} />
</SidebarContent>
</div>
</Sidebar>