Skip to content

Commit 999fd7d

Browse files
committed
feat: complete loading of categories page
1 parent e313264 commit 999fd7d

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

src/app/[locale]/(main)/categories/loading.tsx

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,38 @@ import React from 'react';
44
const Loading = () => {
55
return (
66
<Stack direction="row" alignItems="flex-start">
7-
<Skeleton width={115} height="100%" />
8-
<Stack px={1.5} gap={1} flexWrap="wrap" direction="row" flexGrow={1}>
9-
{new Array(6).fill(1).map((item) => {
10-
return <Skeleton width="30%" height={100} />;
7+
<Stack overflow="auto">
8+
{new Array(4).fill(1).map((_item, index) => {
9+
return (
10+
<Skeleton
11+
key={index.toString()}
12+
variant="rectangular"
13+
width={115}
14+
height={65}
15+
sx={{
16+
borderRadius: 0,
17+
borderBottom: '1px solid ',
18+
borderColor: (theme) => theme.palette.divider,
19+
}}
20+
/>
21+
);
22+
})}
23+
</Stack>
24+
<Stack
25+
px={1.5}
26+
gap={1}
27+
flexWrap="wrap"
28+
justifyContent="center"
29+
direction="row"
30+
flexGrow={1}
31+
>
32+
{new Array(6).fill(1).map((_item, index) => {
33+
return (
34+
<Stack spacing={0.5} width="30%" key={index.toString()}>
35+
<Skeleton variant="rectangular" height={100} />
36+
<Skeleton variant="text" width="100%" />
37+
</Stack>
38+
);
1139
})}
1240
</Stack>
1341
</Stack>

src/app/[locale]/(main)/categories/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const page = () => {
2929
}
3030
}, [loading]);
3131

32-
if (!loading || !selected) {
32+
if (loading || !selected) {
3333
return <Loading />;
3434
}
3535

0 commit comments

Comments
 (0)