1
1
import Badge from "@mui/material/Badge" ;
2
2
import MenuItem from "@mui/material/MenuItem" ;
3
- import { makeStyles } from "@mui/styles" ;
4
3
import { useState , FC , PropsWithChildren , MouseEvent } from "react" ;
5
4
import { colors } from "theme/colors" ;
6
5
import * as TypesGen from "api/typesGenerated" ;
@@ -13,6 +12,7 @@ import {
13
12
import { UserAvatar } from "components/UserAvatar/UserAvatar" ;
14
13
import { UserDropdownContent } from "./UserDropdownContent" ;
15
14
import { BUTTON_SM_HEIGHT } from "theme/theme" ;
15
+ import { css } from "@emotion/react" ;
16
16
17
17
export interface UserDropdownProps {
18
18
user : TypesGen . User ;
@@ -27,7 +27,6 @@ export const UserDropdown: FC<PropsWithChildren<UserDropdownProps>> = ({
27
27
supportLinks,
28
28
onSignOut,
29
29
} : UserDropdownProps ) => {
30
- const styles = useStyles ( ) ;
31
30
const [ anchorEl , setAnchorEl ] = useState < HTMLElement | undefined > ( ) ;
32
31
33
32
const handleDropdownClick = ( ev : MouseEvent < HTMLLIElement > ) : void => {
@@ -40,11 +39,25 @@ export const UserDropdown: FC<PropsWithChildren<UserDropdownProps>> = ({
40
39
return (
41
40
< >
42
41
< MenuItem
43
- className = { styles . menuItem }
42
+ css = { ( theme ) => css `
43
+ height : ${ navHeight } ;
44
+ padding : ${ theme . spacing ( 1.5 , 0 ) } ;
45
+
46
+ & : hover {
47
+ background-color : transparent;
48
+ }
49
+ ` }
44
50
onClick = { handleDropdownClick }
45
51
data-testid = "user-dropdown-trigger"
46
52
>
47
- < div className = { styles . inner } >
53
+ < div
54
+ css = { {
55
+ display : "flex" ,
56
+ alignItems : "center" ,
57
+ minWidth : 0 ,
58
+ maxWidth : 300 ,
59
+ } }
60
+ >
48
61
< Badge overlap = "circular" >
49
62
< UserAvatar
50
63
sx = { {
@@ -90,24 +103,3 @@ export const UserDropdown: FC<PropsWithChildren<UserDropdownProps>> = ({
90
103
</ >
91
104
) ;
92
105
} ;
93
-
94
- export const useStyles = makeStyles ( ( theme ) => ( {
95
- divider : {
96
- marginTop : theme . spacing ( 1 ) ,
97
- marginBottom : theme . spacing ( 1 ) ,
98
- } ,
99
- inner : {
100
- display : "flex" ,
101
- alignItems : "center" ,
102
- minWidth : 0 ,
103
- maxWidth : 300 ,
104
- } ,
105
- menuItem : {
106
- height : navHeight ,
107
- padding : theme . spacing ( 1.5 , 0 ) ,
108
-
109
- "&:hover" : {
110
- backgroundColor : "transparent" ,
111
- } ,
112
- } ,
113
- } ) ) ;
0 commit comments