mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
Refactor env check.
This commit is contained in:
parent
ba63991a92
commit
fc9584eb44
14 changed files with 30 additions and 76 deletions
|
|
@ -8,10 +8,12 @@ import User from 'assets/user.svg';
|
|||
import styles from './UserButton.module.css';
|
||||
import { AUTH_TOKEN } from 'lib/constants';
|
||||
import useUser from 'hooks/useUser';
|
||||
import useConfig from 'hooks/useConfig';
|
||||
|
||||
export default function UserButton() {
|
||||
const { user } = useUser();
|
||||
const router = useRouter();
|
||||
const { adminDisabled } = useConfig();
|
||||
|
||||
const menuOptions = [
|
||||
{
|
||||
|
|
@ -28,7 +30,7 @@ export default function UserButton() {
|
|||
{
|
||||
label: <FormattedMessage id="label.profile" defaultMessage="Profile" />,
|
||||
value: 'profile',
|
||||
hidden: process.env.isAdminDisabled,
|
||||
hidden: adminDisabled,
|
||||
},
|
||||
{ label: <FormattedMessage id="label.logout" defaultMessage="Logout" />, value: 'logout' },
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue