Skip to content

Commit dc2fedd

Browse files
committed
wip: commit progress on groups tooltip
1 parent b9d2b72 commit dc2fedd

File tree

1 file changed

+47
-18
lines changed

1 file changed

+47
-18
lines changed

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

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ import TableCell from "@mui/material/TableCell";
88
import Button from "@mui/material/Button";
99
import List from "@mui/material/List";
1010
import ListItem from "@mui/material/ListItem";
11-
import ListItemText from "@mui/material/ListItemText";
12-
import ListItemAvatar from "@mui/material/ListItemAvatar";
1311
import Popover from "@mui/material/Popover";
12+
import { OverflowY } from "components/OverflowY/OverflowY";
1413

1514
type GroupsCellProps = {
1615
userGroups: readonly Group[] | undefined;
@@ -78,25 +77,55 @@ export function GroupsCell({ userGroups }: GroupsCellProps) {
7877
anchorOrigin={{ vertical: "bottom", horizontal: "left" }}
7978
transformOrigin={{ vertical: 16, horizontal: 0 }}
8079
>
81-
<List
82-
component="ul"
83-
css={{
84-
padding: theme.spacing(2),
80+
<OverflowY
81+
maxHeight={400}
82+
sx={{
83+
maxWidth: "360px",
84+
overflowX: "hidden",
8585
}}
8686
>
87-
{userGroups.map((group) => {
88-
const groupText = group.display_name || group.name;
89-
return (
90-
<ListItem key={group.id}>
91-
<ListItemAvatar>
92-
<Avatar src={group.avatar_url} alt={groupText} />
93-
</ListItemAvatar>
87+
<List
88+
component="ul"
89+
css={{
90+
display: "flex",
91+
flexFlow: "column nowrap",
92+
fontSize: theme.typography.body2.fontSize,
93+
padding: theme.spacing(2, 1),
94+
gap: theme.spacing(0),
95+
}}
96+
>
97+
{userGroups.map((group) => {
98+
const groupText = group.display_name || group.name;
99+
return (
100+
<ListItem
101+
key={group.id}
102+
css={{
103+
columnGap: theme.spacing(1.5),
104+
alignItems: "center",
105+
}}
106+
>
107+
<Avatar size="sm" src={group.avatar_url} alt={groupText}>
108+
{groupText}
109+
</Avatar>
94110

95-
<ListItemText>{groupText}</ListItemText>
96-
</ListItem>
97-
);
98-
})}
99-
</List>
111+
<p
112+
css={{
113+
height: "min-content",
114+
whiteSpace: "nowrap",
115+
textOverflow: "ellipsis",
116+
lineHeight: 0,
117+
margin: 0,
118+
}}
119+
>
120+
{/* {groupText} */}
121+
So this is some really, really long text, so uh Good
122+
luck making this look good
123+
</p>
124+
</ListItem>
125+
);
126+
})}
127+
</List>
128+
</OverflowY>
100129
</Popover>
101130
</>
102131
)}

0 commit comments

Comments
 (0)