Improve Person page #243

This commit is contained in:
Prayag Prajapati committed 2024-01-16 11:50:09 +05:30
1 parent dbb6e272b1
commit 3987ffd4da
3 files changed
+100 -11

No files matched your search

+37 -6
View File
@@ -53,13 +53,16 @@ export const SeasonSelectorSkeleton = () => {
<Card sx={{ background: "transparent" }} elevation={0}> <Card sx={{ background: "transparent" }} elevation={0}>
<CardMedia> <CardMedia>
<Skeleton <Skeleton
animation="wave" // animation="wave"
variant="rectangular" variant="rectangular"
sx={{ sx={{
aspectRatio: "1.777", aspectRatio: "1.777",
height: "auto", height: "auto",
m: 1, m: 1,
borderRadius: borderRadiusDefault, borderRadius: "10px",
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
}} }}
/> />
</CardMedia> </CardMedia>
@@ -71,14 +74,42 @@ export const SeasonSelectorSkeleton = () => {
}} }}
> >
<Typography variant="h6"> <Typography variant="h6">
<Skeleton variant="text" animation="wave" /> <Skeleton
variant="text"
sx={{
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
}}
/>
</Typography> </Typography>
<Typography variant="body2"> <Typography variant="body2">
<Skeleton variant="text" animation="wave" /> <Skeleton
<Skeleton variant="text" animation="wave" /> variant="text"
sx={{
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
}}
/>
<Skeleton
variant="text"
sx={{
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
}}
/>
<Skeleton variant="text" animation="wave" /> <Skeleton
variant="text"
sx={{
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
}}
/>
</Typography> </Typography>
</CardContent> </CardContent>
</Card> </Card>
+59 -5
View File
@@ -10,7 +10,7 @@ import Typography from "@mui/material/Typography";
import { AnimatePresence, motion } from "framer-motion"; import { AnimatePresence, motion } from "framer-motion";
import { useParams } from "react-router-dom"; import { Link, useParams } from "react-router-dom";
import { import {
BaseItemKind, BaseItemKind,
@@ -232,7 +232,13 @@ const PersonTitlePage = () => {
} }
} }
setBackdrop("", ""); setBackdrop("", "");
}, []); }, [
personMovies.isSuccess,
personShows.isSuccess,
personBooks.isSuccess,
personPhotos.isSuccess,
personEpisodes.isSuccess,
]);
const [animationDirection, setAnimationDirection] = useState("forward"); const [animationDirection, setAnimationDirection] = useState("forward");
@@ -338,9 +344,57 @@ const PersonTitlePage = () => {
/> />
</div> </div>
</div> </div>
<Typography variant="subtitle1" mx={1}> <div className="item-detail">
{item.data.Overview ?? ""} <div style={{ width: "100%" }}>
</Typography> <Typography variant="subtitle1">
{item.data.Overview ?? ""}
</Typography>
<div
style={{
display: "flex",
gap: "0.6em",
alignSelf: "end",
marginTop: "1em",
}}
>
{item.data.ExternalUrls.map((url) => (
<Link
key={url.Url}
target="_blank"
to={url.Url}
className="item-detail-link"
>
<Typography>{url.Name}</Typography>
</Link>
))}
</div>
</div>
<Divider flexItem orientation="vertical" />
<div
style={{
width: "100%",
}}
>
{item.data.PremiereDate && (
<>
<Typography variant="h5">Born</Typography>
<Typography sx={{ opacity: 0.8 }}>
{new Date(item.data.PremiereDate).toDateString()}
</Typography>
</>
)}
{item.data.EndDate && (
<>
<Typography variant="h5" mt={2}>
Death
</Typography>
<Typography sx={{ opacity: 0.8 }}>
{new Date(item.data.EndDate).toDateString()}
</Typography>
</>
)}
</div>
</div>
<div className="item-detail-person-container"> <div className="item-detail-person-container">
<div className="item-detail-person-header"> <div className="item-detail-person-header">
+4
View File
@@ -345,6 +345,10 @@ const SeriesTitlePage = () => {
> >
<Typography style={{ opacity: "0.8" }} variant="subtitle1"> <Typography style={{ opacity: "0.8" }} variant="subtitle1">
{item.data.ProductionYear ?? ""} {item.data.ProductionYear ?? ""}
{item.data.Status === "Continuing"
? " - Present"
: item.data.EndDate &&
` - ${new Date(item.data.EndDate).getFullYear()}`}
</Typography> </Typography>
{item.data.OfficialRating && ( {item.data.OfficialRating && (
<Chip variant="filled" label={item.data.OfficialRating} /> <Chip variant="filled" label={item.data.OfficialRating} />