From 4080572c44bedff3b8df88182f85ffb7b732cb98 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Tue, 10 Aug 2021 08:22:18 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8E=20Search=20page=20scaffold?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/assets/scss/App.scss | 25 +++++--- src/client/components/App.tsx | 4 ++ src/client/components/ComicDetail.tsx | 92 +++++++++++++++------------ src/client/components/Library.tsx | 25 +++++--- src/client/components/Navbar.tsx | 2 +- src/client/components/Search.tsx | 47 ++++++++++++++ 6 files changed, 138 insertions(+), 57 deletions(-) create mode 100644 src/client/components/Search.tsx diff --git a/src/client/assets/scss/App.scss b/src/client/assets/scss/App.scss index de26139..ae18d8b 100644 --- a/src/client/assets/scss/App.scss +++ b/src/client/assets/scss/App.scss @@ -60,13 +60,12 @@ $border-color: red; // max-width: 500px; margin: 0 0 15px 0; .card-image { - img { - border-top-left-radius: 0.3rem; - border-top-right-radius: 0.3rem; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - } - + img { + border-top-left-radius: 0.3rem; + border-top-right-radius: 0.3rem; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } } .is-horizontal { @@ -124,7 +123,17 @@ $border-color: red; } } } - +// Search +.search { + .main-search-bar { + border: 0; + border-bottom: 1px solid #999; + border-radius: 0; + outline: 0; + background: transparent; + box-shadow: none; + } +} // Library .library { table { diff --git a/src/client/components/App.tsx b/src/client/components/App.tsx index cb622b3..d0cb513 100644 --- a/src/client/components/App.tsx +++ b/src/client/components/App.tsx @@ -5,6 +5,7 @@ import Dashboard from "./Dashboard"; import Import from "./Import"; import { ComicDetail } from "./ComicDetail"; import Library from "./Library"; +import Search from "./Search"; import { Switch, Route } from "react-router"; import Navbar from "./Navbar"; @@ -25,6 +26,9 @@ class App extends React.Component { + + + { }; const [active, setActive] = useState(0); - + const createDescriptionMarkup = (html) => { + return { __html: html }; + }; + // Tab groups for ComicVine metadata const tabGroup = [ { id: 0, name: "Volume Information", content: !isNil(comicBookDetailData.sourcedMetadata) && ( -
-
-
- -
-
-
-
-
- Is a part of{" "} - + <> +
+
+
+ +
+
+
+
+
+ Is a part of{" "} + + { + comicBookDetailData.sourcedMetadata.comicvine + .volumeInformation.name + } + +
+
+ Published by + + {" "} + { + comicBookDetailData.sourcedMetadata.comicvine + .volumeInformation.publisher.name + } + +
+
+ Total issues in this volume:{" "} { comicBookDetailData.sourcedMetadata.comicvine - .volumeInformation.name + .volumeInformation.count_of_issues } - -
-
- Published by - - {" "} - { - comicBookDetailData.sourcedMetadata.comicvine - .volumeInformation.publisher.name - } - -
-
- Total issues in this volume:{" "} - { - comicBookDetailData.sourcedMetadata.comicvine - .volumeInformation.count_of_issues - } -
-
+ + +
- +
+
+
+ ), }, { diff --git a/src/client/components/Library.tsx b/src/client/components/Library.tsx index 27f0a4c..cb4eb96 100644 --- a/src/client/components/Library.tsx +++ b/src/client/components/Library.tsx @@ -1,10 +1,4 @@ -import React, { - useState, - useEffect, - useCallback, - useMemo, - ReactElement, -} from "react"; +import React, { useState, useEffect, useMemo, ReactElement } from "react"; import { removeLeadingPeriod, escapePoundSymbol, @@ -12,14 +6,27 @@ import { import { useTable } from "react-table"; import prettyBytes from "pretty-bytes"; import ellipsize from "ellipsize"; - import { useDispatch, useSelector } from "react-redux"; +import { getComicBooks } from "../actions/fileops.actions"; interface IComicBookLibraryProps { - matches: unknown; + matches?: unknown; } export const Library = ({}: IComicBookLibraryProps): ReactElement => { + const [page, setPage] = useState(1); + const dispatch = useDispatch(); + useEffect(() => { + dispatch( + getComicBooks({ + paginationOptions: { + page: 0, + limit: 15, + }, + }), + ); + }, [page, dispatch]); + const data = useSelector( (state: RootState) => state.fileOps.recentComics.docs, ); diff --git a/src/client/components/Navbar.tsx b/src/client/components/Navbar.tsx index ff9a941..765fb5a 100644 --- a/src/client/components/Navbar.tsx +++ b/src/client/components/Navbar.tsx @@ -50,7 +50,7 @@ const Navbar: React.FunctionComponent = (props) => { Library - + Search
diff --git a/src/client/components/Search.tsx b/src/client/components/Search.tsx new file mode 100644 index 0000000..ad7cb5b --- /dev/null +++ b/src/client/components/Search.tsx @@ -0,0 +1,47 @@ +import React, { useMemo, ReactElement } from "react"; +import { + removeLeadingPeriod, + escapePoundSymbol, +} from "../shared/utils/formatting.utils"; +import { useTable } from "react-table"; +import prettyBytes from "pretty-bytes"; +import ellipsize from "ellipsize"; + +import { useSelector } from "react-redux"; + +interface ISearchProps {} + +export const Search = ({}: ISearchProps): ReactElement => { + return ( + <> +
+
+
+
+

Search

+ +
+
+
+
+

+ + Search the ComicVine database + + Search and add issues, series and trade paperbacks to your + library. Then, download them using the configured AirDC++ or + torrent clients. +

+
+
+
+
+ + ); +}; + +export default Search;