From 61adf341eba2cee3360fc5689541403a89999dca Mon Sep 17 00:00:00 2001 From: Prayag Prajapati Date: Sun, 3 Sep 2023 23:11:30 +0530 Subject: [PATCH] Fix card component like button #153 --- src/components/card/card.jsx | 5 ++-- src/routes/library/index.jsx | 53 +++++++++++++++++++++++++++++------- 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/src/components/card/card.jsx b/src/components/card/card.jsx index 8bc8355..6b653d1 100644 --- a/src/components/card/card.jsx +++ b/src/components/card/card.jsx @@ -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 = ({ diff --git a/src/routes/library/index.jsx b/src/routes/library/index.jsx index e7d047b..87144a6 100644 --- a/src/routes/library/index.jsx +++ b/src/routes/library/index.jsx @@ -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 = () => { }} > { ? "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] + ] + } > );