File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed
frontend/src/components/NavBar Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -13,26 +13,17 @@ const ToggleButton = styled(Popover.Button, {
1313const ItemButton = tw . button `flex items-center justify-end gap-1 rounded-md px-2 py-1 focus-within:outline-none focus-within:ring focus-within:ring-indigo-600/50 hover:bg-gray-50 hover:text-indigo-700` ;
1414
1515const AvatarButton = ( ) => {
16- const name = localStorage . getItem ( "name" ) ?? "" ;
17- const initials = name
18- . split ( " " )
19- // this non-exhaustively matches other latin alphabets, not just enligh
20- // https://stackoverflow.com/a/32567789
21- . map ( ( n ) => [ ...n ] . find ( ( c ) => c . toLowerCase ( ) !== c . toUpperCase ( ) ) ?? n [ 0 ] )
22- . join ( "" ) ;
23-
16+ const name = "user"
2417 const navigate = useNavigate ( ) ;
2518 const logout = ( ) => {
26- [ "name" , "signup_token" , "AUTH_TOKEN" ] . forEach ( ( key ) => {
27- localStorage . removeItem ( key ) ;
28- navigate ( "/" ) ;
29- } ) ;
30- } ;
19+ navigate ( "/" ) ;
20+ }
21+
3122
3223 return (
3324 < Popover tw = "relative" >
3425 < >
35- < ToggleButton > { initials } </ ToggleButton >
26+ < ToggleButton > { < svg xmlns = "http://www.w3.org/2000/svg" width = "24" height = "24" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke-width = "2" stroke-linecap = "round" stroke-linejoin = "round" class = "lucide lucide-user-icon lucide-user" > < path d = "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> < circle cx = "12" cy = "7" r = "4" /> </ svg > } </ ToggleButton >
3627 < Transition
3728 as = { Fragment }
3829 enter = { tw `transition duration-200 ease-out` }
You can’t perform that action at this time.
0 commit comments