📝 Adding elements to Comic Detail page

This commit is contained in:
2021-06-12 11:32:18 -07:00
parent 2b3fcbfeb5
commit 7ea962952a
4 changed files with 48 additions and 13 deletions

View File

@@ -1,5 +1,6 @@
import * as React from "react";
import { IExtractedComicBookCoverFile } from "../../server/interfaces/folder.interface";
import { removeLeadingPeriod } from "../shared/utils/formatting.utils";
import { isUndefined, isEmpty } from "lodash";
import { Link } from "react-router-dom";
@@ -14,14 +15,7 @@ class Card extends React.Component<IProps, IState> {
super(props);
console.log(props);
}
private removeLeadingPeriod = (input: string): string => {
if (!isUndefined(this.props.comicBookCoversMetadata)) {
if (input.charAt(0) == ".") {
input = input.substr(1);
}
}
return input;
};
public drawCoverCard = (
metadata: IExtractedComicBookCoverFile,
): JSX.Element => {
@@ -34,7 +28,7 @@ class Card extends React.Component<IProps, IState> {
<img
src={
"http://localhost:3000" +
this.removeLeadingPeriod(metadata.path) +
removeLeadingPeriod(metadata.path) +
"/" +
metadata.name
}