|
1 | 1 | import { type FC } from "react";
|
2 |
| -import { Section } from "components/SettingsLayout/Section"; |
3 |
| -import { AccountForm } from "./AccountForm"; |
4 |
| -import { useAuth } from "components/AuthProvider/AuthProvider"; |
5 | 2 | import { useMe } from "hooks/useMe";
|
6 | 3 | import { usePermissions } from "hooks/usePermissions";
|
7 |
| -import { Stack } from "@mui/system"; |
8 | 4 | import { useQuery } from "react-query";
|
9 | 5 | import { groupsForUser } from "api/queries/groups";
|
10 | 6 | import { useOrganizationId } from "hooks";
|
11 | 7 | import { useTheme } from "@emotion/react";
|
12 | 8 |
|
| 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"; |
13 | 15 | import { Loader } from "components/Loader/Loader";
|
14 | 16 | import { AvatarCard } from "components/AvatarCard/AvatarCard";
|
15 | 17 |
|
@@ -56,20 +58,27 @@ export const AccountPage: FC = () => {
|
56 | 58 | }
|
57 | 59 | >
|
58 | 60 | {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}> |
64 | 68 | <AvatarCard
|
65 |
| - key={group.id} |
66 |
| - header={groupName} |
67 | 69 | 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 | + } |
69 | 78 | />
|
70 |
| - ); |
71 |
| - })} |
72 |
| - </> |
| 79 | + </Grid> |
| 80 | + ))} |
| 81 | + </Grid> |
73 | 82 | ) : (
|
74 | 83 | <Loader />
|
75 | 84 | )}
|
|
0 commit comments