()
| 13 | import { ActionIcon, Avatar, Group, Menu, Text, useMantineTheme } from '@mantine/core'; |
| 14 | |
| 15 | export function UserMenu() { |
| 16 | const theme = useMantineTheme(); |
| 17 | return ( |
| 18 | <Group justify="center"> |
| 19 | <Menu |
| 20 | withArrow |
| 21 | width={300} |
| 22 | position="bottom" |
| 23 | transitionProps={{ transition: 'pop' }} |
| 24 | withinPortal |
| 25 | > |
| 26 | <Menu.Target> |
| 27 | <ActionIcon variant="default" aria-label="User settings"> |
| 28 | <IconDots size={16} stroke={1.5} /> |
| 29 | </ActionIcon> |
| 30 | </Menu.Target> |
| 31 | <Menu.Dropdown> |
| 32 | <Menu.Item rightSection={<IconChevronRight size={16} stroke={1.5} />}> |
| 33 | <Group> |
| 34 | <Avatar |
| 35 | radius="xl" |
| 36 | src="https://raw.githubusercontent.com/mantinedev/mantine/master/.demo/avatars/avatar-7.png" |
| 37 | alt="Nancy Eggshacker" |
| 38 | /> |
| 39 | |
| 40 | <div> |
| 41 | <Text fw={500}>Nancy Eggshacker</Text> |
| 42 | <Text size="xs" c="dimmed"> |
| 43 | neggshaker@mantine.dev |
| 44 | </Text> |
| 45 | </div> |
| 46 | </Group> |
| 47 | </Menu.Item> |
| 48 | |
| 49 | <Menu.Divider /> |
| 50 | |
| 51 | <Menu.Item leftSection={<IconHeart size={16} stroke={1.5} color={theme.colors.red[6]} />}> |
| 52 | Liked posts |
| 53 | </Menu.Item> |
| 54 | <Menu.Item |
| 55 | leftSection={<IconStar size={16} stroke={1.5} color={theme.colors.yellow[6]} />} |
| 56 | > |
| 57 | Saved posts |
| 58 | </Menu.Item> |
| 59 | <Menu.Item |
| 60 | leftSection={<IconMessage size={16} stroke={1.5} color={theme.colors.blue[6]} />} |
| 61 | > |
| 62 | Your comments |
| 63 | </Menu.Item> |
| 64 | |
| 65 | <Menu.Label>Settings</Menu.Label> |
| 66 | <Menu.Item leftSection={<IconSettings size={16} stroke={1.5} />}> |
| 67 | Account settings |
| 68 | </Menu.Item> |
| 69 | <Menu.Item leftSection={<IconSwitchHorizontal size={16} stroke={1.5} />}> |
| 70 | Change account |
| 71 | </Menu.Item> |
| 72 | <Menu.Item leftSection={<IconLogout size={16} stroke={1.5} />}>Logout</Menu.Item> |
nothing calls this directly
no outgoing calls
no test coverage detected