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",
|
borderRadius: "100px",
|
||||||
backdropFilter: "blur(5px)",
|
backdropFilter: "blur(5px)",
|
||||||
transition: "opacity 250ms",
|
transition: "opacity 250ms",
|
||||||
opacity: item.UserData
|
opacity: item.UserData?.Played
|
||||||
?.IsPlayed
|
|
||||||
? 1
|
? 1
|
||||||
: 0,
|
: 0,
|
||||||
boxShadow:
|
boxShadow:
|
||||||
@@ -221,7 +220,7 @@ export const Card = ({
|
|||||||
<MarkPlayedButton
|
<MarkPlayedButton
|
||||||
itemId={item.Id}
|
itemId={item.Id}
|
||||||
itemName={item.Name}
|
itemName={item.Name}
|
||||||
isPlayed={item.UserData.IsPlayed}
|
isPlayed={item.UserData.Played}
|
||||||
queryKey={queryKey}
|
queryKey={queryKey}
|
||||||
userId={userId}
|
userId={userId}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -348,6 +348,7 @@ const LibraryView = () => {
|
|||||||
is3D: is3D ? true : undefined,
|
is3D: is3D ? true : undefined,
|
||||||
startIndex: maxDisplayItems * (page - 1),
|
startIndex: maxDisplayItems * (page - 1),
|
||||||
limit: maxDisplayItems,
|
limit: maxDisplayItems,
|
||||||
|
fields: ["UserData"],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return result.data;
|
return result.data;
|
||||||
@@ -956,10 +957,38 @@ const LibraryView = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Card
|
<Card
|
||||||
key={index}
|
key={item.Id}
|
||||||
itemName={item.Name}
|
item={item}
|
||||||
itemId={item.Id}
|
seriesId={item.SeriesId}
|
||||||
imageType="Primary"
|
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={
|
cardType={
|
||||||
item.Type ==
|
item.Type ==
|
||||||
BaseItemKind.MusicAlbum ||
|
BaseItemKind.MusicAlbum ||
|
||||||
@@ -968,9 +997,6 @@ const LibraryView = () => {
|
|||||||
? "square"
|
? "square"
|
||||||
: "portrait"
|
: "portrait"
|
||||||
}
|
}
|
||||||
isFavorite={
|
|
||||||
item.UserData.IsFavorite
|
|
||||||
}
|
|
||||||
queryKey={[
|
queryKey={[
|
||||||
"libraryView",
|
"libraryView",
|
||||||
"currentLibItems",
|
"currentLibItems",
|
||||||
@@ -1008,10 +1034,17 @@ const LibraryView = () => {
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
]}
|
]}
|
||||||
isPlayed={
|
|
||||||
item.UserData.Played
|
|
||||||
}
|
|
||||||
userId={user.data.Id}
|
userId={user.data.Id}
|
||||||
|
imageBlurhash={
|
||||||
|
item.ImageBlurHashes
|
||||||
|
?.Primary[
|
||||||
|
Object.keys(
|
||||||
|
item
|
||||||
|
.ImageBlurHashes
|
||||||
|
.Primary,
|
||||||
|
)[0]
|
||||||
|
]
|
||||||
|
}
|
||||||
></Card>
|
></Card>
|
||||||
</Grid2>
|
</Grid2>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user