Skip to content

Commit 9c9e9c0

Browse files
committed
Improve groups table
1 parent 876a7c7 commit 9c9e9c0

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

site/src/components/UserAvatar/UserAvatar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface UserAvatarProps {
1010

1111
export const UserAvatar: FC<UserAvatarProps> = ({ username, className, avatarURL }) => {
1212
return (
13-
<Avatar className={className}>
13+
<Avatar className={className} title={username}>
1414
{avatarURL ? (
1515
<img alt={`${username}'s Avatar`} src={avatarURL} width="100%" />
1616
) : (

site/src/pages/GroupsPage/GroupsPage.tsx

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import AddCircleOutline from "@material-ui/icons/AddCircleOutline"
1111
import KeyboardArrowRight from "@material-ui/icons/KeyboardArrowRight"
1212
import AvatarGroup from "@material-ui/lab/AvatarGroup"
1313
import { useMachine } from "@xstate/react"
14+
import { AvatarData } from "components/AvatarData/AvatarData"
1415
import { ChooseOne, Cond } from "components/Conditionals/ChooseOne"
1516
import { EmptyState } from "components/EmptyState/EmptyState"
16-
import { TableCellLink } from "components/TableCellLink/TableCellLink"
1717
import { TableLoader } from "components/TableLoader/TableLoader"
1818
import { UserAvatar } from "components/UserAvatar/UserAvatar"
1919
import { useOrganizationId } from "hooks/useOrganizationId"
@@ -78,21 +78,30 @@ export const GroupsPage: React.FC = () => {
7878

7979
return (
8080
<TableRow
81-
key={group.id}
8281
hover
82+
key={group.id}
8383
data-testid={`group-${group.id}`}
8484
tabIndex={0}
85+
onClick={() => {
86+
navigate(groupPageLink)
87+
}}
8588
onKeyDown={(event) => {
8689
if (event.key === "Enter") {
8790
navigate(groupPageLink)
8891
}
8992
}}
9093
className={styles.clickableTableRow}
9194
>
92-
<TableCellLink to={groupPageLink}>{group.name}</TableCellLink>
95+
<TableCell>
96+
<AvatarData
97+
title={group.name}
98+
subtitle={`${group.members.length} members`}
99+
highlightTitle
100+
/>
101+
</TableCell>
93102

94103
<TableCell>
95-
{group.members.length === 0 && "No members"}
104+
{group.members.length === 0 && "-"}
96105
<AvatarGroup>
97106
{group.members.map((member) => (
98107
<UserAvatar
@@ -104,11 +113,11 @@ export const GroupsPage: React.FC = () => {
104113
</AvatarGroup>
105114
</TableCell>
106115

107-
<TableCellLink to={groupPageLink}>
116+
<TableCell>
108117
<div className={styles.arrowCell}>
109118
<KeyboardArrowRight className={styles.arrowRight} />
110119
</div>
111-
</TableCellLink>
120+
</TableCell>
112121
</TableRow>
113122
)
114123
})}
@@ -123,6 +132,8 @@ export const GroupsPage: React.FC = () => {
123132

124133
const useStyles = makeStyles((theme) => ({
125134
clickableTableRow: {
135+
cursor: "pointer",
136+
126137
"&:hover td": {
127138
backgroundColor: theme.palette.action.hover,
128139
},

0 commit comments

Comments
 (0)