mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 08:37:13 +01:00
Refactored settings. Updated sidebar.
This commit is contained in:
parent
d130242a0a
commit
3c5c1e48e9
26 changed files with 144 additions and 129 deletions
|
|
@ -20,12 +20,6 @@ export function SettingsLayout({ children }: { children: ReactNode }) {
|
|||
path: renderUrl('/settings/preferences'),
|
||||
icon: <Knobs />,
|
||||
},
|
||||
{
|
||||
id: 'teams',
|
||||
label: formatMessage(labels.teams),
|
||||
path: renderUrl('/settings/teams'),
|
||||
icon: <Users />,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -37,12 +31,18 @@ export function SettingsLayout({ children }: { children: ReactNode }) {
|
|||
path: renderUrl('/settings/profile'),
|
||||
icon: <UserCircle />,
|
||||
},
|
||||
{
|
||||
id: 'teams',
|
||||
label: formatMessage(labels.teams),
|
||||
path: renderUrl('/settings/teams'),
|
||||
icon: <Users />,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const selectedKey =
|
||||
items.flatMap(e => e.items)?.find(({ path }) => path && pathname.endsWith(path))?.id ||
|
||||
items.flatMap(e => e.items)?.find(({ path }) => path && pathname.includes(path))?.id ||
|
||||
'overview';
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -4,16 +4,19 @@ import { useMessages } from '@/components/hooks';
|
|||
import { Panel } from '@/components/common/Panel';
|
||||
import { PreferenceSettings } from './PreferenceSettings';
|
||||
import { PageHeader } from '@/components/common/PageHeader';
|
||||
import { PageBody } from '@/components/common/PageBody';
|
||||
|
||||
export function PreferencesPage() {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<Column gap="6">
|
||||
<PageHeader title={formatMessage(labels.preferences)} />
|
||||
<Panel>
|
||||
<PreferenceSettings />
|
||||
</Panel>
|
||||
</Column>
|
||||
<PageBody>
|
||||
<Column gap="6">
|
||||
<PageHeader title={formatMessage(labels.preferences)} />
|
||||
<Panel>
|
||||
<PreferenceSettings />
|
||||
</Panel>
|
||||
</Column>
|
||||
</PageBody>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,16 +4,19 @@ import { useMessages } from '@/components/hooks';
|
|||
import { Panel } from '@/components/common/Panel';
|
||||
import { Column } from '@umami/react-zen';
|
||||
import { PageHeader } from '@/components/common/PageHeader';
|
||||
import { PageBody } from '@/components/common/PageBody';
|
||||
|
||||
export function ProfilePage() {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<Column gap="6">
|
||||
<PageHeader title={formatMessage(labels.profile)} />
|
||||
<Panel>
|
||||
<ProfileSettings />
|
||||
</Panel>
|
||||
</Column>
|
||||
<PageBody>
|
||||
<Column gap="6">
|
||||
<PageHeader title={formatMessage(labels.profile)} />
|
||||
<Panel>
|
||||
<ProfileSettings />
|
||||
</Panel>
|
||||
</Column>
|
||||
</PageBody>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
'use client';
|
||||
import { TeamProvider } from '@/app/(main)/teams/[teamId]/TeamProvider';
|
||||
import { TeamDetails } from '@/app/(main)/teams/[teamId]/TeamDetails';
|
||||
import { TeamSettings } from '@/app/(main)/teams/[teamId]/TeamSettings';
|
||||
|
||||
export function TeamSettingsPage({ teamId }: { teamId: string }) {
|
||||
return (
|
||||
<TeamProvider teamId={teamId}>
|
||||
<TeamDetails teamId={teamId} />
|
||||
<TeamSettings teamId={teamId} />
|
||||
</TeamProvider>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue