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

42 lines
1.1 KiB
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-05-11 15:32:28 +02:00
import { DoorExit, Link, Moon } from "tabler-icons-react";
import authService from "../../services/auth.service";
2022-05-11 15:32:28 +02:00
import ToggleThemeButton from "./ToggleThemeButton";
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.Label>My account</Menu.Label>
<Menu.Item
component={NextLink}
href="/account/shares"
icon={<Link size={14} />}
>
Shares
</Menu.Item>
<Menu.Item
onClick={async () => {
authService.signOut();
}}
icon={<DoorExit size={14} />}
>
Sign out
</Menu.Item>
<Menu.Label>Settings</Menu.Label>
<Menu.Item icon={<Moon size={14} />}>
<ToggleThemeButton />
</Menu.Item>
</Menu.Dropdown>
2022-05-11 13:50:28 +02:00
</Menu>
);
};
export default ActionAvatar;