2020-08-17 19:21:14 +02:00
|
|
|
import { Menu, MenuItem } from '@material-ui/core';
|
2020-08-17 23:56:34 +02:00
|
|
|
import React, { useContext } from 'react';
|
|
|
|
import { CASContext } from '../contexts/CASProvider';
|
2020-06-10 21:40:33 +02:00
|
|
|
|
|
|
|
interface ProfileProps {
|
2020-08-17 19:21:14 +02:00
|
|
|
anchorEl: HTMLElement | null;
|
|
|
|
handleClose: () => void;
|
2020-06-10 21:40:33 +02:00
|
|
|
}
|
|
|
|
|
2020-08-17 23:56:34 +02:00
|
|
|
export const Profile = ({ anchorEl, handleClose }: ProfileProps) => {
|
|
|
|
const { logout } = useContext(CASContext)!;
|
|
|
|
|
2020-08-17 19:21:14 +02:00
|
|
|
return (
|
2020-08-17 23:56:34 +02:00
|
|
|
<Menu anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={handleClose}>
|
2020-08-17 19:21:14 +02:00
|
|
|
<MenuItem>Profile</MenuItem>
|
|
|
|
<MenuItem>My account</MenuItem>
|
2020-08-17 23:56:34 +02:00
|
|
|
<MenuItem onClick={logout}>Logout</MenuItem>
|
2020-08-17 19:21:14 +02:00
|
|
|
</Menu>
|
|
|
|
);
|
2020-06-10 21:40:33 +02:00
|
|
|
};
|