diff --git a/src/WrapperApp/components/NavPanel/NavPanel.tsx b/src/WrapperApp/components/NavPanel/NavPanel.tsx index fd48060c5..341948b12 100644 --- a/src/WrapperApp/components/NavPanel/NavPanel.tsx +++ b/src/WrapperApp/components/NavPanel/NavPanel.tsx @@ -5,6 +5,7 @@ import { Box, List, useTheme } from '@mui/material'; import Typography from '@mui/material/Typography'; import { SyntheticEvent, useMemo } from 'react'; +import { useConfig } from '../../../config/ConfigService'; import { AuthContext, useAuth } from '../../../services/AuthService'; import { useStore } from '../../../services/StoreService'; import deployInfo from '../../../util/identify/deployInfo.json'; @@ -45,6 +46,7 @@ function LogInOut(props: { authContext: AuthContext; handleChange: (event: SyntheticEvent, value: string) => void; }) { + const { demoMode } = useConfig(); const { isAuthorized, user, logout } = props.authContext; const username = useMemo( @@ -54,51 +56,53 @@ function LogInOut(props: { return ( - - {isAuthorized && user ? ( - - Log out{' '} - - {user.username} + {!demoMode && ( + + {isAuthorized && user ? ( + + Log out{' '} + + {user.username} + - - ) : ( - 'Log in' - )} - - ), - description: , - value: 'deployInfo', - disabled: false, - info: isAuthorized ? username : 'Log in', - icon: - }} - open={true} - onClick={(event: SyntheticEvent) => { - if (isAuthorized) logout(); - else props.handleChange(event, 'login'); - }} - buttonProps={{ - type: 'button' - }} - /> + ) : ( + 'Log in' + )} + + ), + description: , + value: 'deployInfo', + disabled: false, + info: isAuthorized ? username : 'Log in', + icon: + }} + open={true} + onClick={(event: SyntheticEvent) => { + if (isAuthorized) logout(); + else props.handleChange(event, 'login'); + }} + buttonProps={{ + type: 'button' + }} + /> + )} ); }