From fe1b55a35d6a529d4e22701602664392f09e38a4 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Wed, 16 Feb 2022 09:34:43 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Stats=20UI=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/assets/scss/App.scss | 10 +---- src/client/components/Dashboard/Dashboard.tsx | 39 ++++++++++++++----- src/client/components/Dashboard/PullList.tsx | 3 +- 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/src/client/assets/scss/App.scss b/src/client/assets/scss/App.scss index 0e61f2f..e360039 100644 --- a/src/client/assets/scss/App.scss +++ b/src/client/assets/scss/App.scss @@ -42,15 +42,7 @@ pre { } // Dashboard -// Comic Detail -.stats-palette { - background-color: ghostwhite; - display: inline-block; - p { - display: flex; - // padding: 1.5rem 2rem; - } -} + // slick slider overrides .slick-slider { margin-left: -10px; diff --git a/src/client/components/Dashboard/Dashboard.tsx b/src/client/components/Dashboard/Dashboard.tsx index d6a8244..f0c6105 100644 --- a/src/client/components/Dashboard/Dashboard.tsx +++ b/src/client/components/Dashboard/Dashboard.tsx @@ -6,7 +6,7 @@ import { VolumeGroups } from "./VolumeGroups"; import { PullList } from "./PullList"; import { getComicBooks } from "../../actions/fileops.actions"; import { getLibraryStatistics } from "../../actions/comicinfo.actions"; -import { isEmpty, isNil, isUndefined } from "lodash"; +import { isEmpty, isNil, isUndefined, map } from "lodash"; export const Dashboard = (): ReactElement => { const dispatch = useDispatch(); @@ -43,10 +43,11 @@ export const Dashboard = (): ReactElement => { {/* stats */} -
-

Statistics

-
-
+ +

Statistics

+
+
+
{libraryStatistics.totalDocuments} @@ -69,20 +70,40 @@ export const Dashboard = (): ReactElement => {
-
-
+
+
Issues
304 Volumes
+
+ {!isUndefined(libraryStatistics.statistics) && + !isEmpty(libraryStatistics.statistics[0].fileTypes) && + map( + libraryStatistics.statistics[0].fileTypes, + (fileType) => { + return ( + <> + + {fileType.data.length} + + + {fileType._id} + + + ); + }, + )} +
{/* file types */} -
-
+
+ {/* publisher with most issues */} +
{!isUndefined(libraryStatistics.statistics) && !isEmpty( libraryStatistics.statistics[0] diff --git a/src/client/components/Dashboard/PullList.tsx b/src/client/components/Dashboard/PullList.tsx index 5fd9baf..17f8cf8 100644 --- a/src/client/components/Dashboard/PullList.tsx +++ b/src/client/components/Dashboard/PullList.tsx @@ -99,9 +99,10 @@ export const PullList = ({ issues }: PullListProps): ReactElement => { (sliderRef = c)}> {!isNil(pullList) && pullList && - map(pullList, (issue) => { + map(pullList, (issue, idx) => { return (