diff --git a/src/app/(main)/SideNav.tsx b/src/app/(main)/SideNav.tsx index 4cfe78a7..d11d80d3 100644 --- a/src/app/(main)/SideNav.tsx +++ b/src/app/(main)/SideNav.tsx @@ -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 ( - + - {bottomLinks.map(({ id, path, label, icon }) => { - return ( - - - - ); - })} + {!teamId && + bottomLinks.map(({ id, path, label, icon }) => { + return ( + + + + ); + })} - {websiteId && } + {isWebsite && } ); } diff --git a/src/app/(main)/TopNav.tsx b/src/app/(main)/TopNav.tsx index ff2b8f54..c537e278 100644 --- a/src/app/(main)/TopNav.tsx +++ b/src/app/(main)/TopNav.tsx @@ -9,7 +9,7 @@ import { PanelButton } from '@/components/input/PanelButton'; export function TopNav() { const { teamId, websiteId, pathname } = useNavigation(); - const isSettings = pathname.includes('/settings'); + const isWebsite = websiteId && !pathname.includes('/settings'); return ( - + - - - {websiteId && !isSettings && ( - <> - - - - )} - + + {isWebsite && ( + <> + + + + )} diff --git a/src/app/(main)/websites/[websiteId]/WebsiteNav.tsx b/src/app/(main)/websites/[websiteId]/WebsiteNav.tsx index 37411c0a..dd551553 100644 --- a/src/app/(main)/websites/[websiteId]/WebsiteNav.tsx +++ b/src/app/(main)/websites/[websiteId]/WebsiteNav.tsx @@ -134,7 +134,7 @@ export function WebsiteNav({ websiteId }: { websiteId: string }) { 'overview'; return ( - + {links.map(({ label, items }) => { return ( diff --git a/src/components/input/PanelButton.tsx b/src/components/input/PanelButton.tsx index fe6c8b66..04a9b01c 100644 --- a/src/components/input/PanelButton.tsx +++ b/src/components/input/PanelButton.tsx @@ -1,11 +1,11 @@ -import { Button, Icon } from '@umami/react-zen'; +import { Button, Icon, ButtonProps } from '@umami/react-zen'; import { PanelLeft } from '@/components/icons'; import { useGlobalState } from '@/components/hooks'; -export function PanelButton() { +export function PanelButton(props: ButtonProps) { const [isCollapsed, setIsCollapsed] = useGlobalState('sidenav-collapsed'); return ( -