Skip to content

Commit 75bb304

Browse files
committed
Refactor UserDetail use flex gap instead of margin bottom
1 parent 329b83b commit 75bb304

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/scenes/Users/Detail/UserDetail.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useQuery } from '@apollo/client';
22
import { Edit } from '@mui/icons-material';
3-
import { Box, Skeleton, Tooltip, Typography } from '@mui/material';
3+
import { Box, Skeleton, Stack, Tooltip, Typography } from '@mui/material';
44
import { useInterval } from 'ahooks';
55
import { DateTime } from 'luxon';
66
import { useState } from 'react';
@@ -39,14 +39,12 @@ export const UserDetail = () => {
3939
const canEditAnyFields = canEditAny(user);
4040

4141
return (
42-
<Box
42+
<Stack
4343
component="main"
4444
sx={{
4545
overflowY: 'auto',
4646
p: 4,
47-
'& > *:not(:last-child)': {
48-
mb: 3,
49-
},
47+
gap: 3,
5048
maxWidth: (theme) => theme.breakpoints.values.md,
5149
}}
5250
>
@@ -137,18 +135,16 @@ export const UserDetail = () => {
137135
{!!user?.partners.items.length && (
138136
<>
139137
<Typography variant="h3">Partners</Typography>
140-
<Box sx={{ mt: 1 }}>
138+
<Stack sx={{ mt: 1, gap: 2 }}>
141139
{user.partners.items.map((item) => (
142-
<Box key={item.id} sx={{ mb: 2 }}>
143-
<PartnerListItemCard partner={item} />
144-
</Box>
140+
<PartnerListItemCard key={item.id} partner={item} />
145141
))}
146-
</Box>
142+
</Stack>
147143
</>
148144
)}
149145
</>
150146
)}
151-
</Box>
147+
</Stack>
152148
);
153149
};
154150

0 commit comments

Comments
 (0)