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

49 lines
1.2 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";
2022-05-11 13:50:28 +02:00
import aw from "../../utils/appwrite.util";
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 () => {
await aw.account.deleteSession("current");
window.location.reload();
}}
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;