diff --git a/src/client/actions/fileops.actions.tsx b/src/client/actions/fileops.actions.tsx index 0da8bd9..746505e 100644 --- a/src/client/actions/fileops.actions.tsx +++ b/src/client/actions/fileops.actions.tsx @@ -163,7 +163,7 @@ export const fetchComicVineMatches = (searchPayload) => (dispatch) => { console.log(error); } - // dispatch({ - // type: CV_CLEANUP, - // }); + dispatch({ + type: CV_CLEANUP, + }); }; diff --git a/src/client/components/ComicDetail.tsx b/src/client/components/ComicDetail.tsx index aeb8410..3da9408 100644 --- a/src/client/components/ComicDetail.tsx +++ b/src/client/components/ComicDetail.tsx @@ -60,66 +60,82 @@ export const ComicDetail = ({}: ComicDetailProps): ReactElement => { setVisible(false); }; - const tabs = ["Volume Information", "Other Metadata", "Acquistion Details"]; + const [active, setActive] = useState(0); - const [active, setActive] = useState({ currentTab: tabs[0], markup: <> }); - const renderTabContent = (tab, data) => { - switch (tab) { - case "Volume Information": - setActive({ - currentTab: tab, - markup: ( -
-
-
- -
-
-
-
-
- {data.data.sourcedMetadata.comicvine.volumeInformation.name} -
-
- Published by - - {" "} - { - data.data.sourcedMetadata.comicvine.volumeInformation - .publisher.name - } - -
-
-
-
- ), - }); - break; - } - }; - const MetadataTabGroup = (data) => { + const tabGroup = [ + { + id: 0, + name: "Volume Information", + content: !isNil(comicBookDetailData.sourcedMetadata) && ( +
+
+
+ +
+
+
+
+
+ Is a part of{" "} + + { + comicBookDetailData.sourcedMetadata.comicvine + .volumeInformation.name + } + +
+
+ Published by + + {" "} + { + comicBookDetailData.sourcedMetadata.comicvine + .volumeInformation.publisher.name + } + +
+
+ Total issues in this volume:{" "} + { + comicBookDetailData.sourcedMetadata.comicvine + .volumeInformation.count_of_issues + } +
+
+
+
+ ), + }, + { + id: 1, + name: "Other Metadata", + content: <>bastard, + }, + ]; + const MetadataTabGroup = () => { return ( <>
- {active.markup} + {tabGroup.map(({ id, content }) => { + return active === id ? content : null; + })} ); }; @@ -216,7 +232,7 @@ export const ComicDetail = ({}: ComicDetailProps): ReactElement => { - +