Update episode list in title Page #26

This commit is contained in:
prayag17 committed 2023-04-29 15:33:53 +05:30
1 parent 7df95a05ed
commit 5c41bfeca1
3 files changed
+43 -48

No files matched your search

+10 -2
View File
@@ -56,6 +56,7 @@ export const EpisodeCard = ({
parentId,
}) => {
const navigate = useNavigate();
const [imgLoaded, setImgLoaded] = useState(false);
const [isWatched, setIsWatched] = useState(watchedStatus);
const [isFavourite, setIsFavourite] = useState(favourite);
const handleMarkAsPlayOrUnMarkAsPlay = async () => {
@@ -130,10 +131,16 @@ export const EpisodeCard = ({
opacity: isWatched ? 1 : 0,
}}
/>
<Box className="card-media-image-container">
<Box
className="card-media-image-container"
sx={{
opacity: imgLoaded ? 1 : 0,
transition: "opacity 250ms",
}}
>
{imageTags && (
<CardMedia
component="div"
component="img"
image={
window.api.basePath +
"/Items/" +
@@ -148,6 +155,7 @@ export const EpisodeCard = ({
borderRadiusDefault,
overflow: "hidden",
}}
onLoad={() => setImgLoaded(true)}
className="card-image"
></CardMedia>
)}
+1 -1
View File
@@ -248,7 +248,7 @@ export const SideMenu = ({}) => {
"center",
}}
>
<MdiHomeVariantOutline></MdiHomeVariantOutline>
<MdiHomeVariantOutline />
</ListItemIcon>
</ListItemButton>
</ListItem>
+32 -45
View File
@@ -26,7 +26,7 @@ import MenuItem from "@mui/material/MenuItem";
import Link from "@mui/material/Link";
import { green, pink, yellow } from "@mui/material/colors";
import { AvatarImage } from "../../components/avatar/avatar";
import { AnimatePresence, motion } from "framer-motion";
import { Blurhash } from "react-blurhash";
import { useDispatch, useSelector } from "react-redux";
@@ -204,6 +204,8 @@ const ItemDetail = () => {
enabled: seasons.isSuccess,
networkMode: "always",
refetchOnWindowFocus: true,
keepPreviousData: false,
cacheTime: 0,
});
const personMovies = useQuery({
@@ -2187,41 +2189,40 @@ const ItemDetail = () => {
{seasons.isSuccess && (
<Box sx={{ mb: 2 }}>
<Tabs
variant="scrollable"
scrollButtons="auto"
<Stack
alignItems="center"
direction="row"
justifyContent="space-between"
mb={1}
>
<Typography variant="h5">
Episodes
</Typography>
<TextField
value={currentSeason}
select
onChange={(e, newVal) => {
setCurrentSeason(newVal);
setCurrentSeason(
e.target.value,
);
}}
sx={{
borderBottom: 1,
borderColor: "divider",
mb: 2,
}}
selectionFollowsFocus
size="small"
>
{seasons.data.Items.map(
(season, index) => {
return (
<Tab
label={season.Name}
{...a11yProps(
index,
)}
<MenuItem
key={index}
/>
value={index}
>
{season.Name}
</MenuItem>
);
},
)}
</Tabs>
{seasons.data.Items.map((season, index) => {
return (
<TabPanel
value={currentSeason}
index={index}
key={index}
>
</TextField>
</Stack>
<Grid2
container
columns={{
@@ -2234,24 +2235,13 @@ const ItemDetail = () => {
<EpisodeCardsSkeleton />
) : (
episodes.data.Items.map(
(
mitem,
mindex,
) => {
(mitem, mindex) => {
return (
<Grid2
key={
mindex
}
xs={
1
}
sm={
1
}
md={
1
}
key={mindex}
xs={1}
sm={1}
md={1}
>
<EpisodeCard
itemId={
@@ -2317,9 +2307,6 @@ const ItemDetail = () => {
)
)}
</Grid2>
</TabPanel>
);
})}
</Box>
)}
@@ -2333,7 +2320,7 @@ const ItemDetail = () => {
title="Cast"
disableDecoration
boxProps={{
mt: 5,
mt: 2,
}}
>
{item.data.People.map((person, index) => {