Files
swiss-datashare/frontend/src/components/navBar/ActionAvatar.tsx

36 lines
842 B
TypeScript
Raw Normal View History

2022-05-18 12:35:20 +02:00
import { ActionIcon, Avatar, Menu } from "@mantine/core";
2022-05-11 13:50:28 +02:00
import { NextLink } from "@mantine/next";
2022-10-10 22:30:04 +02:00
import { DoorExit, Link } from "tabler-icons-react";
import authService from "../../services/auth.service";
2022-05-11 13:50:28 +02:00
const ActionAvatar = () => {
return (
2022-10-10 22:14:23 +02:00
<Menu>
<Menu.Target>
2022-05-11 13:50:28 +02:00
<ActionIcon>
<Avatar size={28} radius="xl" />
</ActionIcon>
2022-10-10 22:14:23 +02:00
</Menu.Target>
<Menu.Dropdown>
<Menu.Item
component={NextLink}
href="/account/shares"
icon={<Link size={14} />}
>
2022-10-10 22:30:04 +02:00
My shares
2022-10-10 22:14:23 +02:00
</Menu.Item>
<Menu.Item
onClick={async () => {
authService.signOut();
}}
icon={<DoorExit size={14} />}
>
Sign out
</Menu.Item>
</Menu.Dropdown>
2022-05-11 13:50:28 +02:00
</Menu>
);
};
export default ActionAvatar;