Skip to content

Commit e756a95

Browse files
refactor(site): minor improvements on users page popovers (#10492)
1 parent b8449d5 commit e756a95

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

site/src/pages/UsersPage/UsersTable/UserGroupsCell.tsx

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import { useTheme } from "@emotion/react";
22
import { type Group } from "api/typesGenerated";
3-
43
import { Stack } from "components/Stack/Stack";
54
import { Avatar } from "components/Avatar/Avatar";
65
import { OverflowY } from "components/OverflowY/OverflowY";
7-
86
import TableCell from "@mui/material/TableCell";
97
import Button from "@mui/material/Button";
108
import List from "@mui/material/List";
119
import ListItem from "@mui/material/ListItem";
1210
import GroupIcon from "@mui/icons-material/Group";
13-
1411
import {
1512
Popover,
1613
PopoverTrigger,
@@ -68,7 +65,23 @@ export function UserGroupsCell({ userGroups }: GroupsCellProps) {
6865
</Button>
6966
</PopoverTrigger>
7067

71-
<PopoverContent disableScrollLock disableRestoreFocus>
68+
<PopoverContent
69+
disableScrollLock
70+
disableRestoreFocus
71+
css={{
72+
".MuiPaper-root": {
73+
minWidth: "auto",
74+
},
75+
}}
76+
anchorOrigin={{
77+
vertical: "top",
78+
horizontal: "center",
79+
}}
80+
transformOrigin={{
81+
vertical: "bottom",
82+
horizontal: "center",
83+
}}
84+
>
7285
<OverflowY maxHeight={400}>
7386
<List
7487
component="ul"

site/src/pages/UsersPage/UsersTable/UserRoleCell.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,17 @@ function OverflowRolePill({ roles }: OverflowRolePillProps) {
119119
rowGap: theme.spacing(1.5),
120120
padding: theme.spacing(1.5, 2),
121121
alignContent: "space-around",
122+
minWidth: "auto",
122123
},
123124
}}
125+
anchorOrigin={{
126+
vertical: -4,
127+
horizontal: "center",
128+
}}
129+
transformOrigin={{
130+
vertical: "bottom",
131+
horizontal: "center",
132+
}}
124133
>
125134
{roles.map((role) => (
126135
<Pill

0 commit comments

Comments
 (0)