🔧 Stats UI cleanup
This commit is contained in:
@@ -42,15 +42,7 @@ pre {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Dashboard
|
// Dashboard
|
||||||
// Comic Detail
|
|
||||||
.stats-palette {
|
|
||||||
background-color: ghostwhite;
|
|
||||||
display: inline-block;
|
|
||||||
p {
|
|
||||||
display: flex;
|
|
||||||
// padding: 1.5rem 2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// slick slider overrides
|
// slick slider overrides
|
||||||
.slick-slider {
|
.slick-slider {
|
||||||
margin-left: -10px;
|
margin-left: -10px;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { VolumeGroups } from "./VolumeGroups";
|
|||||||
import { PullList } from "./PullList";
|
import { PullList } from "./PullList";
|
||||||
import { getComicBooks } from "../../actions/fileops.actions";
|
import { getComicBooks } from "../../actions/fileops.actions";
|
||||||
import { getLibraryStatistics } from "../../actions/comicinfo.actions";
|
import { getLibraryStatistics } from "../../actions/comicinfo.actions";
|
||||||
import { isEmpty, isNil, isUndefined } from "lodash";
|
import { isEmpty, isNil, isUndefined, map } from "lodash";
|
||||||
|
|
||||||
export const Dashboard = (): ReactElement => {
|
export const Dashboard = (): ReactElement => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@@ -43,10 +43,11 @@ export const Dashboard = (): ReactElement => {
|
|||||||
<PullList issues={recentComics} />
|
<PullList issues={recentComics} />
|
||||||
|
|
||||||
{/* stats */}
|
{/* stats */}
|
||||||
<div>
|
|
||||||
<h4 className="title is-4">Statistics</h4>
|
<h4 className="title is-4 mt-2">Statistics</h4>
|
||||||
<div className="box stats-palette p-3 column is-one-quarter">
|
<div className="columns is-multiline">
|
||||||
<dl>
|
<div className="column is-narrow is-one-quarter">
|
||||||
|
<dl className="box">
|
||||||
<dd className="is-size-4">
|
<dd className="is-size-4">
|
||||||
<span className="has-text-weight-bold">
|
<span className="has-text-weight-bold">
|
||||||
{libraryStatistics.totalDocuments}
|
{libraryStatistics.totalDocuments}
|
||||||
@@ -69,20 +70,40 @@ export const Dashboard = (): ReactElement => {
|
|||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="box stats-palette p-3 column ml-5">
|
<div className="p-3 column is-one-quarter">
|
||||||
<dl>
|
<dl className="box">
|
||||||
<dd className="is-size-6">
|
<dd className="is-size-6">
|
||||||
<span className="has-text-weight-bold"></span> Issues
|
<span className="has-text-weight-bold"></span> Issues
|
||||||
</dd>
|
</dd>
|
||||||
<dd className="is-size-6">
|
<dd className="is-size-6">
|
||||||
<span className="has-text-weight-bold">304</span> Volumes
|
<span className="has-text-weight-bold">304</span> Volumes
|
||||||
</dd>
|
</dd>
|
||||||
|
<dd className="is-size-6">
|
||||||
|
{!isUndefined(libraryStatistics.statistics) &&
|
||||||
|
!isEmpty(libraryStatistics.statistics[0].fileTypes) &&
|
||||||
|
map(
|
||||||
|
libraryStatistics.statistics[0].fileTypes,
|
||||||
|
(fileType) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<span className="has-text-weight-bold">
|
||||||
|
{fileType.data.length}
|
||||||
|
</span>
|
||||||
|
<span className="tag is-warning has-text-weight-bold mr-2 ml-1">
|
||||||
|
{fileType._id}
|
||||||
|
</span>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)}
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* file types */}
|
{/* file types */}
|
||||||
<div className="box stats-palette p-3 column ml-5">
|
<div className="p-3 column is-two-fifths">
|
||||||
<dl>
|
{/* publisher with most issues */}
|
||||||
|
<dl className="box">
|
||||||
{!isUndefined(libraryStatistics.statistics) &&
|
{!isUndefined(libraryStatistics.statistics) &&
|
||||||
!isEmpty(
|
!isEmpty(
|
||||||
libraryStatistics.statistics[0]
|
libraryStatistics.statistics[0]
|
||||||
|
|||||||
@@ -99,9 +99,10 @@ export const PullList = ({ issues }: PullListProps): ReactElement => {
|
|||||||
<Slider {...settings} ref={(c) => (sliderRef = c)}>
|
<Slider {...settings} ref={(c) => (sliderRef = c)}>
|
||||||
{!isNil(pullList) &&
|
{!isNil(pullList) &&
|
||||||
pullList &&
|
pullList &&
|
||||||
map(pullList, (issue) => {
|
map(pullList, (issue, idx) => {
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
|
key={idx}
|
||||||
orientation={"vertical"}
|
orientation={"vertical"}
|
||||||
imageUrl={issue.cover}
|
imageUrl={issue.cover}
|
||||||
hasDetails
|
hasDetails
|
||||||
|
|||||||
Reference in New Issue
Block a user