refactor(site): minor improvements on users page popovers (#10492)

This commit is contained in:
Bruno Quaresma
2023-11-02 13:39:52 +00:00
committed by GitHub
parent b8449d5894
commit e756a95759
2 changed files with 26 additions and 4 deletions
@@ -1,16 +1,13 @@
import { useTheme } from "@emotion/react";
import { type Group } from "api/typesGenerated";
import { Stack } from "components/Stack/Stack";
import { Avatar } from "components/Avatar/Avatar";
import { OverflowY } from "components/OverflowY/OverflowY";
import TableCell from "@mui/material/TableCell";
import Button from "@mui/material/Button";
import List from "@mui/material/List";
import ListItem from "@mui/material/ListItem";
import GroupIcon from "@mui/icons-material/Group";
import {
Popover,
PopoverTrigger,
@@ -68,7 +65,23 @@ export function UserGroupsCell({ userGroups }: GroupsCellProps) {
</Button>
</PopoverTrigger>
<PopoverContent disableScrollLock disableRestoreFocus>
<PopoverContent
disableScrollLock
disableRestoreFocus
css={{
".MuiPaper-root": {
minWidth: "auto",
},
}}
anchorOrigin={{
vertical: "top",
horizontal: "center",
}}
transformOrigin={{
vertical: "bottom",
horizontal: "center",
}}
>
<OverflowY maxHeight={400}>
<List
component="ul"
@@ -119,8 +119,17 @@ function OverflowRolePill({ roles }: OverflowRolePillProps) {
rowGap: theme.spacing(1.5),
padding: theme.spacing(1.5, 2),
alignContent: "space-around",
minWidth: "auto",
},
}}
anchorOrigin={{
vertical: -4,
horizontal: "center",
}}
transformOrigin={{
vertical: "bottom",
horizontal: "center",
}}
>
{roles.map((role) => (
<Pill