mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 16:45:35 +01:00
Added checks for CLOUD_MODE.
This commit is contained in:
parent
5657a64c77
commit
3ac560dc0f
24 changed files with 175 additions and 60 deletions
|
|
@ -10,9 +10,11 @@ import { labels } from 'components/messages';
|
|||
import useUser from 'hooks/useUser';
|
||||
import NavGroup from './NavGroup';
|
||||
import styles from './NavBar.module.css';
|
||||
import useConfig from 'hooks/useConfig';
|
||||
|
||||
export default function NavBar() {
|
||||
const { user } = useUser();
|
||||
const { cloudMode } = useConfig();
|
||||
const { formatMessage } = useIntl();
|
||||
const [minimized, setMinimized] = useState(false);
|
||||
const tooltipPosition = minimized ? 'right' : 'top';
|
||||
|
|
@ -24,13 +26,21 @@ export default function NavBar() {
|
|||
];
|
||||
|
||||
const settings = [
|
||||
{ label: formatMessage(labels.websites), url: '/settings/websites', icon: <Icons.Globe /> },
|
||||
!cloudMode && {
|
||||
label: formatMessage(labels.websites),
|
||||
url: '/settings/websites',
|
||||
icon: <Icons.Globe />,
|
||||
},
|
||||
user?.isAdmin && {
|
||||
label: formatMessage(labels.users),
|
||||
url: '/settings/users',
|
||||
icon: <Icons.User />,
|
||||
},
|
||||
{ label: formatMessage(labels.teams), url: '/settings/teams', icon: <Icons.Users /> },
|
||||
!cloudMode && {
|
||||
label: formatMessage(labels.teams),
|
||||
url: '/settings/teams',
|
||||
icon: <Icons.Users />,
|
||||
},
|
||||
{ label: formatMessage(labels.profile), url: '/settings/profile', icon: <Icons.Profile /> },
|
||||
].filter(n => n);
|
||||
|
||||
|
|
@ -53,7 +63,7 @@ export default function NavBar() {
|
|||
<div className={styles.buttons}>
|
||||
<ThemeButton tooltipPosition={tooltipPosition} />
|
||||
<LanguageButton tooltipPosition={tooltipPosition} />
|
||||
<LogoutButton tooltipPosition={tooltipPosition} />
|
||||
{!cloudMode && <LogoutButton tooltipPosition={tooltipPosition} />}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue