chore(web): Implement new ArtistPage and add new TracksList component #243
This commit is contained in:
21 files changed
+704
-284
No files matched your search
@@ -1,4 +1,140 @@
|
||||
.item-artist.item {
|
||||
gap: 1em;
|
||||
.item-hero {
|
||||
height: 50vh;
|
||||
gap: 2em;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
&-image {
|
||||
opacity: 0;
|
||||
width: 100%;
|
||||
object-fit: contain;
|
||||
transition: opacity $transition-time-default;
|
||||
&-container {
|
||||
height: fit-content;
|
||||
max-height: 100%;
|
||||
overflow: hidden;
|
||||
border-radius: $border-radius-default;
|
||||
box-shadow: $shadow-card;
|
||||
flex-grow: 1;
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
width: 18% !important;
|
||||
}
|
||||
&-blurhash {
|
||||
position: absolute !important;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
z-index: -1;
|
||||
}
|
||||
}
|
||||
&-logo {
|
||||
max-width: 42rem;
|
||||
max-height: 10rem;
|
||||
opacity: 0;
|
||||
transition: opacity $transition-time-default;
|
||||
object-position: bottom;
|
||||
}
|
||||
&-detail {
|
||||
width: 100%;
|
||||
align-items: flex-start;
|
||||
gap: 1em;
|
||||
justify-content: end;
|
||||
}
|
||||
&-buttons {
|
||||
&-container {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
&-backdrop {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
object-position: top;
|
||||
opacity: 0;
|
||||
transition: opacity $transition-time-default;
|
||||
&-container {
|
||||
filter: brightness(0.8);
|
||||
position: absolute;
|
||||
top: -4.4em;
|
||||
left: -1.6em;
|
||||
width: 100vw;
|
||||
height: calc(50vh + 4.4em);
|
||||
z-index: -1;
|
||||
mask-image: linear-gradient(to top, transparent, black);
|
||||
-webkit-mask-image: linear-gradient(
|
||||
to top,
|
||||
transparent,
|
||||
black
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item-detail {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 5px 35%;
|
||||
justify-items: center;
|
||||
align-items: start;
|
||||
gap: 1em;
|
||||
|
||||
&-cast {
|
||||
&-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1em;
|
||||
}
|
||||
&-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||
gap: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
&-card {
|
||||
display: grid;
|
||||
grid-template-columns: 6em 1fr;
|
||||
gap: 0.5em;
|
||||
align-items: center;
|
||||
color: white !important;
|
||||
text-decoration: none;
|
||||
padding: 0.5em;
|
||||
background: rgb(255 255 255 / 0);
|
||||
transition: background $transition-time-default;
|
||||
border-radius: $border-radius-default;
|
||||
&:hover {
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
}
|
||||
&-image,
|
||||
&-icon {
|
||||
width: 6em;
|
||||
height: 6em;
|
||||
object-fit: cover;
|
||||
border-radius: 100%;
|
||||
box-shadow: $shadow-card-image;
|
||||
}
|
||||
&-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 1em;
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
.material-symbols-rounded {
|
||||
font-size: 3em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&-link {
|
||||
color: white;
|
||||
text-decoration-color: rgb(255 255 255 / 0.5);
|
||||
&:hover {
|
||||
text-decoration-color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.item-detail-artist {
|
||||
&-container {
|
||||
position: relative;
|
||||
|
||||
+141
-32
@@ -1,15 +1,16 @@
|
||||
import PropTypes from "prop-types";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import React, { useState, useEffect, useLayoutEffect } from "react";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import Divider from "@mui/material/Divider";
|
||||
import Tab from "@mui/material/Tab";
|
||||
import Tabs from "@mui/material/Tabs";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
|
||||
import { useParams } from "react-router-dom";
|
||||
import { Link, useParams } from "react-router-dom";
|
||||
|
||||
import {
|
||||
BaseItemKind,
|
||||
@@ -22,14 +23,17 @@ import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api"
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { Blurhash } from "react-blurhash";
|
||||
import LikeButton from "../../components/buttons/likeButton";
|
||||
import { Card } from "../../components/card/card";
|
||||
import Hero from "../../components/layouts/item/hero";
|
||||
|
||||
import meshBg from "../../assets/herobg.png";
|
||||
import { ArtistAlbum } from "../../components/layouts/artist/artistAlbum";
|
||||
import MusicTrack from "../../components/musicTrack";
|
||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||
import ShowMoreText from "../../components/showMoreText";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||
import { setBackdrop, useBackdropStore } from "../../utils/store/backdrop";
|
||||
import "./artist.module.scss";
|
||||
|
||||
function TabPanel(props) {
|
||||
@@ -98,7 +102,6 @@ const ArtistTitlePage = () => {
|
||||
return result.data;
|
||||
},
|
||||
enabled: item.isSuccess && item.data.Type === BaseItemKind.MusicArtist,
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
const artistSongs = useQuery({
|
||||
@@ -116,7 +119,6 @@ const ArtistTitlePage = () => {
|
||||
return result.data;
|
||||
},
|
||||
enabled: item.isSuccess && item.data.Type === BaseItemKind.MusicArtist,
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
const artistAppearances = useQuery({
|
||||
@@ -134,7 +136,6 @@ const ArtistTitlePage = () => {
|
||||
return result.data;
|
||||
},
|
||||
enabled: item.isSuccess && item.data.Type === BaseItemKind.MusicArtist,
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
const artistTabs = [
|
||||
@@ -144,7 +145,7 @@ const ArtistTitlePage = () => {
|
||||
];
|
||||
const [activeArtistTab, setActiveArtistTab] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
useLayoutEffect(() => {
|
||||
if (
|
||||
artistDiscography.isSuccess &&
|
||||
artistSongs.isSuccess &&
|
||||
@@ -158,23 +159,22 @@ const ArtistTitlePage = () => {
|
||||
setActiveArtistTab(2);
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
}, [
|
||||
artistDiscography.isSuccess,
|
||||
artistSongs.isSuccess,
|
||||
artistAppearances.isSuccess,
|
||||
]);
|
||||
|
||||
const [animationDirection, setAnimationDirection] = useState("forward");
|
||||
|
||||
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
||||
|
||||
useEffect(() => {
|
||||
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`,
|
||||
setBackdrop(
|
||||
`${api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
||||
item.data.Id,
|
||||
);
|
||||
}
|
||||
}, []);
|
||||
}, [item.isSuccess]);
|
||||
|
||||
if (item.isPending) {
|
||||
return (
|
||||
@@ -205,23 +205,132 @@ const ArtistTitlePage = () => {
|
||||
duration: 0.25,
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY"
|
||||
style={{
|
||||
padding: "5em 2em 2em 1em",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
gap: "0.5em",
|
||||
}}
|
||||
className="scrollY item item-artist"
|
||||
>
|
||||
<Hero
|
||||
item={item.data}
|
||||
userId={user.data.Id}
|
||||
queryKey={["item", id]}
|
||||
disableMarkAsPlayedButton
|
||||
audioPlayButton
|
||||
disableInfoStrip
|
||||
/>
|
||||
<div className="item-hero flex flex-row">
|
||||
<div className="item-hero-backdrop-container">
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
})}
|
||||
className="item-hero-backdrop"
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className="item-hero-image-container"
|
||||
style={{
|
||||
aspectRatio: item.data.PrimaryImageAspectRatio ?? 1,
|
||||
}}
|
||||
>
|
||||
{Object.keys(item.data.ImageTags).includes("Primary") ? (
|
||||
<>
|
||||
<Blurhash
|
||||
hash={
|
||||
item.data.ImageBlurHashes.Primary[
|
||||
item.data.ImageTags.Primary
|
||||
]
|
||||
}
|
||||
className="item-hero-image-blurhash"
|
||||
/>
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Primary", {
|
||||
quality: 90,
|
||||
tag: item.data.ImageTags.Primary,
|
||||
})}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
className="item-hero-image"
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</div>
|
||||
<div className="item-hero-detail flex flex-column">
|
||||
{Object.keys(item.data.ImageTags).includes("Logo") ? (
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Logo", {
|
||||
quality: 90,
|
||||
fillWidth: 592,
|
||||
fillHeight: 592,
|
||||
})}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
className="item-hero-logo"
|
||||
/>
|
||||
) : (
|
||||
<Typography variant="h3">{item.data.Name}</Typography>
|
||||
)}
|
||||
|
||||
<LikeButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
queryKey={["item", id]}
|
||||
isFavorite={item.data.UserData.IsFavorite}
|
||||
userId={user.data.Id}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="item-detail">
|
||||
<div style={{ width: "100%", overflow: "hidden" }}>
|
||||
<ShowMoreText
|
||||
content={item.data.Overview ?? ""}
|
||||
collapsedLines={4}
|
||||
/>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: "0.6em",
|
||||
alignSelf: "end",
|
||||
marginTop: "1em",
|
||||
}}
|
||||
>
|
||||
{item.data.ExternalUrls.map((url) => (
|
||||
<Link
|
||||
key={url.Url}
|
||||
target="_blank"
|
||||
to={url.Url}
|
||||
className="item-detail-link"
|
||||
>
|
||||
<Typography>{url.Name}</Typography>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<Divider flexItem orientation="vertical" />
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
{item.data.PremiereDate && (
|
||||
<>
|
||||
<Typography variant="h5">Born</Typography>
|
||||
<Typography sx={{ opacity: 0.8 }}>
|
||||
{new Date(item.data.PremiereDate).toDateString()}
|
||||
</Typography>
|
||||
</>
|
||||
)}
|
||||
{item.data.EndDate && (
|
||||
<>
|
||||
<Typography variant="h5" mt={2}>
|
||||
Death
|
||||
</Typography>
|
||||
<Typography sx={{ opacity: 0.8 }}>
|
||||
{new Date(item.data.EndDate).toDateString()}
|
||||
</Typography>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="item-detail-artist-container">
|
||||
<div className="item-detail-artist-header">
|
||||
<Tabs
|
||||
|
||||
Reference in new issue
Block a user