style: display backdrops in boxset
This commit is contained in:
3 files changed
+47
-18
No files matched your search
@@ -38,7 +38,7 @@ import LikeButton from "../../components/buttons/likeButton";
|
||||
import MarkPlayedButton from "../../components/buttons/markPlayedButton";
|
||||
import PlayButton from "../../components/buttons/playButton";
|
||||
|
||||
import meshBg from "../../assets/herobg.png";
|
||||
import heroBg from "../../assets/herobg.png";
|
||||
import "./boxset.module.scss";
|
||||
|
||||
import IconLink from "../../components/iconLink";
|
||||
@@ -128,7 +128,16 @@ const BoxSetTitlePage = () => {
|
||||
|
||||
useEffect(() => {
|
||||
if (item.isSuccess) {
|
||||
setBackdrop("", "");
|
||||
if (item.data.BackdropImageTags?.length > 0) {
|
||||
setBackdrop(
|
||||
api?.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
}),
|
||||
item.data.Id,
|
||||
);
|
||||
} else {
|
||||
setBackdrop("", "");
|
||||
}
|
||||
}
|
||||
}, [item.isSuccess]);
|
||||
|
||||
@@ -173,10 +182,12 @@ const BoxSetTitlePage = () => {
|
||||
>
|
||||
<div className="item-hero flex flex-row">
|
||||
<div className="item-hero-backdrop-container">
|
||||
{item.data.BackdropImageTags ? (
|
||||
{item.data.BackdropImageTags?.length ? (
|
||||
<motion.img
|
||||
alt={item.data.Name}
|
||||
src={meshBg}
|
||||
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
})}
|
||||
className="item-hero-backdrop"
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
@@ -186,7 +197,17 @@ const BoxSetTitlePage = () => {
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
<motion.img
|
||||
alt={item.data.Name}
|
||||
src={heroBg}
|
||||
className="item-hero-backdrop"
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
style={{
|
||||
y: parallax,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<div
|
||||
@@ -371,7 +392,12 @@ const BoxSetTitlePage = () => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="item-detail">
|
||||
<div
|
||||
className="item-detail"
|
||||
style={{
|
||||
marginBottom: "2em",
|
||||
}}
|
||||
>
|
||||
<ShowMoreText content={item.data.Overview ?? ""} collapsedLines={4} />
|
||||
<div
|
||||
style={{
|
||||
@@ -393,7 +419,7 @@ const BoxSetTitlePage = () => {
|
||||
</div>
|
||||
</div>
|
||||
{collectionItems.data.TotalRecordCount > 0 && (
|
||||
<CardScroller title="Items" displayCards={7} disableDecoration>
|
||||
<CardScroller title="" displayCards={7} disableDecoration>
|
||||
{collectionItems.data.Items.map((similar, index) => {
|
||||
return (
|
||||
<Card
|
||||
|
||||
@@ -47,7 +47,7 @@ import TextLink from "../../components/textLink";
|
||||
import { getTypeIcon } from "../../components/utils/iconsCollection";
|
||||
import { endsAt, getRuntime } from "../../utils/date/time";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||
import { setBackdrop, useBackdropStore } from "../../utils/store/backdrop";
|
||||
|
||||
import ItemSkeleton from "../../components/skeleton/item";
|
||||
|
||||
@@ -199,13 +199,16 @@ const ItemDetail = () => {
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (item.isSuccess) {
|
||||
setAppBackdrop(
|
||||
item.data.Type === BaseItemKind.MusicAlbum ||
|
||||
item.data.Type === BaseItemKind.Episode
|
||||
? `${api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
||||
: `${api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
||||
item.data.Id,
|
||||
);
|
||||
if (item.data.BackdropImageTags?.length > 0) {
|
||||
setBackdrop(
|
||||
api?.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
}),
|
||||
item.data.Id,
|
||||
);
|
||||
} else {
|
||||
setBackdrop("", "");
|
||||
}
|
||||
const direTp = item.data.People.filter((itm) => itm.Type === "Director");
|
||||
setDirectors(direTp);
|
||||
const writeTp = item.data.People.filter((itm) => itm.Type === "Writer");
|
||||
@@ -687,7 +690,7 @@ const ItemDetail = () => {
|
||||
<div className="item-detail">
|
||||
<div style={{ width: "100%" }}>
|
||||
{item.data.Taglines?.length > 0 && (
|
||||
<Typography variant="h5" mb={2}>
|
||||
<Typography variant="h5" mb={2} fontWeight={300}>
|
||||
{item.data.Taglines[0]}
|
||||
</Typography>
|
||||
)}
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
$cardWidth: 18%;
|
||||
|
||||
.item-default.item {
|
||||
gap: 1em;
|
||||
.item-hero {
|
||||
height: 60vh;
|
||||
gap: 2em;
|
||||
row-gap: 1.2em;
|
||||
position: relative;
|
||||
align-items: flex-end;
|
||||
margin-bottom: 1em;
|
||||
display: grid;
|
||||
grid-template-columns: $cardWidth 1fr;
|
||||
grid-template-rows: 1fr auto;
|
||||
@@ -176,7 +174,9 @@ $cardWidth: 18%;
|
||||
}
|
||||
|
||||
.item {
|
||||
gap: 1.5em;
|
||||
&-hero{
|
||||
// margin-bottom: 1em;
|
||||
&-image{
|
||||
box-sizing: border-box;
|
||||
&-container{
|
||||
|
||||
Reference in new issue
Block a user