From 2a0dd3952feba664eca04a415c87a849aaccd34d Mon Sep 17 00:00:00 2001 From: Elvin Cheng Date: Wed, 6 Dec 2023 18:03:59 -0500 Subject: [PATCH] user menu --- apps/web/src/components/TopBar.tsx | 84 ++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 23 deletions(-) diff --git a/apps/web/src/components/TopBar.tsx b/apps/web/src/components/TopBar.tsx index e92c3ed1..35b2e7c3 100644 --- a/apps/web/src/components/TopBar.tsx +++ b/apps/web/src/components/TopBar.tsx @@ -1,9 +1,21 @@ import { MFALogoIcon, UserProfileAvatar } from 'apps/web/src/static/icons'; -import { Box, Hide, IconButton, Text, Flex, Spacer } from '@chakra-ui/react'; +import { + Box, + Hide, + IconButton, + Text, + Flex, + Spacer, + Button, + Popover, + PopoverBody, + PopoverContent, + PopoverTrigger, +} from '@chakra-ui/react'; import { useAuth } from '@web/hooks/useAuth'; export const TopBar: React.FC = () => { - const { user } = useAuth(); + const { user, logout } = useAuth(); return ( { Welcome back, {user?.firstName}! - - ) : ( - - ) - } - colorScheme="none" - /> + + + + + ) : ( + + ) + } + colorScheme="none" + /> + + + + + + {user?.firstName + ' ' + user?.lastName} + + + + + + + );