Add UpNext Section and Skeleton for card sections
This commit is contained in:
2 files changed
+51
-4
No files matched your search
@@ -0,0 +1,22 @@
|
||||
/** @format */
|
||||
|
||||
import Skeleton from "@mui/material/Skeleton";
|
||||
import Card from "@mui/material/Card";
|
||||
import CardContent from "@mui/material/CardContent";
|
||||
import CardMedia from "@mui/material/CardMedia";
|
||||
import CardActionArea from "@mui/material/CardActionArea";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Box from "@mui/material/Box";
|
||||
|
||||
export const CardsSkeleton = () => {
|
||||
return (
|
||||
<Box sx={{ display: "flex", flexFlow: "column", mb: 4 }}>
|
||||
<Typography variant="h4" sx={{ mb: "0.15em" }}>
|
||||
<Skeleton width="35%" animation="wave" />
|
||||
</Typography>
|
||||
<Skeleton width="100%" variant="rounded" animation="wave">
|
||||
<div style={{ paddingTop: "20%" }}></div>
|
||||
</Skeleton>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
@@ -48,6 +48,7 @@ import { useNavigate } from "react-router-dom";
|
||||
import { formateDate } from "../../utils/date/formateDate";
|
||||
import { getRuntime } from "../../utils/date/time";
|
||||
import { CarouselSkeleton } from "../../components/skeleton/carousel";
|
||||
import { CardsSkeleton } from "../../components/skeleton/cards";
|
||||
|
||||
const Home = () => {
|
||||
const queryClient = useQueryClient();
|
||||
@@ -513,9 +514,9 @@ const Home = () => {
|
||||
})
|
||||
)}
|
||||
</Carousel>
|
||||
<CardScroller displayCards={4} title={"Libraries"}>
|
||||
<CardScroller displayCards={4} title="Libraries">
|
||||
{libraries.isLoading ? (
|
||||
<>"loading...</>
|
||||
<CardsSkeleton />
|
||||
) : (
|
||||
libraries.data.Items.map((item, index) => {
|
||||
return (
|
||||
@@ -533,9 +534,33 @@ const Home = () => {
|
||||
})
|
||||
)}
|
||||
</CardScroller>
|
||||
|
||||
{upNextItems.isLoading ? (
|
||||
<CardsSkeleton />
|
||||
) : upNextItems.data.Items.length == 0 ? (
|
||||
<></>
|
||||
) : (
|
||||
<CardScroller displayCards={4} title="Up Next">
|
||||
{upNextItems.data.Items.map(
|
||||
(item, index) => {
|
||||
return (
|
||||
<CardLandscape
|
||||
key={index}
|
||||
itemName={item.Name}
|
||||
itemId={item.Id}
|
||||
// imageTags={false}
|
||||
imageTags={
|
||||
!!item.ImageTags
|
||||
.Primary
|
||||
}
|
||||
iconType={item.Type}
|
||||
></CardLandscape>
|
||||
);
|
||||
},
|
||||
)}
|
||||
</CardScroller>
|
||||
)}
|
||||
{/* <Box className="home-section">
|
||||
<Typography
|
||||
<Typography
|
||||
variant="h4"
|
||||
color="textPrimary"
|
||||
className="home-section-heading"
|
||||
|
||||
Reference in new issue
Block a user