📚 Volume groups component

This commit is contained in:
2021-09-21 17:15:58 -07:00
parent a7afc358d8
commit 048c7ba6d5
4 changed files with 63 additions and 53 deletions

View File

@@ -26,6 +26,27 @@ $border-color: red;
} }
} }
// Dashboard
.paper {
background: #fff;
width: 200px;
border-radius: 0.3rem;
box-shadow:
/* The top layer shadow */
0 -1px 1px rgba(0,0,0,0.15),
/* The second layer */
0 -10px 0 -5px #eee,
/* The second layer shadow */
0 -10px 1px -4px rgba(0,0,0,0.15),
/* The third layer */
0 -20px 0 -10px #eee,
/* The third layer shadow */
0 -20px 1px -9px rgba(0,0,0,0.15);
/* Padding for demo purposes */
padding: 30px;
}
.min { .min {
overflow: visible; overflow: visible;
margin: auto; margin: auto;
@@ -291,7 +312,6 @@ $border-color: red;
background-clip: padding-box; background-clip: padding-box;
} }
/* Style your items */
.my-masonry-grid_column > div { /* change div to reference your elements you put in <Masonry> */ .my-masonry-grid_column > div { /* change div to reference your elements you put in <Masonry> */
margin-bottom: 20px; margin-bottom: 20px;
} }

View File

@@ -1,33 +1,38 @@
import * as React from "react"; import React, { ReactElement, useEffect } from "react";
import { connect } from "react-redux"; import { useDispatch, useSelector } from "react-redux";
import ZeroState from "./ZeroState"; import ZeroState from "./ZeroState";
import { RecentlyImported } from "./RecentlyImported"; import { RecentlyImported } from "./RecentlyImported";
import { getComicBooks } from "../actions/fileops.actions"; import { getComicBooks } from "../actions/fileops.actions";
import { isEmpty } from "lodash"; import { isEmpty } from "lodash";
interface IProps { export const Dashboard = (): ReactElement => {
getRecentComics: Function; const dispatch = useDispatch();
recentComics: any; useEffect(() => {
} dispatch(
interface IState { getComicBooks({
fileOps: any; paginationOptions: {
} page: 0,
limit: 5,
class Dashboard extends React.Component<IProps, IState> { sort: { updatedAt: "-1" },
componentDidMount() { },
this.props.getRecentComics(); }),
} );
public render() { }, [dispatch]);
const recentComics = useSelector(
(state: RootState) => state.fileOps.recentComics,
);
return ( return (
<div className="container"> <div className="container">
<section className="section"> <section className="section">
<h1 className="title">Dashboard</h1> <h1 className="title">Dashboard</h1>
{!isEmpty(this.props.recentComics) && {!isEmpty(recentComics) && !isEmpty(recentComics.docs) ? (
!isEmpty(this.props.recentComics.docs) ? (
<> <>
<h2 className="subtitle">Recently Imported</h2> <h2 className="subtitle">Recently Imported</h2>
<RecentlyImported comicBookCovers={this.props.recentComics} /> <RecentlyImported comicBookCovers={recentComics} />
<section>
<div className="paper">asdas</div>
</section>
</> </>
) : ( ) : (
<ZeroState <ZeroState
@@ -40,27 +45,6 @@ class Dashboard extends React.Component<IProps, IState> {
</section> </section>
</div> </div>
); );
} };
}
function mapStateToProps(state: IState) { export default Dashboard;
return {
recentComics: state.fileOps.recentComics,
};
}
const mapDispatchToProps = (dispatch) => ({
getRecentComics() {
dispatch(
getComicBooks({
paginationOptions: {
page: 0,
limit: 5,
sort: { updatedAt: "-1" },
},
}),
);
},
});
export default connect(mapStateToProps, mapDispatchToProps)(Dashboard);

View File

@@ -60,7 +60,6 @@ export const LibraryGrid = (libraryGridProps: ILibraryGridProps) => {
{ellipsize(comicName, 18)} {ellipsize(comicName, 18)}
</Link> </Link>
); );
console.log(name);
return ( return (
<Card <Card
key={_id} key={_id}

View File

@@ -0,0 +1,7 @@
import React, { ReactElement } from "react";
export const VolumeGroups = (): ReactElement => {
return <div className="paper"></div>;
};
export default VolumeGroups;