From 49759929af6833d4e661a93678ad8b6b8d99ebef Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Sat, 7 Aug 2021 01:14:10 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=86=20Added=20timestamp=20for=20last?= =?UTF-8?q?=20CV=20scrape=20application?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/client/components/ComicDetail.tsx | 23 ++++++++++++++++++----- src/client/components/Navbar.tsx | 3 +++ yarn.lock | 2 +- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 0818d79..0068d5d 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "better-docs": "^2.3.2", "calibre-opds": "^1.0.7", "comlink-loader": "^2.0.0", + "dayjs": "^1.10.6", "ellipsize": "^0.1.0", "event-stream": "^4.0.1", "express": "^4.17.1", diff --git a/src/client/components/ComicDetail.tsx b/src/client/components/ComicDetail.tsx index 684011c..22cc533 100644 --- a/src/client/components/ComicDetail.tsx +++ b/src/client/components/ComicDetail.tsx @@ -1,6 +1,5 @@ import React, { useState, useEffect, useCallback, ReactElement } from "react"; import { useParams } from "react-router-dom"; -import axios from "axios"; import Card from "./Card"; import MatchResult from "./MatchResult"; import ComicVineSearchForm from "./ComicVineSearchForm"; @@ -12,12 +11,22 @@ import { IExtractedComicBookCoverFile, RootState } from "threetwo-ui-typings"; import { fetchComicVineMatches } from "../actions/fileops.actions"; import { getComicBookDetailById } from "../actions/comicinfo.actions"; import { Drawer, Divider } from "antd"; +import * as dayjs from "dayjs"; const prettyBytes = require("pretty-bytes"); import "antd/dist/antd.css"; import { useDispatch, useSelector } from "react-redux"; type ComicDetailProps = {}; +/** + * Component for displaying the metadata for a comic in greater detail. + * + * @component + * @example + * return ( + * + * ) + */ export const ComicDetail = ({}: ComicDetailProps): ReactElement => { const [page, setPage] = useState(1); @@ -69,7 +78,7 @@ export const ComicDetail = ({}: ComicDetailProps): ReactElement => {
-
Raw File Details
+ Raw File Details
{comicBookDetailData.rawFileDetails.containedIn}
@@ -87,9 +96,13 @@ export const ComicDetail = ({}: ComicDetailProps): ReactElement => {
-
-
ComicVine Metadata
-
+
ComicVine Metadata
+
+ Last scraped on{" "} + {dayjs(comicBookDetailData.updatedAt).format( + "MMM D YYYY [at] h:mm a", + )} +
{comicBookDetailData.sourcedMetadata.comicvine.name} diff --git a/src/client/components/Navbar.tsx b/src/client/components/Navbar.tsx index e73df50..ff9a941 100644 --- a/src/client/components/Navbar.tsx +++ b/src/client/components/Navbar.tsx @@ -50,6 +50,9 @@ const Navbar: React.FunctionComponent = (props) => { Library + + Search +