From f9aac5e19fb17d274c56b26f0f79feb814641358 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Wed, 25 Feb 2026 20:33:33 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A0=20Carousels=20on=20Wanted=20and=20?= =?UTF-8?q?Volumes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Dashboard/VolumeGroups.tsx | 85 ++++--- .../components/Dashboard/WantedComicsList.tsx | 209 ++++++++++-------- 2 files changed, 163 insertions(+), 131 deletions(-) diff --git a/src/client/components/Dashboard/VolumeGroups.tsx b/src/client/components/Dashboard/VolumeGroups.tsx index ebf0382..88c2368 100644 --- a/src/client/components/Dashboard/VolumeGroups.tsx +++ b/src/client/components/Dashboard/VolumeGroups.tsx @@ -4,6 +4,7 @@ import ellipsize from "ellipsize"; import { Link, useNavigate } from "react-router-dom"; import Card from "../shared/Carda"; import Header from "../shared/Header"; +import useEmblaCarousel from "embla-carousel-react"; export const VolumeGroups = (props): ReactElement => { // Till mongo gives us back the deduplicated results with the ObjectId @@ -13,50 +14,64 @@ export const VolumeGroups = (props): ReactElement => { navigate(`/volumes/all`); }; + // embla carousel + const [emblaRef, emblaApi] = useEmblaCarousel({ + loop: false, + align: "start", + containScroll: "trimSnaps", + slidesToScroll: 1, + }); + return ( -
+
Based on ComicVine Volume information} iconClassNames="fa-solid fa-binoculars mr-2" link={"/volumes"} /> -
- {map(deduplicatedGroups, (data) => { - return ( -
- -
-
- - {ellipsize(data.volumes.name, 48)} - -
- {/* issue count */} - - - - +
+
+
+ {map(deduplicatedGroups, (data) => { + return ( +
+ +
+
+ + {ellipsize(data.volumes.name, 48)} + +
+ {/* issue count */} + + + + - - {data.volumes.count_of_issues} issues - - + + {data.volumes.count_of_issues} issues + + +
+
+
+
+
- -
-
-
-
- ); - })} + ); + })} +
+
-
+ ); }; diff --git a/src/client/components/Dashboard/WantedComicsList.tsx b/src/client/components/Dashboard/WantedComicsList.tsx index 55602a3..6ed9518 100644 --- a/src/client/components/Dashboard/WantedComicsList.tsx +++ b/src/client/components/Dashboard/WantedComicsList.tsx @@ -6,6 +6,7 @@ import { isEmpty, isNil, isUndefined, map } from "lodash"; import { detectIssueTypes } from "../../shared/utils/tradepaperback.utils"; import { determineCoverFile } from "../../shared/utils/metadata.utils"; import Header from "../shared/Header"; +import useEmblaCarousel from "embla-carousel-react"; type WantedComicsListProps = { comics: any; @@ -16,108 +17,124 @@ export const WantedComicsList = ({ }: WantedComicsListProps): ReactElement => { const navigate = useNavigate(); + // embla carousel + const [emblaRef, emblaApi] = useEmblaCarousel({ + loop: false, + align: "start", + containScroll: "trimSnaps", + slidesToScroll: 1, + }); + return ( - <> +
Comics marked as wanted from various sources} iconClassNames="fa-solid fa-binoculars mr-2" link={"/wanted"} /> -
- {map( - comics, - ({ - _id, - rawFileDetails, - sourcedMetadata: { comicvine, comicInfo, locg }, - wanted, - }) => { - const isComicBookMetadataAvailable = !isUndefined(comicvine); - const consolidatedComicMetadata = { - rawFileDetails, - comicvine, - comicInfo, - locg, - }; - - const { - issueName, - url, - publisher = null, - } = determineCoverFile(consolidatedComicMetadata); - const titleElement = ( - - {ellipsize(issueName, 20)} -

{publisher}

- - ); - return ( - No Name} - cardState="wanted" - > -
-
- {/* Issue type */} - {isComicBookMetadataAvailable && - !isNil(detectIssueTypes(comicvine.description)) ? ( -
- - - - - - - { - detectIssueTypes(comicvine.description) - .displayName - } - - +
+
+
+ {map( + comics, + ({ + _id, + rawFileDetails, + sourcedMetadata: { comicvine, comicInfo, locg }, + wanted, + }) => { + const isComicBookMetadataAvailable = !isUndefined(comicvine); + const consolidatedComicMetadata = { + rawFileDetails, + comicvine, + comicInfo, + locg, + }; + + const { + issueName, + url, + publisher = null, + } = determineCoverFile(consolidatedComicMetadata); + const titleElement = ( + + {ellipsize(issueName, 20)} +

{publisher}

+ + ); + return ( +
+ No Name} + cardState="wanted" + > +
+
+ {/* Issue type */} + {isComicBookMetadataAvailable && + !isNil(detectIssueTypes(comicvine.description)) ? ( +
+ + + + + + + { + detectIssueTypes(comicvine.description) + .displayName + } + + +
+ ) : null} + {/* issues marked as wanted, part of this volume */} + {wanted?.markEntireVolumeWanted ? ( +
sagla volume pahije
+ ) : ( +
+ + + + + + + {wanted.issues.length} + + +
+ )} +
+ {/* comicVine metadata presence */} + {isComicBookMetadataAvailable && ( + {"ComicVine + )} + {!isEmpty(locg) && ( + + )} +
+
- ) : null} - {/* issues marked as wanted, part of this volume */} - {wanted?.markEntireVolumeWanted ? ( -
sagla volume pahije
- ) : ( -
- - - - - - - {wanted.issues.length} - - -
- )} -
- {/* comicVine metadata presence */} - {isComicBookMetadataAvailable && ( - {"ComicVine - )} - {!isEmpty(locg) && ( - - )} -
- - ); - }, - )} -
- + ); + }, + )} +
+
+
+
); };