From 0872aa4d8ac985d89be30f1b0910907c0dc57b73 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Wed, 20 Dec 2023 00:08:16 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=EF=B8=8F=20Cleaned=20the=20table?= =?UTF-8?q?=20further?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/components/Library/Library.tsx | 48 +++++++++----- src/client/components/Library/SearchBar.tsx | 66 ++++++++++--------- .../components/shared/MetadataPanel.tsx | 2 +- src/client/components/shared/T2Table.tsx | 59 +++++++---------- 4 files changed, 93 insertions(+), 82 deletions(-) diff --git a/src/client/components/Library/Library.tsx b/src/client/components/Library/Library.tsx index e572978..145b19a 100644 --- a/src/client/components/Library/Library.tsx +++ b/src/client/components/Library/Library.tsx @@ -7,6 +7,7 @@ import T2Table from "../shared/T2Table"; import ellipsize from "ellipsize"; import { useQuery, keepPreviousData } from "@tanstack/react-query"; import axios from "axios"; +import { format, fromUnixTime, parseISO } from "date-fns"; /** * Component that tabulates the contents of the user's ThreeTwo Library. @@ -53,7 +54,7 @@ export const Library = (): ReactElement => { const ComicInfoXML = (value) => { return value.data ? ( -
+
{/* Series Name */} @@ -113,9 +114,7 @@ export const Library = (): ReactElement => { cell: (info) => !isEmpty(info.getValue()) ? ( - ) : ( -
No comicinfo.xml
- ), + ) : null, }, ], }, @@ -123,24 +122,41 @@ export const Library = (): ReactElement => { header: "Additional Metadata", columns: [ { - header: "Publisher", - accessorKey: "_source.sourcedMetadata.comicvine.volumeInformation", + header: "Date of Import", + accessorKey: "_source.createdAt", cell: (info) => { return !isNil(info.getValue()) ? ( -
{info.getValue().publisher.name}
+
+

{format(parseISO(info.getValue()), "dd MMMM, yyyy")}

+ {format(parseISO(info.getValue()), "h aaaa")} +
) : null; }, }, { - header: "Something", - accessorKey: "_source.acquisition.source.wanted", - cell: (info) => { - !isUndefined(info.getValue()) ? ( - - ) : ( - "Nothing" - ); - }, + header: "Downloads", + accessorKey: "_source.acquisition", + cell: (info) => ( +
+ + + + + + DC++: {info.getValue().directconnect.downloads.length} + + + + + + + + + Torrent: {info.getValue().torrent.downloads.length} + + +
+ ), }, ], }, diff --git a/src/client/components/Library/SearchBar.tsx b/src/client/components/Library/SearchBar.tsx index 2e3d774..268a025 100644 --- a/src/client/components/Library/SearchBar.tsx +++ b/src/client/components/Library/SearchBar.tsx @@ -25,36 +25,42 @@ export const SearchBar = (): ReactElement => { // ); }, []); return ( -
-
( - -
-
- - {({ input, meta }) => { - return ( - - ); - }} - -
-
- -
-
-
- )} - /> -
+
( + + + {({ input, meta }) => { + return ( +
+
+
+ +
+ + +
+ + +
+ ); + }} +
+ + )} + /> ); }; diff --git a/src/client/components/shared/MetadataPanel.tsx b/src/client/components/shared/MetadataPanel.tsx index 7de27e9..ed908c8 100644 --- a/src/client/components/shared/MetadataPanel.tsx +++ b/src/client/components/shared/MetadataPanel.tsx @@ -31,7 +31,7 @@ export const MetadataPanel = (props: IMetadatPanelProps): ReactElement => { { name: "rawFileDetails", content: () => ( -
+

{issueName}

diff --git a/src/client/components/shared/T2Table.tsx b/src/client/components/shared/T2Table.tsx index 420bc50..00a018e 100644 --- a/src/client/components/shared/T2Table.tsx +++ b/src/client/components/shared/T2Table.tsx @@ -73,43 +73,32 @@ export const T2Table = (tableOptions): ReactElement => { <>
{/* Search bar */} -
+
-
- {/* pagination controls */} - +