Fixed nav display.

This commit is contained in:
Mike Cao 2025-07-20 00:38:15 -07:00
parent 2f7f8911cd
commit 25f96f6b6b
5 changed files with 30 additions and 32 deletions

View file

@ -21,8 +21,9 @@ import { WebsiteNav } from '@/app/(main)/websites/[websiteId]/WebsiteNav';
export function SideNav(props: SidebarProps) {
const { formatMessage, labels } = useMessages();
const { pathname, renderUrl, websiteId } = useNavigation();
const { pathname, renderUrl, websiteId, teamId } = useNavigation();
const [isCollapsed] = useGlobalState('sidenav-collapsed');
const isWebsite = websiteId && !pathname.includes('/settings');
const links = [
{
@ -67,10 +68,10 @@ export function SideNav(props: SidebarProps) {
];
return (
<Row height="100%" margin="2" backgroundColor border borderRadius>
<Row height="100%" backgroundColor border="right">
<Sidebar
{...props}
isCollapsed={isCollapsed || websiteId}
isCollapsed={isCollapsed || isWebsite}
muteItems={false}
variant="quiet"
showBorder={false}
@ -88,16 +89,17 @@ export function SideNav(props: SidebarProps) {
})}
</SidebarSection>
<SidebarSection>
{bottomLinks.map(({ id, path, label, icon }) => {
return (
<Link key={id} href={path} role="button">
<SidebarItem label={label} icon={icon} isSelected={pathname.startsWith(path)} />
</Link>
);
})}
{!teamId &&
bottomLinks.map(({ id, path, label, icon }) => {
return (
<Link key={id} href={path} role="button">
<SidebarItem label={label} icon={icon} isSelected={pathname.startsWith(path)} />
</Link>
);
})}
</SidebarSection>
</Sidebar>
{websiteId && <WebsiteNav websiteId={websiteId} />}
{isWebsite && <WebsiteNav websiteId={websiteId} />}
</Row>
);
}