Fix card component like button #153
This commit is contained in:
2 files changed
+45
-13
No files matched your search
@@ -116,8 +116,7 @@ export const Card = ({
|
||||
borderRadius: "100px",
|
||||
backdropFilter: "blur(5px)",
|
||||
transition: "opacity 250ms",
|
||||
opacity: item.UserData
|
||||
?.IsPlayed
|
||||
opacity: item.UserData?.Played
|
||||
? 1
|
||||
: 0,
|
||||
boxShadow:
|
||||
@@ -221,7 +220,7 @@ export const Card = ({
|
||||
<MarkPlayedButton
|
||||
itemId={item.Id}
|
||||
itemName={item.Name}
|
||||
isPlayed={item.UserData.IsPlayed}
|
||||
isPlayed={item.UserData.Played}
|
||||
queryKey={queryKey}
|
||||
userId={userId}
|
||||
/>
|
||||
|
||||
@@ -348,6 +348,7 @@ const LibraryView = () => {
|
||||
is3D: is3D ? true : undefined,
|
||||
startIndex: maxDisplayItems * (page - 1),
|
||||
limit: maxDisplayItems,
|
||||
fields: ["UserData"],
|
||||
});
|
||||
}
|
||||
return result.data;
|
||||
@@ -956,10 +957,38 @@ const LibraryView = () => {
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
key={index}
|
||||
itemName={item.Name}
|
||||
itemId={item.Id}
|
||||
imageType="Primary"
|
||||
key={item.Id}
|
||||
item={item}
|
||||
seriesId={item.SeriesId}
|
||||
cardTitle={
|
||||
item.Type ==
|
||||
BaseItemKind.Episode
|
||||
? item.SeriesName
|
||||
: item.Name
|
||||
}
|
||||
imageType={"Primary"}
|
||||
cardCaption={
|
||||
item.Type ==
|
||||
BaseItemKind.Episode
|
||||
? `S${item.ParentIndexNumber}:E${item.IndexNumber} - ${item.Name}`
|
||||
: item.Type ==
|
||||
BaseItemKind.Series
|
||||
? `${
|
||||
item.ProductionYear
|
||||
} - ${
|
||||
!!item.EndDate
|
||||
? new Date(
|
||||
item.EndDate,
|
||||
).toLocaleString(
|
||||
[],
|
||||
{
|
||||
year: "numeric",
|
||||
},
|
||||
)
|
||||
: "Present"
|
||||
}`
|
||||
: item.ProductionYear
|
||||
}
|
||||
cardType={
|
||||
item.Type ==
|
||||
BaseItemKind.MusicAlbum ||
|
||||
@@ -968,9 +997,6 @@ const LibraryView = () => {
|
||||
? "square"
|
||||
: "portrait"
|
||||
}
|
||||
isFavorite={
|
||||
item.UserData.IsFavorite
|
||||
}
|
||||
queryKey={[
|
||||
"libraryView",
|
||||
"currentLibItems",
|
||||
@@ -1008,10 +1034,17 @@ const LibraryView = () => {
|
||||
],
|
||||
],
|
||||
]}
|
||||
isPlayed={
|
||||
item.UserData.Played
|
||||
}
|
||||
userId={user.data.Id}
|
||||
imageBlurhash={
|
||||
item.ImageBlurHashes
|
||||
?.Primary[
|
||||
Object.keys(
|
||||
item
|
||||
.ImageBlurHashes
|
||||
.Primary,
|
||||
)[0]
|
||||
]
|
||||
}
|
||||
></Card>
|
||||
</Grid2>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user