📑 Added comic detail page and routes

This commit is contained in:
2021-06-11 10:27:13 -07:00
parent 62b55a4bd8
commit 2b3fcbfeb5
5 changed files with 26 additions and 6 deletions

View File

@@ -1,15 +1,18 @@
import * as React from "react";
import { IExtractedComicBookCoverFile } from "../../server/interfaces/folder.interface";
import { map, isUndefined, isEmpty } from "lodash";
import { isUndefined, isEmpty } from "lodash";
import { Link } from "react-router-dom";
interface IProps {
comicBookCoversMetadata: IExtractedComicBookCoverFile;
mongoObjId?: number;
}
interface IState {}
class Card extends React.Component<IProps, IState> {
constructor(props: IProps) {
super(props);
console.log(props);
}
private removeLeadingPeriod = (input: string): string => {
if (!isUndefined(this.props.comicBookCoversMetadata)) {
@@ -41,7 +44,9 @@ class Card extends React.Component<IProps, IState> {
</div>
<div className="card-content">
<ul>
<li className="has-text-weight-semibold">{metadata.name}</li>
<Link to={"/comic/details/" + this.props.mongoObjId}>
<li className="has-text-weight-semibold">{metadata.name}</li>
</Link>
</ul>
</div>
</div>
@@ -51,7 +56,6 @@ class Card extends React.Component<IProps, IState> {
};
public render() {
console.log(this.props.comicBookCoversMetadata);
return (
<>
{!isUndefined(this.props.comicBookCoversMetadata) &&