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";
|
2022-10-09 22:30:32 +02:00
|
|
|
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 (
|
|
|
|
|
<Menu
|
|
|
|
|
control={
|
|
|
|
|
<ActionIcon>
|
|
|
|
|
<Avatar size={28} radius="xl" />
|
|
|
|
|
</ActionIcon>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<Menu.Label>My account</Menu.Label>
|
|
|
|
|
<Menu.Item
|
|
|
|
|
component={NextLink}
|
|
|
|
|
href="/account/shares"
|
|
|
|
|
icon={<Link size={14} />}
|
|
|
|
|
>
|
|
|
|
|
Shares
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
{/* <Menu.Item
|
|
|
|
|
component={NextLink}
|
|
|
|
|
href="/account/shares"
|
|
|
|
|
icon={<Settings size={14} />}
|
|
|
|
|
>
|
|
|
|
|
Settings
|
|
|
|
|
</Menu.Item> */}
|
|
|
|
|
<Menu.Item
|
|
|
|
|
onClick={async () => {
|
2022-10-09 22:30:32 +02:00
|
|
|
await authService.signOut();
|
2022-05-11 13:50:28 +02:00
|
|
|
}}
|
|
|
|
|
icon={<DoorExit size={14} />}
|
|
|
|
|
>
|
|
|
|
|
Sign out
|
|
|
|
|
</Menu.Item>
|
2022-05-11 15:32:28 +02:00
|
|
|
<Menu.Label>Settings</Menu.Label>
|
|
|
|
|
<Menu.Item icon={<Moon size={14} />}>
|
|
|
|
|
<ToggleThemeButton />
|
|
|
|
|
</Menu.Item>
|
2022-05-11 13:50:28 +02:00
|
|
|
</Menu>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default ActionAvatar;
|