mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Fixed share page. Updated device detect. Updated teams fetch.
This commit is contained in:
parent
27c342811e
commit
1b400da7b2
16 changed files with 118 additions and 109 deletions
|
|
@ -10,7 +10,7 @@ import {
|
|||
} from '@umami/react-zen';
|
||||
import { Globe, LinkIcon, LogoSvg, Grid2x2, PanelLeft } from '@/components/icons';
|
||||
import { useMessages, useNavigation, useGlobalState } from '@/components/hooks';
|
||||
import { TeamsButton } from '@/components/input/TeamsButton';
|
||||
import { NavButton } from '@/components/input/NavButton';
|
||||
import { PanelButton } from '@/components/input/PanelButton';
|
||||
import { Key } from 'react';
|
||||
import { SettingsButton } from '@/components/input/SettingsButton';
|
||||
|
|
@ -48,8 +48,8 @@ export function SideNav(props: SidebarProps) {
|
|||
};
|
||||
|
||||
return (
|
||||
<Row height="100%" backgroundColor border="right">
|
||||
<Sidebar {...props} isCollapsed={isCollapsed || hasNav} muteItems={false} showBorder={false}>
|
||||
<Row height="100%" backgroundColor>
|
||||
<Sidebar {...props} isCollapsed={isCollapsed || hasNav}>
|
||||
<SidebarSection onClick={() => setIsCollapsed(false)}>
|
||||
<SidebarHeader
|
||||
label="umami"
|
||||
|
|
@ -60,7 +60,7 @@ export function SideNav(props: SidebarProps) {
|
|||
</SidebarHeader>
|
||||
</SidebarSection>
|
||||
<SidebarSection paddingTop="0" paddingBottom="0" justifyContent="center">
|
||||
<TeamsButton showText={!hasNav && !isCollapsed} onAction={handleSelect} />
|
||||
<NavButton showText={!hasNav && !isCollapsed} onAction={handleSelect} />
|
||||
</SidebarSection>
|
||||
<SidebarSection flexGrow={1}>
|
||||
{links.map(({ id, path, label, icon }) => {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ export function SettingsLayout({ children }: { children: ReactNode }) {
|
|||
title={formatMessage(labels.settings)}
|
||||
selectedKey={selectedKey}
|
||||
allowMinimize={false}
|
||||
muteItems={false}
|
||||
/>
|
||||
</Column>
|
||||
<Column gap="6" margin="2">
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ export function WebsiteExpandedView({
|
|||
return (
|
||||
<Grid columns="auto 1fr" gap="6" height="100%" overflow="hidden">
|
||||
<Column gap="6" border="right" paddingRight="3" overflowY="auto">
|
||||
<SideMenu items={items} selectedKey={view} muteItems={false} />
|
||||
<SideMenu items={items} selectedKey={view} />
|
||||
</Column>
|
||||
<Column overflow="hidden">
|
||||
<MetricsExpandedTable
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ export function WebsiteNav({ websiteId }: { websiteId: string }) {
|
|||
.find(({ path }) => path && pathname.endsWith(path.split('?')[0]))?.id;
|
||||
|
||||
return (
|
||||
<SideMenu items={items} selectedKey={selectedKey} allowMinimize={false} muteItems={false}>
|
||||
<SideMenu items={items} selectedKey={selectedKey} allowMinimize={false}>
|
||||
<WebsiteSelect
|
||||
websiteId={websiteId}
|
||||
teamId={teamId}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { parseRequest } from '@/lib/request';
|
||||
import { json } from '@/lib/response';
|
||||
import { getAllUserTeams } from '@/queries';
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const { auth, error } = await parseRequest(request);
|
||||
|
|
@ -8,5 +9,7 @@ export async function POST(request: Request) {
|
|||
return error();
|
||||
}
|
||||
|
||||
return json(auth.user);
|
||||
const teams = await getAllUserTeams(auth.user.id);
|
||||
|
||||
return json({ ...auth.user, teams });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { CURRENT_VERSION, HOMEPAGE_URL } from '@/lib/constants';
|
|||
|
||||
export function Footer() {
|
||||
return (
|
||||
<Row as="footer">
|
||||
<Row as="footer" paddingY="6" justifyContent="flex-end">
|
||||
<a href={HOMEPAGE_URL} target="_blank">
|
||||
<Text weight="bold">umami</Text> {`v${CURRENT_VERSION}`}
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -1,20 +1,19 @@
|
|||
import { Row, Icon, Text, ThemeButton } from '@umami/react-zen';
|
||||
import Link from 'next/link';
|
||||
import { LanguageButton } from '@/components/input/LanguageButton';
|
||||
import { PreferencesButton } from '@/components/input/PreferencesButton';
|
||||
import { Logo } from '@/components/icons';
|
||||
import { LogoSvg } from '@/components/icons';
|
||||
|
||||
export function Header() {
|
||||
return (
|
||||
<Row as="header">
|
||||
<Row gap>
|
||||
<Link href="https://umami.is" target="_blank">
|
||||
<Icon size="lg">
|
||||
<Logo />
|
||||
<Row as="header" justifyContent="space-between" alignItems="center" paddingY="3">
|
||||
<a href="https://umami.is" target="_blank">
|
||||
<Row alignItems="center" gap>
|
||||
<Icon>
|
||||
<LogoSvg />
|
||||
</Icon>
|
||||
<Text>umami</Text>
|
||||
</Link>
|
||||
</Row>
|
||||
<Text weight="bold">umami</Text>
|
||||
</Row>
|
||||
</a>
|
||||
<Row alignItems="center" gap>
|
||||
<ThemeButton />
|
||||
<LanguageButton />
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
'use client';
|
||||
import { Column } from '@umami/react-zen';
|
||||
import { WebsiteProvider } from '@/app/(main)/websites/WebsiteProvider';
|
||||
import { WebsitePage } from '@/app/(main)/websites/[websiteId]/WebsitePage';
|
||||
import { useShareTokenQuery } from '@/components/hooks';
|
||||
|
|
@ -14,12 +15,14 @@ export function SharePage({ shareId }) {
|
|||
}
|
||||
|
||||
return (
|
||||
<PageBody>
|
||||
<Header />
|
||||
<WebsiteProvider websiteId={shareToken.websiteId}>
|
||||
<WebsitePage websiteId={shareToken.websiteId} />
|
||||
</WebsiteProvider>
|
||||
<Footer />
|
||||
</PageBody>
|
||||
<Column backgroundColor="2">
|
||||
<PageBody gap>
|
||||
<Header />
|
||||
<WebsiteProvider websiteId={shareToken.websiteId}>
|
||||
<WebsitePage websiteId={shareToken.websiteId} />
|
||||
</WebsiteProvider>
|
||||
<Footer />
|
||||
</PageBody>
|
||||
</Column>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue