diff --git a/src/client/actions/fileops.actions.tsx b/src/client/actions/fileops.actions.tsx index a02c085..0301428 100644 --- a/src/client/actions/fileops.actions.tsx +++ b/src/client/actions/fileops.actions.tsx @@ -22,6 +22,7 @@ import { IMG_ANALYSIS_DATA_FETCH_SUCCESS, IMS_COMIC_BOOK_ARCHIVE_EXTRACTION_SUCCESS, IMS_COMIC_BOOK_ARCHIVE_EXTRACTION_CALL_IN_PROGRESS, + FILEOPS_STATE_RESET, } from "../constants/action-types"; import { success } from "react-notification-system-redux"; import { isNil, map } from "lodash"; @@ -258,7 +259,10 @@ export const extractComicArchive = export const analyzeImage = (imageFilePath: string | Buffer) => async (dispatch) => { - console.log(imageFilePath); + dispatch({ + type: FILEOPS_STATE_RESET, + }); + dispatch({ type: IMG_ANALYSIS_CALL_IN_PROGRESS, }); @@ -270,7 +274,6 @@ export const analyzeImage = imageFilePath, }, }); - console.log(foo); dispatch({ type: IMG_ANALYSIS_DATA_FETCH_SUCCESS, result: foo.data, diff --git a/src/client/assets/scss/App.scss b/src/client/assets/scss/App.scss index e7d0e95..9fb2f9c 100644 --- a/src/client/assets/scss/App.scss +++ b/src/client/assets/scss/App.scss @@ -42,11 +42,20 @@ pre { } // Dashboard +// Comic Detail +.stats-palette { + background-color: #fff6de; + display: inline-block; + p { + display: flex; + // padding: 1.5rem 2rem; + } +} .recent-comics-container { display: -webkit-box; /* Not needed if autoprefixing */ display: -ms-flexbox; /* Not needed if autoprefixing */ display: flex; - margin-left: -30px; /* gutter size offset */ + margin-left: -22px; /* gutter size offset */ width: auto; .recent-comics-column { diff --git a/src/client/components/ComicDetail/Tabs/ArchiveOperations.tsx b/src/client/components/ComicDetail/Tabs/ArchiveOperations.tsx index 63075f5..b9a0660 100644 --- a/src/client/components/ComicDetail/Tabs/ArchiveOperations.tsx +++ b/src/client/components/ComicDetail/Tabs/ArchiveOperations.tsx @@ -1,11 +1,12 @@ import React, { ReactElement, useCallback, useState } from "react"; import { useSelector, useDispatch } from "react-redux"; import { DnD } from "../../DnD"; -import { isEmpty } from "lodash"; +import { isEmpty, isNil, isUndefined } from "lodash"; import Sticky from "react-stickynode"; import SlidingPane from "react-sliding-pane"; import { extractComicArchive } from "../../../actions/fileops.actions"; import { analyzeImage } from "../../../actions/fileops.actions"; +import { Canvas } from "../../shared/Canvas"; export const ArchiveOperations = (props): ReactElement => { const { data } = props; @@ -16,9 +17,9 @@ export const ArchiveOperations = (props): ReactElement => { (state: RootState) => state.fileOps.extractedComicBookArchive, ); - const imageAnalysisResult = useSelector( - (state: RootState) => state.fileOps.imageAnalysisResults, - ); + const imageAnalysisResult = useSelector((state: RootState) => { + return state.fileOps.imageAnalysisResults; + }); const dispatch = useDispatch(); const unpackComicArchive = useCallback(() => { @@ -44,9 +45,14 @@ export const ArchiveOperations = (props): ReactElement => { content: () => { return (
{currentImage}
-
- {JSON.stringify(imageAnalysisResult, null, 2)}
+ {currentImage}
+ {!isEmpty(imageAnalysisResult) ? (
+
+
+
+ ) : null}
+
+ {JSON.stringify(imageAnalysisResult.analyzedData, null, 2)}