mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 22:57:12 +01:00
Updates for cloud mode.
Some checks failed
Node.js CI / build (postgresql, 18.18) (push) Has been cancelled
Some checks failed
Node.js CI / build (postgresql, 18.18) (push) Has been cancelled
This commit is contained in:
parent
dc1736458b
commit
f40e1b44f3
51 changed files with 251 additions and 173 deletions
|
|
@ -11,31 +11,31 @@ import {
|
|||
Text,
|
||||
Row,
|
||||
} from '@umami/react-zen';
|
||||
import { useMessages, useLoginQuery, useNavigation } from '@/components/hooks';
|
||||
import { useMessages, useLoginQuery, useNavigation, useConfig } from '@/components/hooks';
|
||||
import { LogOut, UserCircle, LockKeyhole } from '@/components/icons';
|
||||
|
||||
export function ProfileButton() {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { user } = useLoginQuery();
|
||||
const { renderUrl } = useNavigation();
|
||||
const cloudMode = !!process.env.cloudMode;
|
||||
const { cloudUrl } = useConfig();
|
||||
|
||||
const items = [
|
||||
{
|
||||
id: 'profile',
|
||||
id: 'settings',
|
||||
label: formatMessage(labels.profile),
|
||||
path: renderUrl('/settings/profile'),
|
||||
icon: <UserCircle />,
|
||||
},
|
||||
user.isAdmin &&
|
||||
!cloudMode && {
|
||||
!cloudUrl && {
|
||||
id: 'admin',
|
||||
label: formatMessage(labels.admin),
|
||||
path: '/admin',
|
||||
icon: <LockKeyhole />,
|
||||
},
|
||||
{
|
||||
id: 'LogOut',
|
||||
id: 'logout',
|
||||
label: formatMessage(labels.logout),
|
||||
path: '/logout',
|
||||
icon: <LogOut />,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue