|
16 | 16 | import { type Interpolation, type Theme, useTheme } from "@emotion/react";
|
17 | 17 | import MUITooltip from "@mui/material/Tooltip";
|
18 | 18 | import type { LoginType, SlimRole } from "api/typesGenerated";
|
19 |
| -import { |
20 |
| - Popover, |
21 |
| - PopoverContent, |
22 |
| - PopoverTrigger, |
23 |
| -} from "components/deprecated/Popover/Popover"; |
24 | 19 | import { Pill } from "components/Pill/Pill";
|
25 | 20 | import { TableCell } from "components/Table/Table";
|
| 21 | +import { |
| 22 | + Tooltip, |
| 23 | + TooltipContent, |
| 24 | + TooltipProvider, |
| 25 | + TooltipTrigger, |
| 26 | +} from "components/Tooltip/Tooltip"; |
26 | 27 | import type { FC } from "react";
|
27 | 28 | import { EditRolesButton } from "./EditRolesButton";
|
28 | 29 |
|
@@ -109,51 +110,37 @@ const OverflowRolePill: FC<OverflowRolePillProps> = ({ roles }) => {
|
109 | 110 | const theme = useTheme();
|
110 | 111 |
|
111 | 112 | return (
|
112 |
| - <Popover mode="hover"> |
113 |
| - <PopoverTrigger> |
114 |
| - <Pill |
115 |
| - css={{ |
116 |
| - backgroundColor: theme.palette.background.paper, |
117 |
| - borderColor: theme.palette.divider, |
118 |
| - }} |
119 |
| - > |
120 |
| - +{roles.length} more |
121 |
| - </Pill> |
122 |
| - </PopoverTrigger> |
123 |
| - |
124 |
| - <PopoverContent |
125 |
| - disableRestoreFocus |
126 |
| - disableScrollLock |
127 |
| - css={{ |
128 |
| - ".MuiPaper-root": { |
129 |
| - display: "flex", |
130 |
| - flexFlow: "row wrap", |
131 |
| - columnGap: 8, |
132 |
| - rowGap: 12, |
133 |
| - padding: "12px 16px", |
134 |
| - alignContent: "space-around", |
135 |
| - minWidth: "auto", |
136 |
| - }, |
137 |
| - }} |
138 |
| - anchorOrigin={{ vertical: -4, horizontal: "center" }} |
139 |
| - transformOrigin={{ vertical: "bottom", horizontal: "center" }} |
140 |
| - > |
141 |
| - {roles.map((role) => ( |
| 113 | + <TooltipProvider> |
| 114 | + <Tooltip delayDuration={0}> |
| 115 | + <TooltipTrigger asChild> |
142 | 116 | <Pill
|
143 |
| - key={role.name} |
144 |
| - css={role.global ? styles.globalRoleBadge : styles.roleBadge} |
| 117 | + css={{ |
| 118 | + backgroundColor: theme.palette.background.paper, |
| 119 | + borderColor: theme.palette.divider, |
| 120 | + }} |
145 | 121 | >
|
146 |
| - {role.global ? ( |
147 |
| - <MUITooltip title="This user has this role for all organizations."> |
148 |
| - <span>{role.display_name || role.name}*</span> |
149 |
| - </MUITooltip> |
150 |
| - ) : ( |
151 |
| - role.display_name || role.name |
152 |
| - )} |
| 122 | + +{roles.length} more |
153 | 123 | </Pill>
|
154 |
| - ))} |
155 |
| - </PopoverContent> |
156 |
| - </Popover> |
| 124 | + </TooltipTrigger> |
| 125 | + |
| 126 | + <TooltipContent className="flex flex-row flex-wrap content-around gap-x-2 gap-y-3 px-4 py-3 border-surface-quaternary"> |
| 127 | + {roles.map((role) => ( |
| 128 | + <Pill |
| 129 | + key={role.name} |
| 130 | + css={role.global ? styles.globalRoleBadge : styles.roleBadge} |
| 131 | + > |
| 132 | + {role.global ? ( |
| 133 | + <MUITooltip title="This user has this role for all organizations."> |
| 134 | + <span>{role.display_name || role.name}*</span> |
| 135 | + </MUITooltip> |
| 136 | + ) : ( |
| 137 | + role.display_name || role.name |
| 138 | + )} |
| 139 | + </Pill> |
| 140 | + ))} |
| 141 | + </TooltipContent> |
| 142 | + </Tooltip> |
| 143 | + </TooltipProvider> |
157 | 144 | );
|
158 | 145 | };
|
159 | 146 |
|
|
0 commit comments