@@ -10,7 +10,17 @@ import {
1010 Image ,
1111 Spacer ,
1212 Avatar ,
13+ Button ,
1314 Icon ,
15+ Popover ,
16+ PopoverTrigger ,
17+ PopoverContent ,
18+ PopoverHeader ,
19+ PopoverBody ,
20+ PopoverFooter ,
21+ PopoverArrow ,
22+ PopoverCloseButton ,
23+ PopoverAnchor
1424} from '@chakra-ui/react' ;
1525import { Link as ReactRouterLink , useLocation } from 'react-router-dom' ;
1626import { BsPerson } from 'react-icons/bs' ;
@@ -19,7 +29,13 @@ import { PiBell } from "react-icons/pi";
1929import { GoHome } from "react-icons/go" ;
2030import abtc_logo from '../../images/abtc_logo.png' ;
2131
22- const NavBarAdmin : React . FC = ( ) => {
32+ interface NavBarAdminProps {
33+ firstName : string ;
34+ lastName : string ;
35+ role : string ;
36+ }
37+
38+ const NavBarAdmin : React . FC < NavBarAdminProps > = ( { firstName, lastName, role} ) => {
2339 const location = useLocation ( ) ;
2440
2541 return (
@@ -96,50 +112,21 @@ const NavBarAdmin: React.FC = () => {
96112 color = "#444750"
97113 fontWeight = "500"
98114 _hover = { { color : "black" , textDecoration : "none" } }
115+ paddingRight = { 4 }
99116 >
100117 < Icon as = { PiBell } boxSize = { 6 } />
101118 </ ChakraLink >
102- < Box ml = { 6 } mr = { 2 } >
103- < ChakraLink as = { ReactRouterLink } to = "/user-profile" fontWeight = "bold" lineHeight = "1.5" >
104- < Avatar size = "md" name = "User" src = "https://placehold.co/25x25" />
105- </ ChakraLink >
106- </ Box >
119+
107120 < Box >
108- < Menu >
109- < MenuButton
110- as = { Box }
111- color = "#444750"
112- fontWeight = "500"
113- _hover = { { color : "black" , textDecoration : "none" } }
114- >
115- < Flex align = "center" >
116- < Box ml = { 2 } >
117- Name-First-Last
118- </ Box >
119- < Icon as = { RxChevronDown } boxSize = { 6 } ml = { 2 } mr = { 2 } />
120- </ Flex >
121- </ MenuButton >
122- < MenuList bg = "white" border = "none" minW = "auto" w = "auto" >
123- < MenuItem
124- as = { ReactRouterLink }
125- to = "/profile/placeholder"
126- color = "#444750"
127- fontWeight = "500"
128- _hover = { { color : "black" , textDecoration : "none" } }
129- >
130- Placeholder
131- </ MenuItem >
132- < MenuItem
133- as = { ReactRouterLink }
134- to = "/profile/placeholder1"
135- color = "#444750"
136- fontWeight = "500"
137- _hover = { { color : "black" , textDecoration : "none" } }
138- >
139- Placeholder 2
140- </ MenuItem >
141- </ MenuList >
142- </ Menu >
121+ < Popover trigger = "hover" placement = "bottom-end" >
122+ < PopoverTrigger >
123+ < Avatar size = "md" name = "User" src = "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSNfBG0r9nBON7QsYexKnLDtTnn4bjfuWZyDndX4OuZPwJTtPUA" />
124+ </ PopoverTrigger >
125+ < PopoverContent maxW = "200px" >
126+ < PopoverHeader > { firstName } { lastName } </ PopoverHeader >
127+ < PopoverBody > Role: { role } </ PopoverBody >
128+ </ PopoverContent >
129+ </ Popover >
143130 </ Box >
144131 </ Flex >
145132 ) ;
0 commit comments