fix(ui): use one backdrop on item pages
Continuous Integration / build_web (push) Failing after 2s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
Continuous Integration / build_web (push) Failing after 2s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
Drop the extra sharp header backdrop layer on item details. The fixed app backdrop now covers the hero and the episode/content area, so scrolling never reveals a second background color.
This commit is contained in:
1 parent
80ebe77fbc
commit
5d1d64d8d8
3 files changed
+1
-49
No files matched your search
@@ -42,7 +42,6 @@ type ItemDetailLayoutProps = {
|
|||||||
/** CSS modifier, rendered as `item-<variant>`. */
|
/** CSS modifier, rendered as `item-<variant>`. */
|
||||||
variant: "default" | "episode" | "series" | "boxset" | "person";
|
variant: "default" | "episode" | "series" | "boxset" | "person";
|
||||||
mediaQualityInfo?: MediaQualityInfo;
|
mediaQualityInfo?: MediaQualityInfo;
|
||||||
backdropSrc?: string | null;
|
|
||||||
/** Blurhash for the app backdrop; defaults to the item's (or an episode's series) backdrop. */
|
/** Blurhash for the app backdrop; defaults to the item's (or an episode's series) backdrop. */
|
||||||
backdropHash?: string;
|
backdropHash?: string;
|
||||||
/** Play button area; omitted for items that can't be played (people). */
|
/** Play button area; omitted for items that can't be played (people). */
|
||||||
@@ -61,7 +60,6 @@ const ItemDetailLayout = ({
|
|||||||
item,
|
item,
|
||||||
variant,
|
variant,
|
||||||
mediaQualityInfo,
|
mediaQualityInfo,
|
||||||
backdropSrc,
|
|
||||||
backdropHash,
|
backdropHash,
|
||||||
playButton,
|
playButton,
|
||||||
showTrailer = true,
|
showTrailer = true,
|
||||||
@@ -104,8 +102,6 @@ const ItemDetailLayout = ({
|
|||||||
item={item}
|
item={item}
|
||||||
api={api}
|
api={api}
|
||||||
mediaQualityInfo={mediaQualityInfo}
|
mediaQualityInfo={mediaQualityInfo}
|
||||||
scrollTargetRef={containerRef}
|
|
||||||
backdropSrc={backdropSrc}
|
|
||||||
>
|
>
|
||||||
<div className="item-hero-buttons-container">
|
<div className="item-hero-buttons-container">
|
||||||
<div className="flex flex-row" style={{ width: "100%" }}>
|
<div className="flex flex-row" style={{ width: "100%" }}>
|
||||||
|
|||||||
@@ -91,14 +91,6 @@ const SeriesView = ({ item }: { item: BaseItemDto }) => {
|
|||||||
const season = currentSeasonItem.data;
|
const season = currentSeasonItem.data;
|
||||||
const backdropOwner = season?.BackdropImageTags?.length ? season : item;
|
const backdropOwner = season?.BackdropImageTags?.length ? season : item;
|
||||||
const backdropTag = backdropOwner.BackdropImageTags?.[0];
|
const backdropTag = backdropOwner.BackdropImageTags?.[0];
|
||||||
const backdropSrc =
|
|
||||||
api && backdropTag
|
|
||||||
? getImageUrlsApi(api).getItemImageUrlById(
|
|
||||||
backdropOwner.Id ?? "",
|
|
||||||
"Backdrop",
|
|
||||||
{ tag: backdropTag },
|
|
||||||
)
|
|
||||||
: undefined;
|
|
||||||
const backdropHash =
|
const backdropHash =
|
||||||
(backdropTag && backdropOwner.ImageBlurHashes?.Backdrop?.[backdropTag]) ||
|
(backdropTag && backdropOwner.ImageBlurHashes?.Backdrop?.[backdropTag]) ||
|
||||||
"";
|
"";
|
||||||
@@ -107,7 +99,6 @@ const SeriesView = ({ item }: { item: BaseItemDto }) => {
|
|||||||
<ItemDetailLayout
|
<ItemDetailLayout
|
||||||
item={item}
|
item={item}
|
||||||
variant="series"
|
variant="series"
|
||||||
backdropSrc={backdropSrc}
|
|
||||||
backdropHash={backdropHash}
|
backdropHash={backdropHash}
|
||||||
playButton={
|
playButton={
|
||||||
<PlayButton
|
<PlayButton
|
||||||
|
|||||||
@@ -5,9 +5,8 @@ import { green, red, yellow } from "@mui/material/colors";
|
|||||||
import Stack from "@mui/material/Stack";
|
import Stack from "@mui/material/Stack";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import { Link } from "@tanstack/react-router";
|
import { Link } from "@tanstack/react-router";
|
||||||
import React, { type ReactNode, type RefObject } from "react";
|
import React, { type ReactNode } from "react";
|
||||||
import { Blurhash } from "react-blurhash";
|
import { Blurhash } from "react-blurhash";
|
||||||
import heroBg from "@/assets/herobg.png";
|
|
||||||
import ultraHdIcon from "@/assets/icons/4k.svg";
|
import ultraHdIcon from "@/assets/icons/4k.svg";
|
||||||
import dolbyAtmosIcon from "@/assets/icons/dolby-atmos.svg";
|
import dolbyAtmosIcon from "@/assets/icons/dolby-atmos.svg";
|
||||||
import dolbyDigitalIcon from "@/assets/icons/dolby-digital.svg";
|
import dolbyDigitalIcon from "@/assets/icons/dolby-digital.svg";
|
||||||
@@ -23,7 +22,6 @@ import hdr10PlusIcon from "@/assets/icons/hdr10-plus.svg";
|
|||||||
import sdIcon from "@/assets/icons/sd.svg";
|
import sdIcon from "@/assets/icons/sd.svg";
|
||||||
import sdrIcon from "@/assets/icons/sdr.svg";
|
import sdrIcon from "@/assets/icons/sdr.svg";
|
||||||
import CachedImage from "@/components/cachedImage";
|
import CachedImage from "@/components/cachedImage";
|
||||||
import ItemBackdrop from "@/components/itemBackdrop";
|
|
||||||
import { getTypeIcon } from "@/components/utils/iconsCollection";
|
import { getTypeIcon } from "@/components/utils/iconsCollection";
|
||||||
import { endsAt, getRuntime } from "@/utils/date/time";
|
import { endsAt, getRuntime } from "@/utils/date/time";
|
||||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||||
@@ -34,31 +32,18 @@ interface ItemHeaderProps {
|
|||||||
item: BaseItemDto;
|
item: BaseItemDto;
|
||||||
api: Api | undefined;
|
api: Api | undefined;
|
||||||
mediaQualityInfo?: MediaQualityInfo;
|
mediaQualityInfo?: MediaQualityInfo;
|
||||||
scrollTargetRef?: RefObject<HTMLDivElement | null>;
|
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
backdropSrc?: string | null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const ItemHeader = ({
|
const ItemHeader = ({
|
||||||
item,
|
item,
|
||||||
api,
|
api,
|
||||||
mediaQualityInfo,
|
mediaQualityInfo,
|
||||||
scrollTargetRef,
|
|
||||||
children,
|
children,
|
||||||
backdropSrc,
|
|
||||||
}: ItemHeaderProps) => {
|
}: ItemHeaderProps) => {
|
||||||
const isEpisode = item.Type === "Episode";
|
const isEpisode = item.Type === "Episode";
|
||||||
// A runtime / "ends at" is meaningless for people and artists (it sums their whole catalogue)
|
// A runtime / "ends at" is meaningless for people and artists (it sums their whole catalogue)
|
||||||
const showRuntime = item.Type !== "MusicArtist" && item.Type !== "Person";
|
const showRuntime = item.Type !== "MusicArtist" && item.Type !== "Person";
|
||||||
const backdropTag =
|
|
||||||
isEpisode && item.ParentBackdropImageTags?.length
|
|
||||||
? item.ParentBackdropImageTags[0]
|
|
||||||
: item.BackdropImageTags?.[0];
|
|
||||||
const backdropId =
|
|
||||||
isEpisode && item.ParentBackdropImageTags?.length
|
|
||||||
? (item.ParentBackdropItemId ?? item.Id)
|
|
||||||
: item.Id;
|
|
||||||
|
|
||||||
const parentLogoImageTag =
|
const parentLogoImageTag =
|
||||||
(item as any).ParentLogoImageTag || (item as any).ParentLogoImageTags?.[0];
|
(item as any).ParentLogoImageTag || (item as any).ParentLogoImageTags?.[0];
|
||||||
const logoTag =
|
const logoTag =
|
||||||
@@ -94,26 +79,6 @@ const ItemHeader = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="item-hero">
|
<div className="item-hero">
|
||||||
<div className="item-hero-backdrop-container">
|
|
||||||
{scrollTargetRef && (
|
|
||||||
<ItemBackdrop
|
|
||||||
targetRef={scrollTargetRef}
|
|
||||||
alt={item.Name ?? ""}
|
|
||||||
backdropSrc={
|
|
||||||
backdropSrc ??
|
|
||||||
(backdropTag
|
|
||||||
? api &&
|
|
||||||
getImageUrlsApi(api).getItemImageUrlById(
|
|
||||||
backdropId ?? "",
|
|
||||||
"Backdrop",
|
|
||||||
{ tag: backdropTag },
|
|
||||||
)
|
|
||||||
: undefined)
|
|
||||||
}
|
|
||||||
fallbackSrc={heroBg}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div
|
<div
|
||||||
className="item-hero-image-container"
|
className="item-hero-image-container"
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
Reference in new issue
Block a user