Skip to content

Commit acf2500

Browse files
committed
finish AccountPage changes
1 parent 22e9573 commit acf2500

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

site/src/pages/UserSettingsPage/AccountPage/AccountPage.tsx

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import { type FC } from "react";
2-
import { Section } from "components/SettingsLayout/Section";
3-
import { AccountForm } from "./AccountForm";
4-
import { useAuth } from "components/AuthProvider/AuthProvider";
52
import { useMe } from "hooks/useMe";
63
import { usePermissions } from "hooks/usePermissions";
7-
import { Stack } from "@mui/system";
84
import { useQuery } from "react-query";
95
import { groupsForUser } from "api/queries/groups";
106
import { useOrganizationId } from "hooks";
117
import { useTheme } from "@emotion/react";
128

9+
import { Stack } from "@mui/system";
10+
import Grid from "@mui/material/Grid";
11+
12+
import { AccountForm } from "./AccountForm";
13+
import { useAuth } from "components/AuthProvider/AuthProvider";
14+
import { Section } from "components/SettingsLayout/Section";
1315
import { Loader } from "components/Loader/Loader";
1416
import { AvatarCard } from "components/AvatarCard/AvatarCard";
1517

@@ -56,20 +58,27 @@ export const AccountPage: FC = () => {
5658
}
5759
>
5860
{groupsQuery.isSuccess ? (
59-
<>
60-
{groupsQuery.data.map((group) => {
61-
const groupName = group.display_name || group.name;
62-
63-
return (
61+
<Grid
62+
container
63+
columns={{ xs: 1, sm: 1, md: 2 }}
64+
spacing={theme.spacing(3)}
65+
>
66+
{groupsQuery.data.map((group) => (
67+
<Grid item key={group.id} xs={1}>
6468
<AvatarCard
65-
key={group.id}
66-
header={groupName}
6769
imgUrl={group.avatar_url}
68-
altText={groupName}
70+
altText={group.display_name || group.name}
71+
header={group.display_name || group.name}
72+
subtitle={
73+
<>
74+
{group.members.length} member
75+
{group.members.length !== 1 && "s"}
76+
</>
77+
}
6978
/>
70-
);
71-
})}
72-
</>
79+
</Grid>
80+
))}
81+
</Grid>
7382
) : (
7483
<Loader />
7584
)}

0 commit comments

Comments
 (0)