diff --git a/package.json b/package.json
index 6bc655f..29992e8 100644
--- a/package.json
+++ b/package.json
@@ -30,7 +30,6 @@
"axios-cache-interceptor": "^1.0.1",
"axios-rate-limit": "^1.3.0",
"babel-plugin-styled-components": "^2.1.4",
- "blaze-slider": "^1.9.3",
"date-fns": "^2.28.0",
"dayjs": "^1.10.6",
"ellipsize": "^0.5.1",
@@ -42,6 +41,7 @@
"html-to-text": "^8.1.0",
"immer": "^10.0.3",
"jsdoc": "^3.6.10",
+ "keen-slider": "^6.8.6",
"lodash": "^4.17.21",
"pretty-bytes": "^5.6.0",
"prop-types": "^15.8.1",
@@ -55,7 +55,6 @@
"react-final-form": "^6.5.9",
"react-final-form-arrays": "^3.1.4",
"react-loader-spinner": "^4.0.0",
- "react-masonry-css": "^1.0.16",
"react-modal": "^3.15.1",
"react-router": "^6.9.0",
"react-router-dom": "^6.9.0",
diff --git a/src/client/components/Dashboard/Dashboard.tsx b/src/client/components/Dashboard/Dashboard.tsx
index 4919d40..cd70686 100644
--- a/src/client/components/Dashboard/Dashboard.tsx
+++ b/src/client/components/Dashboard/Dashboard.tsx
@@ -112,111 +112,10 @@ export const Dashboard = (): ReactElement => {
// );
return (
-
- Dashboard
-
- {recentComics?.data.docs.map(
- (
- {
- _id,
- rawFileDetails,
- sourcedMetadata: { comicvine, comicInfo, locg },
- inferredMetadata,
- acquisition: {
- source: { name },
- },
- },
- idx,
- ) => {
- const { issueName, url } = determineCoverFile({
- rawFileDetails,
- comicvine,
- comicInfo,
- locg,
- });
- const { issue, coverURL, icon } = determineExternalMetadata(
- name,
- {
- comicvine,
- comicInfo,
- locg,
- },
- );
- const isComicVineMetadataAvailable =
- !isUndefined(comicvine) &&
- !isUndefined(comicvine.volumeInformation);
+
Dashboard
+
- return (
-
-
-
- {/* Issue number */}
-
-
-
-
-
- {inferredMetadata.issue.number}
-
-
- {/* File extension */}
-
-
-
-
-
-
- {rawFileDetails.extension}
-
-
- {/* Uncompressed status */}
- {rawFileDetails?.archive?.uncompressed ? (
-
-
-
-
-
- ) : null}
-
-
-
-
-
- {/* ComicInfo.xml presence */}
- {!isNil(comicInfo) && !isEmpty(comicInfo) && (
-
-
-
- )}
- {/* ComicVine metadata presence */}
- {isComicVineMetadataAvailable && (
-
-
-
- )}
-
- {/* Raw file presence */}
- {isNil(rawFileDetails) && (
-
-
-
- )}
-
-
- );
- },
- )}
-
-
+ {recentComics &&
}
{/* Wanted comics */}
{/* Volume groups */}
diff --git a/src/client/components/Dashboard/PullList.tsx b/src/client/components/Dashboard/PullList.tsx
index 4cc872d..c43d6ac 100644
--- a/src/client/components/Dashboard/PullList.tsx
+++ b/src/client/components/Dashboard/PullList.tsx
@@ -2,35 +2,64 @@ import { isNil, map } from "lodash";
import React, { createRef, ReactElement, useCallback, useEffect } from "react";
import Card from "../shared/Carda";
import Header from "../shared/Header";
-import { useDispatch, useSelector } from "react-redux";
-import { getWeeklyPullList } from "../../actions/comicinfo.actions";
import { importToDB } from "../../actions/fileops.actions";
import ellipsize from "ellipsize";
-import Slider from "react-slick";
-import "slick-carousel/slick/slick.css";
-import "slick-carousel/slick/slick-theme.css";
import { Link } from "react-router-dom";
+import axios from "axios";
+import rateLimiter from "axios-rate-limit";
+import { setupCache } from "axios-cache-interceptor";
+import { useQuery } from "@tanstack/react-query";
+import "keen-slider/keen-slider.min.css";
+import { useKeenSlider } from "keen-slider/react";
+import { COMICVINE_SERVICE_URI } from "../../constants/endpoints";
type PullListProps = {
issues: any;
};
-export const PullList = ({ issues }: PullListProps): ReactElement => {
- const dispatch = useDispatch();
- useEffect(() => {
- dispatch(
- getWeeklyPullList({
- startDate: "2023-9-9",
- pageSize: "15",
- currentPage: "1",
- }),
- );
- }, []);
- const addToLibrary = useCallback(
- (sourceName: string, locgMetadata) =>
- dispatch(importToDB(sourceName, { locg: locgMetadata })),
- [],
+const http = rateLimiter(axios.create(), {
+ maxRequests: 1,
+ perMilliseconds: 1000,
+ maxRPS: 1,
+});
+const cachedAxios = setupCache(axios);
+export const PullList = (): ReactElement => {
+ // blaze slider
+ const [sliderRef, instanceRef] = useKeenSlider(
+ {
+ loop: true,
+ slides: {
+ origin: "auto",
+ number: 15,
+ perView: 5,
+ spacing: 15,
+ },
+
+ slideChanged() {
+ console.log("slide changed");
+ },
+ },
+ [
+ // add plugins here
+ ],
);
+
+ const {
+ data: pullList,
+ isSuccess,
+ isLoading,
+ } = useQuery({
+ queryFn: async () =>
+ await cachedAxios(`${COMICVINE_SERVICE_URI}/getWeeklyPullList`, {
+ method: "get",
+ params: { startDate: "2023-9-9", pageSize: "15", currentPage: "1" },
+ }),
+ queryKey: ["pullList"],
+ });
+ console.log(pullList?.data.result);
+ const addToLibrary = (sourceName: string, locgMetadata) =>
+ importToDB(sourceName, { locg: locgMetadata });
+
/*
const foo = {
coverFile: {}, // pointer to which cover file to use
@@ -43,47 +72,13 @@ export const PullList = ({ issues }: PullListProps): ReactElement => {
};
*/
- const pullList = useSelector((state: RootState) => state.comicInfo.pullList);
- let sliderRef = createRef();
- const settings = {
- dots: false,
- infinite: false,
- speed: 500,
- slidesToShow: 5,
- slidesToScroll: 5,
- initialSlide: 0,
- responsive: [
- {
- breakpoint: 1024,
- settings: {
- slidesToShow: 3,
- slidesToScroll: 3,
- infinite: false,
- },
- },
- {
- breakpoint: 600,
- settings: {
- slidesToShow: 2,
- slidesToScroll: 2,
- initialSlide: 0,
- },
- },
- {
- breakpoint: 480,
- settings: {
- slidesToShow: 1,
- slidesToScroll: 1,
- },
- },
- ],
- };
+ // const pullList = useSelector((state: RootState) => state.comicInfo.pullList);
const next = () => {
- sliderRef.slickNext();
+ // sliderRef.slickNext();
};
const previous = () => {
- sliderRef.slickPrev();
+ // sliderRef.slickPrev();
};
return (
<>
@@ -109,53 +104,35 @@ export const PullList = ({ issues }: PullListProps): ReactElement => {
-