mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Fixed nav display.
This commit is contained in:
parent
2f7f8911cd
commit
25f96f6b6b
5 changed files with 30 additions and 32 deletions
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<Row
|
||||
|
|
@ -24,21 +24,19 @@ export function TopNav() {
|
|||
zIndex={1}
|
||||
>
|
||||
<Row alignItems="center">
|
||||
<PanelButton />
|
||||
<PanelButton isDisabled={!!isWebsite} />
|
||||
<Seperator />
|
||||
<Row alignItems="center" gap="1">
|
||||
<TeamsButton />
|
||||
{websiteId && !isSettings && (
|
||||
<>
|
||||
<Seperator />
|
||||
<WebsiteSelect
|
||||
buttonProps={{ variant: 'quiet' }}
|
||||
websiteId={websiteId}
|
||||
teamId={teamId}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</Row>
|
||||
<TeamsButton />
|
||||
{isWebsite && (
|
||||
<>
|
||||
<Seperator />
|
||||
<WebsiteSelect
|
||||
buttonProps={{ variant: 'quiet' }}
|
||||
websiteId={websiteId}
|
||||
teamId={teamId}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</Row>
|
||||
<Row alignItems="center" justifyContent="flex-end">
|
||||
<ThemeButton />
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ export function WebsiteNav({ websiteId }: { websiteId: string }) {
|
|||
'overview';
|
||||
|
||||
return (
|
||||
<Column gap padding width="240px" border="left">
|
||||
<Column gap padding width="240px" border="left" overflowY="auto">
|
||||
<NavMenu highlightColor="2">
|
||||
{links.map(({ label, items }) => {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<Button onPress={() => setIsCollapsed(!isCollapsed)} variant="quiet">
|
||||
<Button onPress={() => setIsCollapsed(!isCollapsed)} variant="quiet" {...props}>
|
||||
<Icon>
|
||||
<PanelLeft />
|
||||
</Icon>
|
||||
|
|
|
|||
|
|
@ -170,8 +170,6 @@ async function clickhouseQuery(
|
|||
from (
|
||||
select session_id s,
|
||||
${columnQuery} as t
|
||||
from website_event_stats_hourly website_event
|
||||
select ${columnQuery} as t
|
||||
from website_event_stats_hourly as website_event
|
||||
${cohortQuery}
|
||||
where website_id = {websiteId:UUID}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue