From 81bdaefdd1bda9d93a825407f782b695fa3b35dc Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Wed, 6 Apr 2022 11:00:16 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=8B=20UI=20improvements=20in=20the=20L?= =?UTF-8?q?ibrary=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/assets/scss/App.scss | 4 +- src/client/components/Dashboard/Dashboard.tsx | 21 +++++++--- .../components/Dashboard/WantedComicsList.tsx | 2 +- .../components/Library/ComicVineDetails.tsx | 2 +- src/client/components/Library/Library.tsx | 3 +- .../components/Library/LibraryContainer.tsx | 1 + src/client/components/Library/SearchBar.tsx | 40 ++++++++++--------- .../components/WantedComics/WantedComics.tsx | 25 ++++++++++++ src/client/components/shared/T2Table.tsx | 16 ++++++-- 9 files changed, 82 insertions(+), 32 deletions(-) diff --git a/src/client/assets/scss/App.scss b/src/client/assets/scss/App.scss index ec3ef14..4e3e039 100644 --- a/src/client/assets/scss/App.scss +++ b/src/client/assets/scss/App.scss @@ -325,10 +325,10 @@ pre { width: 100%; thead { position: sticky; - top: 194px; + top: 146px; z-index: 1; background: #fffffc; - min-height: 120px; + min-height: 130px; } tr { td { diff --git a/src/client/components/Dashboard/Dashboard.tsx b/src/client/components/Dashboard/Dashboard.tsx index da90cf7..bd717db 100644 --- a/src/client/components/Dashboard/Dashboard.tsx +++ b/src/client/components/Dashboard/Dashboard.tsx @@ -65,11 +65,22 @@ export const Dashboard = (): ReactElement => { {/* Pull List */} - {/* stats */} - - - - + {/* Stats */} + {!isEmpty(libraryStatistics) && ( + + )} + {/* Wanted comics */} + {!isEmpty(wantedComics) && ( + + )} + {/* Recent imports */} + {!isEmpty(recentComics) && ( + + )} + {/* Volumes */} + {!isEmpty(volumeGroups) && ( + + )} ) : ( Wanted Comics - +

diff --git a/src/client/components/Library/ComicVineDetails.tsx b/src/client/components/Library/ComicVineDetails.tsx index 868a43e..3f40496 100644 --- a/src/client/components/Library/ComicVineDetails.tsx +++ b/src/client/components/Library/ComicVineDetails.tsx @@ -16,7 +16,7 @@ export const ComicVineDetails = (comicVineData): ReactElement => {

{ { Header: "File Details", id: "fileDetails", - minWidth: 450, + minWidth: 400, accessor: (row) => !isEmpty(row._source.rawFileDetails) ? { @@ -104,7 +104,6 @@ export const Library = (data: IComicBookLibraryProps): ReactElement => { { Header: "ComicInfo.xml", accessor: "_source.sourcedMetadata.comicInfo", - minWidth: 300, align: "right", Cell: ({ value }) => !isEmpty(value) ? ( diff --git a/src/client/components/Library/LibraryContainer.tsx b/src/client/components/Library/LibraryContainer.tsx index 329f1b2..f85ec1d 100644 --- a/src/client/components/Library/LibraryContainer.tsx +++ b/src/client/components/Library/LibraryContainer.tsx @@ -17,6 +17,7 @@ const LibraryContainer = () => { size: 25, from: 0, }, + type: "all", }, ), ); diff --git a/src/client/components/Library/SearchBar.tsx b/src/client/components/Library/SearchBar.tsx index f2695b0..36d39fe 100644 --- a/src/client/components/Library/SearchBar.tsx +++ b/src/client/components/Library/SearchBar.tsx @@ -21,6 +21,7 @@ export const SearchBar = (): ReactElement => { size: 25, from: 0, }, + type: "volumeName", }, ), ); @@ -32,27 +33,30 @@ export const SearchBar = (): ReactElement => { initialValues={{}} render={({ handleSubmit, form, submitting, pristine, values }) => (
-
- - - {({ input, meta }) => { - return ( - - ); - }} - - +
+
+ + {({ input, meta }) => { + return ( + + ); + }} + +
+
+ +
)} /> -
+ {/*

-
+
*/}
); }; diff --git a/src/client/components/WantedComics/WantedComics.tsx b/src/client/components/WantedComics/WantedComics.tsx index e69de29..6fd0a6d 100644 --- a/src/client/components/WantedComics/WantedComics.tsx +++ b/src/client/components/WantedComics/WantedComics.tsx @@ -0,0 +1,25 @@ +import React, { ReactElement, useEffect } from "react"; +import { useDispatch } from "react-redux"; +import { searchIssue } from "../../actions/fileops.actions"; + +export const WantedComics = (props): ReactElement => { + const dispatch = useDispatch(); + useEffect(() => { + dispatch( + searchIssue( + { + query: {}, + }, + { + pagination: { + size: 25, + from: 0, + }, + }, + ), + ); + }, []); + return <>Ads; +}; + +export default WantedComics; diff --git a/src/client/components/shared/T2Table.tsx b/src/client/components/shared/T2Table.tsx index 9e1329c..ad8087f 100644 --- a/src/client/components/shared/T2Table.tsx +++ b/src/client/components/shared/T2Table.tsx @@ -36,7 +36,7 @@ export const T2Table = (tableOptions): ReactElement => { pageCount: totalPages, }, usePagination, - useFlexLayout, + // useFlexLayout, ); return ( <> @@ -45,7 +45,12 @@ export const T2Table = (tableOptions): ReactElement => { {headerGroups.map((headerGroup, idx) => ( {headerGroup.headers.map((column, idx) => ( - + {column.render("Header")} ))} @@ -66,7 +71,12 @@ export const T2Table = (tableOptions): ReactElement => { return ( {cell.render("Cell")}