@@ -8,9 +8,9 @@ import Divider from "@mui/material/Divider";
8
8
import MenuItem from "@mui/material/MenuItem" ;
9
9
import type { SvgIconProps } from "@mui/material/SvgIcon" ;
10
10
import Tooltip from "@mui/material/Tooltip" ;
11
+ import { PopoverClose } from "@radix-ui/react-popover" ;
11
12
import type * as TypesGen from "api/typesGenerated" ;
12
13
import { CopyButton } from "components/CopyButton/CopyButton" ;
13
- import { usePopover } from "components/deprecated/Popover/Popover" ;
14
14
import { ExternalImage } from "components/ExternalImage/ExternalImage" ;
15
15
import { Stack } from "components/Stack/Stack" ;
16
16
import {
@@ -44,12 +44,6 @@ export const UserDropdownContent: FC<UserDropdownContentProps> = ({
44
44
supportLinks,
45
45
onSignOut,
46
46
} ) => {
47
- const popover = usePopover ( ) ;
48
-
49
- const onPopoverClose = ( ) => {
50
- popover . setOpen ( false ) ;
51
- } ;
52
-
53
47
const renderMenuIcon = ( icon : string ) : JSX . Element => {
54
48
switch ( icon ) {
55
49
case "bug" :
@@ -80,17 +74,21 @@ export const UserDropdownContent: FC<UserDropdownContentProps> = ({
80
74
< Divider css = { { marginBottom : 8 } } />
81
75
82
76
< Link to = "/install" css = { styles . link } >
83
- < MenuItem css = { styles . menuItem } onClick = { onPopoverClose } >
84
- < MonitorDownIcon css = { styles . menuItemIcon } />
85
- < span css = { styles . menuItemText } > Install CLI</ span >
86
- </ MenuItem >
77
+ < PopoverClose asChild >
78
+ < MenuItem css = { styles . menuItem } >
79
+ < MonitorDownIcon css = { styles . menuItemIcon } />
80
+ < span css = { styles . menuItemText } > Install CLI</ span >
81
+ </ MenuItem >
82
+ </ PopoverClose >
87
83
</ Link >
88
84
89
85
< Link to = "/settings/account" css = { styles . link } >
90
- < MenuItem css = { styles . menuItem } onClick = { onPopoverClose } >
91
- < CircleUserIcon css = { styles . menuItemIcon } />
92
- < span css = { styles . menuItemText } > { Language . accountLabel } </ span >
93
- </ MenuItem >
86
+ < PopoverClose asChild >
87
+ < MenuItem css = { styles . menuItem } >
88
+ < CircleUserIcon css = { styles . menuItemIcon } />
89
+ < span css = { styles . menuItemText } > { Language . accountLabel } </ span >
90
+ </ MenuItem >
91
+ </ PopoverClose >
94
92
</ Link >
95
93
96
94
< MenuItem css = { styles . menuItem } onClick = { onSignOut } >
@@ -109,10 +107,12 @@ export const UserDropdownContent: FC<UserDropdownContentProps> = ({
109
107
rel = "noreferrer"
110
108
css = { styles . link }
111
109
>
112
- < MenuItem css = { styles . menuItem } onClick = { onPopoverClose } >
113
- { renderMenuIcon ( link . icon ) }
114
- < span css = { styles . menuItemText } > { link . name } </ span >
115
- </ MenuItem >
110
+ < PopoverClose asChild >
111
+ < MenuItem css = { styles . menuItem } >
112
+ { renderMenuIcon ( link . icon ) }
113
+ < span css = { styles . menuItemText } > { link . name } </ span >
114
+ </ MenuItem >
115
+ </ PopoverClose >
116
116
</ a >
117
117
) ) }
118
118
</ >
0 commit comments