добавлена страница калькулятора
This commit is contained in:
@@ -7,11 +7,13 @@ import MenuList from '@mui/material/MenuList';
|
||||
import Popover from '@mui/material/Popover';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import {SignOut as SignOutIcon} from '@phosphor-icons/react/dist/ssr/SignOut';
|
||||
import {SignIn as SignInIcon} from '@phosphor-icons/react/dist/ssr/SignIn';
|
||||
import {logger} from "../../lib/DefaultLogger";
|
||||
import {useAuth} from "../../hooks/useAuth";
|
||||
import {authClient} from "../../lib/clients/AuthClient";
|
||||
import {useLocation} from "react-router-dom";
|
||||
import {useUser} from "../../hooks/useUser";
|
||||
import {paths} from "../../path";
|
||||
|
||||
export function UserPopover({anchorEl, onClose, open}) {
|
||||
const {checkSession} = useAuth();
|
||||
@@ -64,24 +66,28 @@ export function UserPopover({anchorEl, onClose, open}) {
|
||||
{/* </ListItemIcon>*/}
|
||||
{/* Профиль*/}
|
||||
{/*</MenuItem>*/}
|
||||
<MenuItem onClick={handleSignOut}>
|
||||
<ListItemIcon>
|
||||
<SignOutIcon fontSize="var(--icon-fontSize-md)"/>
|
||||
</ListItemIcon>
|
||||
Выход
|
||||
</MenuItem>
|
||||
{!user.name ? <MenuItem onClick={() => window.location.replace(paths.auth.signIn)}>
|
||||
<ListItemIcon>
|
||||
<SignInIcon fontSize="var(--icon-fontSize-md)"/>
|
||||
</ListItemIcon>
|
||||
Вход
|
||||
</MenuItem> :
|
||||
<MenuItem onClick={handleSignOut}>
|
||||
<ListItemIcon>
|
||||
<SignOutIcon fontSize="var(--icon-fontSize-md)"/>
|
||||
</ListItemIcon>
|
||||
Выход
|
||||
</MenuItem>
|
||||
}
|
||||
</MenuList>
|
||||
</Popover>
|
||||
);
|
||||
}
|
||||
|
||||
function userDescriptor(user, session) {
|
||||
if (!user) {
|
||||
return (<Typography variant="subtitle1">Ошибка загрузки данных</Typography>);
|
||||
function userDescriptor(user) {
|
||||
if (!user.name) {
|
||||
return (<Typography variant="subtitle1">Гость</Typography>);
|
||||
}
|
||||
|
||||
const open = (session.isActive && user.invited) ? "открыт" : "закрыт";
|
||||
|
||||
return (
|
||||
<>
|
||||
<Typography variant="subtitle1">{user.name + " " + user.lastName}</Typography>
|
||||
|
||||
Reference in New Issue
Block a user