fix genre view in library page

This commit is contained in:
Prayag Prajapati committed 2023-11-28 18:16:37 +05:30
1 parent 81d188ac5a
commit d6d81f2b4d
4 files changed
+21 -28

No files matched your search

+4 -4
View File
@@ -101,7 +101,7 @@ export const Card = ({
aspectRatio: cardImageAspectRatios[cardType], aspectRatio: cardImageAspectRatios[cardType],
}} }}
> >
{!!item.UserData && ( {/* {!!item.UserData && (
<> <>
<div <div
className="card-indicator check" className="card-indicator check"
@@ -133,8 +133,8 @@ export const Card = ({
</Typography> </Typography>
</div> </div>
</> </>
)} )} */}
{!!imageBlurhash && ( {/* {!!imageBlurhash && (
<Blurhash <Blurhash
hash={imageBlurhash} hash={imageBlurhash}
width={128} width={128}
@@ -143,7 +143,7 @@ export const Card = ({
resolutionY={24} resolutionY={24}
className="card-image-blurhash" className="card-image-blurhash"
/> />
)} )} */}
<div className="card-image-icon-container"> <div className="card-image-icon-container">
{overrideIcon {overrideIcon
? getTypeIcon(overrideIcon) ? getTypeIcon(overrideIcon)
+8 -1
View File
@@ -23,6 +23,7 @@
z-index: 1; z-index: 1;
top: 0; top: 0;
left: 0; left: 0;
transition: filter $transition-time-default;
&-container { &-container {
position: relative; position: relative;
width: 100%; width: 100%;
@@ -43,6 +44,7 @@
z-index: 0; z-index: 0;
top: 0; top: 0;
left: 0; left: 0;
transition: filter $transition-time-default;
.material-symbols-rounded { .material-symbols-rounded {
position: absolute; position: absolute;
top: 50%; top: 50%;
@@ -70,7 +72,6 @@
height: 100%; height: 100%;
left: 0; left: 0;
top: 0; top: 0;
background: rgb(0 0 0 / 0.6);
z-index: 10; z-index: 10;
opacity: 0; opacity: 0;
transition: opacity $transition-time-default; transition: opacity $transition-time-default;
@@ -83,6 +84,12 @@
&:hover, &:hover,
&:focus, &:focus,
&:focus-within { &:focus-within {
.card-image {
filter: brightness(0.6);
}
.card-image-icon-container {
filter: brightness(0.6);
}
.card-overlay { .card-overlay {
opacity: 1; opacity: 1;
} }
@@ -6,6 +6,7 @@ import { useQuery } from "@tanstack/react-query";
import { Card } from "../../../card/card"; import { Card } from "../../../card/card";
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client"; import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
import { useApi } from "../../../../utils/store/api"; import { useApi } from "../../../../utils/store/api";
import { CardScroller } from "../../../cardScroller/cardScroller";
const GenreView = ({ libraryId, genreId, genreName, userId }) => { const GenreView = ({ libraryId, genreId, genreName, userId }) => {
const [api] = useApi((state) => [state.api]); const [api] = useApi((state) => [state.api]);
@@ -23,26 +24,15 @@ const GenreView = ({ libraryId, genreId, genreName, userId }) => {
if (items.isSuccess && items.data.Items.length > 0) { if (items.isSuccess && items.data.Items.length > 0) {
return ( return (
<div className="library-genre"> <div className="library-genre">
<div className="library-genre-header"> <CardScroller
<div className="library-genre-header-decoration"></div> title={genreName}
<Typography displayCards={8}
noWrap disableDecoration
variant="h5"
color="textPrimary"
className=""
>
{genreName}
</Typography>
</div>
<div
className="library-grid"
style={{
paddingTop: "0.5em",
}}
> >
{items.data.Items.map((item, index) => { {items.data.Items.map((item, index) => {
return ( return (
<Card <Card
key={index}
item={item} item={item}
seriesId={item.SeriesId} seriesId={item.SeriesId}
cardTitle={ cardTitle={
@@ -109,7 +99,7 @@ const GenreView = ({ libraryId, genreId, genreName, userId }) => {
/> />
); );
})} })}
</div> </CardScroller>
</div> </div>
); );
} }
+2 -6
View File
@@ -130,7 +130,6 @@ const LibraryView = () => {
if (currentLib.isError) { if (currentLib.isError) {
console.error(currentLib.error); console.error(currentLib.error);
} }
console.log(currentLib.isSuccess);
if (currentLib.isSuccess) { if (currentLib.isSuccess) {
setViewType(null); setViewType(null);
if (currentLib.data.CollectionType == "movies") { if (currentLib.data.CollectionType == "movies") {
@@ -875,7 +874,7 @@ const LibraryView = () => {
/> />
</AccordionDetails> </AccordionDetails>
</Accordion> </Accordion>
{currentLib.data.Items[0] {currentLib.data
.CollectionType == .CollectionType ==
"movies" && ( "movies" && (
<Accordion className="library-filter-accordian"> <Accordion className="library-filter-accordian">
@@ -1098,7 +1097,6 @@ const LibraryView = () => {
)} )}
{!onlyStatusFilterViews.includes( {!onlyStatusFilterViews.includes(
currentLib.data currentLib.data
.Items[0]
.CollectionType, .CollectionType,
) && ( ) && (
<Accordion className="library-filter-accordian"> <Accordion className="library-filter-accordian">
@@ -1308,9 +1306,7 @@ const LibraryView = () => {
return ( return (
<GenreView <GenreView
key={item.Id} key={item.Id}
libraryId={ libraryId={currentLib.data.Id}
currentLib.data.Items[0].Id
}
genreId={item.Id} genreId={item.Id}
genreName={item.Name} genreName={item.Name}
userId={user.data.Id} userId={user.data.Id}