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