From 0d0fd948b58ba9505db2c1d59360b5dd22db32d3 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Tue, 5 Apr 2022 01:18:03 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Some=20UI=20flourishes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/assets/scss/App.scss | 8 +++--- src/client/components/Library/Library.tsx | 27 +++++++++---------- .../components/Library/LibraryContainer.tsx | 2 -- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/client/assets/scss/App.scss b/src/client/assets/scss/App.scss index 48f39f6..ec3ef14 100644 --- a/src/client/assets/scss/App.scss +++ b/src/client/assets/scss/App.scss @@ -141,13 +141,15 @@ pre { .generic-card { display: inline-block; background-color: #fff; - border-bottom-left-radius: 0.3rem; - border-bottom-right-radius: 0.3rem; + border-top-left-radius: 0.4rem; + border-top-right-radius: 0.4rem; + border-bottom-left-radius: 0.4rem; + border-bottom-right-radius: 0.4rem; box-shadow: 1px 8px 23px 7px rgba(0, 0, 0, 0.12); .green-border { border: 1px dotted #168b64; - border-radius: 0.3rem; + border-radius: 0.4rem; } .truncate { diff --git a/src/client/components/Library/Library.tsx b/src/client/components/Library/Library.tsx index 1eabe1d..f7e37c7 100644 --- a/src/client/components/Library/Library.tsx +++ b/src/client/components/Library/Library.tsx @@ -8,7 +8,7 @@ import React, { import PropTypes from "prop-types"; import { useNavigate } from "react-router-dom"; import T2Table from "../shared/T2Table"; -import { isEmpty, isNil, isUndefined } from "lodash"; +import { isEmpty, isNil, isNull, isUndefined } from "lodash"; import RawFileDetails from "./RawFileDetails"; import ComicVineDetails from "./ComicVineDetails"; import SearchBar from "./SearchBar"; @@ -25,14 +25,13 @@ interface IComicBookLibraryProps { export const Library = (data: IComicBookLibraryProps): ReactElement => { const { searchResults } = data.data; - console.log(searchResults); // programatically navigate to comic detail const navigate = useNavigate(); const navigateToComicDetail = (row) => { navigate(`/comic/details/${row.original._id}`); }; - const ImportStatus = ({ value }) => { + const ImportStatus = (value) => { return value ? (
@@ -67,18 +66,13 @@ export const Library = (data: IComicBookLibraryProps): ReactElement => {
- ) : ( - No ComicInfo.xml - ); + ) : null; }; const WantedStatus = ({ value }) => { - console.log(value); return !value ? Wanted : null; }; - console.log(searchResults); - // return null; const columns = useMemo( () => [ { @@ -97,7 +91,7 @@ export const Library = (data: IComicBookLibraryProps): ReactElement => { : row._source.sourcedMetadata, Cell: ({ value }) => { // If no CV info available, use raw file metadata - if (!isNil(value.rawFileDetails.cover)) { + if (!isUndefined(value.rawFileDetails)) { return ; } // If CV metadata available, show it @@ -112,7 +106,12 @@ export const Library = (data: IComicBookLibraryProps): ReactElement => { accessor: "_source.sourcedMetadata.comicInfo", minWidth: 300, align: "right", - Cell: ImportStatus, + Cell: ({ value }) => + !isEmpty(value) ? ( + + ) : ( + No ComicInfo.xml + ), }, ], }, @@ -142,9 +141,9 @@ export const Library = (data: IComicBookLibraryProps): ReactElement => { [], ); - ImportStatus.propTypes = { - value: PropTypes.bool.isRequired, - }; + // ImportStatus.propTypes = { + // value: PropTypes.bool.isRequired, + // }; const dispatch = useDispatch(); const goToNextPage = useCallback((pageIndex, pageSize) => { diff --git a/src/client/components/Library/LibraryContainer.tsx b/src/client/components/Library/LibraryContainer.tsx index dd41de2..329f1b2 100644 --- a/src/client/components/Library/LibraryContainer.tsx +++ b/src/client/components/Library/LibraryContainer.tsx @@ -29,8 +29,6 @@ const LibraryContainer = () => { (state: RootState) => state.fileOps.librarySearchError, ); - console.log(searchError); - return !isEmpty(searchResults) ? ( ) : (