Skip to content

Commit 920cc2c

Browse files
Johan BookJohan Book
Johan Book
authored and
Johan Book
committed
feat(web-ui): improve skeleton for chat list page
1 parent 41ec4ab commit 920cc2c

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
import { ReactElement } from "react";
22

3-
import { List, ListItem, Skeleton } from "@mui/material";
3+
import {
4+
List,
5+
ListItem,
6+
ListItemAvatar,
7+
ListItemText,
8+
Skeleton,
9+
} from "@mui/material";
410

511
export function ChatListPageSkeleton(): ReactElement {
12+
const items = [140, 75, 180, 140, 80, 90, 130, 210, 70];
13+
614
return (
715
<List>
8-
<ListItem divider>
9-
<Skeleton height={50} width="100%" />
10-
</ListItem>
11-
12-
<ListItem divider>
13-
<Skeleton height={50} width="100%" />
14-
</ListItem>
16+
{items.map((item) => (
17+
<ListItem key={item} disablePadding>
18+
<ListItemAvatar>
19+
<Skeleton sx={{ height: 38, width: 38 }} variant="circular" />
20+
</ListItemAvatar>
1521

16-
<ListItem divider>
17-
<Skeleton height={50} width="100%" />
18-
</ListItem>
22+
<ListItemText
23+
primary={<Skeleton height={30} width={60} />}
24+
secondary={<Skeleton height={25} width={item} />}
25+
/>
26+
</ListItem>
27+
))}
1928
</List>
2029
);
2130
}

0 commit comments

Comments
 (0)