@@ -10,7 +10,17 @@ import {
10
10
Image ,
11
11
Spacer ,
12
12
Avatar ,
13
+ Button ,
13
14
Icon ,
15
+ Popover ,
16
+ PopoverTrigger ,
17
+ PopoverContent ,
18
+ PopoverHeader ,
19
+ PopoverBody ,
20
+ PopoverFooter ,
21
+ PopoverArrow ,
22
+ PopoverCloseButton ,
23
+ PopoverAnchor
14
24
} from '@chakra-ui/react' ;
15
25
import { Link as ReactRouterLink , useLocation } from 'react-router-dom' ;
16
26
import { BsPerson } from 'react-icons/bs' ;
@@ -19,7 +29,13 @@ import { PiBell } from "react-icons/pi";
19
29
import { GoHome } from "react-icons/go" ;
20
30
import abtc_logo from '../../images/abtc_logo.png' ;
21
31
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} ) => {
23
39
const location = useLocation ( ) ;
24
40
25
41
return (
@@ -96,50 +112,21 @@ const NavBarAdmin: React.FC = () => {
96
112
color = "#444750"
97
113
fontWeight = "500"
98
114
_hover = { { color : "black" , textDecoration : "none" } }
115
+ paddingRight = { 4 }
99
116
>
100
117
< Icon as = { PiBell } boxSize = { 6 } />
101
118
</ 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
+
107
120
< 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 >
143
130
</ Box >
144
131
</ Flex >
145
132
) ;
0 commit comments