Start working on new titlePage #160
This commit is contained in:
16 files changed
+143
-2831
No files matched your search
@@ -84,12 +84,13 @@ const LikeButton = ({ itemId, isFavorite, queryKey, userId, itemName }) => {
|
||||
queryClient.setQueryData(queryKey, context.previousData);
|
||||
console.error(error);
|
||||
setIsError(true);
|
||||
setIsLoading(false);
|
||||
},
|
||||
onSuccess: () => {
|
||||
console.log("Successfully updated", itemId);
|
||||
queryClient.invalidateQueries(queryKey);
|
||||
setIsSuccess(true);
|
||||
},
|
||||
onSettled: () => {
|
||||
setIsLoading(false);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -82,12 +82,13 @@ const MarkPlayedButton = ({ itemId, isPlayed, queryKey, userId, itemName }) => {
|
||||
queryClient.setQueryData(queryKey, context.previousData);
|
||||
console.error(error);
|
||||
setIsError(true);
|
||||
setIsLoading(false);
|
||||
},
|
||||
onSuccess: () => {
|
||||
console.log("Successfully updated", itemId);
|
||||
queryClient.invalidateQueries(queryKey);
|
||||
setIsSuccess(true);
|
||||
},
|
||||
onSettled: () => {
|
||||
setIsLoading(false);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import Button from "@mui/material/Button";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Fab from "@mui/material/Fab";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import { MdiPlayOutline } from "../icons/mdiPlayOutline";
|
||||
import {
|
||||
@@ -115,14 +115,16 @@ const PlayButton = ({
|
||||
};
|
||||
if (iconOnly) {
|
||||
return (
|
||||
<IconButton
|
||||
<Fab
|
||||
color="primary"
|
||||
aria-label="Play"
|
||||
className={className}
|
||||
onClick={handleClick}
|
||||
sx={sx}
|
||||
{...buttonProps}
|
||||
>
|
||||
<MdiPlayOutline {...iconProps} />
|
||||
</IconButton>
|
||||
</Fab>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
|
||||
@@ -51,11 +51,11 @@ export const Card = ({
|
||||
cardType,
|
||||
queryKey,
|
||||
userId,
|
||||
availableImagesTypes,
|
||||
seriesId,
|
||||
|
||||
hideText,
|
||||
onClick,
|
||||
disableOverlay = false,
|
||||
disablePadding,
|
||||
}) => {
|
||||
const ref = useRef();
|
||||
const isVisible = useIntersecting(ref);
|
||||
@@ -63,7 +63,7 @@ export const Card = ({
|
||||
const defaultOnClick = () => navigate(`/item/${item.Id}`);
|
||||
return (
|
||||
<CardActionArea
|
||||
sx={{ padding: 1, borderRadius: "10px" }}
|
||||
sx={{ padding: disablePadding ? 0 : 1, borderRadius: "10px" }}
|
||||
className="card-container"
|
||||
onClick={!!onClick ? onClick : defaultOnClick}
|
||||
>
|
||||
@@ -204,7 +204,7 @@ export const Card = ({
|
||||
currentVideoTrack={0}
|
||||
className="card-play-button"
|
||||
iconProps={{
|
||||
sx: { fontSize: "1.5em" },
|
||||
sx: { fontSize: "2.5em" },
|
||||
}}
|
||||
iconOnly
|
||||
/>
|
||||
@@ -245,7 +245,11 @@ export const Card = ({
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
<Box className="card-text-container" height="15%">
|
||||
<Box
|
||||
className="card-text-container"
|
||||
height="15%"
|
||||
style={{ display: hideText ? "none" : "block" }}
|
||||
>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
fontWeight={500}
|
||||
@@ -271,4 +275,18 @@ export const Card = ({
|
||||
);
|
||||
};
|
||||
|
||||
Card.propTypes = {};
|
||||
Card.propTypes = {
|
||||
item: PropTypes.any.isRequired,
|
||||
cardTitle: PropTypes.string,
|
||||
cardCaption: PropTypes.string,
|
||||
imageType: PropTypes.string,
|
||||
imageBlurhash: PropTypes.string,
|
||||
cardType: PropTypes.string,
|
||||
queryKey: PropTypes.any,
|
||||
userId: PropTypes.string.isRequired,
|
||||
seriesId: PropTypes.string,
|
||||
hideText: PropTypes.bool,
|
||||
onClick: PropTypes.func,
|
||||
disableOverlay: PropTypes.bool,
|
||||
disablePadding: PropTypes.bool,
|
||||
};
|
||||
@@ -27,8 +27,10 @@
|
||||
background: $clr-gradient-dark;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
&-blurhash {
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
/** @format */
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { CardScroller } from "../../components/cardScroller/cardScroller";
|
||||
import { Card } from "../../components/card/card";
|
||||
import { CardsSkeleton } from "../skeleton/cards";
|
||||
import { CardScroller } from "../../cardScroller/cardScroller";
|
||||
import { Card } from "../../card/card";
|
||||
import { CardsSkeleton } from "../../skeleton/cards";
|
||||
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
@@ -0,0 +1,59 @@
|
||||
/** @format */
|
||||
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { Card } from "../../card/card";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
const Hero = ({ item, queryKey, userId }) => {
|
||||
return (
|
||||
<div className="item-detail-hero">
|
||||
<div className="item-detail-primaryImage">
|
||||
<Card
|
||||
item={item}
|
||||
seriesId={item.SeriesId}
|
||||
imageType={"Primary"}
|
||||
cardType={
|
||||
item.Type == BaseItemKind.MusicAlbum ||
|
||||
item.Type == BaseItemKind.Audio
|
||||
? "square"
|
||||
: "portrait"
|
||||
}
|
||||
queryKey={queryKey}
|
||||
userId={userId}
|
||||
imageBlurhash={
|
||||
item.ImageBlurHashes?.Primary[
|
||||
Object.keys(item.ImageBlurHashes.Primary)[0]
|
||||
]
|
||||
}
|
||||
hideText
|
||||
disablePadding
|
||||
/>
|
||||
</div>
|
||||
<div className="item-detail-hero-info-container">
|
||||
<div className="item-name">
|
||||
<Typography
|
||||
variant="h3"
|
||||
noWrap={true}
|
||||
fontWeight={600}
|
||||
>
|
||||
{item.Name}
|
||||
</Typography>
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
marginTop: "1em",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
style={{ opacity: "0.7" }}
|
||||
>
|
||||
{item.Overview}
|
||||
</Typography>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Hero;
|
||||
Reference in new issue
Block a user