-
- {inLibrary === 'In Library'
- &&
}
-
+
+
+
+
+
+
+
+
+ {manga.title}
+
+
+ Author:
+ {' '}
+ {getValueOrUnknown(manga.author)}
+
+
+ Artist:
+ {' '}
+ {getValueOrUnknown(manga.artist)}
+
+
+ Status:
+ {' '}
+ {manga.status}
+
+
+ Source:
+ {' '}
+ {getSourceName(manga.source)}
+
+
+
+
+
+ handleButtonClick()}>
+ {inLibrary === 'In Library' && }
+ {inLibrary !== 'In Library' && }
+ {inLibrary}
+
+
+ { /* eslint-disable-next-line react/jsx-no-target-blank */ }
+
+
+
+ Open Site
+
+
+
+
+
+
+
About
+
{manga.description}
+
+
+ {manga.genre.split(', ').map((g) =>
{g}
)}
+
-
);
}
diff --git a/webUI/react/src/components/MangaGrid.tsx b/webUI/react/src/components/MangaGrid.tsx
index 15a3ae4..a08e6e3 100644
--- a/webUI/react/src/components/MangaGrid.tsx
+++ b/webUI/react/src/components/MangaGrid.tsx
@@ -7,7 +7,7 @@ import Grid from '@material-ui/core/Grid';
import MangaCard from './MangaCard';
interface IProps{
- mangas: IManga[]
+ mangas: IMangaCard[]
message?: string
hasNextPage: boolean
lastPageNum: number
@@ -48,7 +48,7 @@ export default function MangaGrid(props: IProps) {
}
return (
-
+
{mapped}
);
diff --git a/webUI/react/src/screens/Manga.tsx b/webUI/react/src/screens/Manga.tsx
index 867945f..a212ab5 100644
--- a/webUI/react/src/screens/Manga.tsx
+++ b/webUI/react/src/screens/Manga.tsx
@@ -10,13 +10,12 @@ import NavbarContext from '../context/NavbarContext';
import client from '../util/client';
export default function Manga() {
- const { setTitle, setAction } = useContext(NavbarContext);
- useEffect(() => { setTitle('Manga'); setAction(<>>); }, []);
+ const { setTitle } = useContext(NavbarContext);
+ useEffect(() => { setTitle('Manga'); }, []); // delegate setting topbar action to MangaDetails
const { id } = useParams<{id: string}>();
const [manga, setManga] = useState();
- const [source, setSource] = useState();
const [chapters, setChapters] = useState([]);
useEffect(() => {
@@ -28,16 +27,6 @@ export default function Manga() {
});
}, []);
- useEffect(() => {
- if (manga !== undefined) {
- client.get(`/api/v1/source/${manga.sourceId}`)
- .then((response) => response.data)
- .then((data: ISource) => {
- setSource(data);
- });
- }
- }, [manga]);
-
useEffect(() => {
client.get(`/api/v1/manga/${id}/chapters`)
.then((response) => response.data)
@@ -52,7 +41,7 @@ export default function Manga() {
return (
<>
- {(manga && source) && }
+ {manga && }
{chapterCards}
>
);
diff --git a/webUI/react/src/screens/SearchSingle.tsx b/webUI/react/src/screens/SearchSingle.tsx
index d13d346..b56544b 100644
--- a/webUI/react/src/screens/SearchSingle.tsx
+++ b/webUI/react/src/screens/SearchSingle.tsx
@@ -27,7 +27,7 @@ export default function SearchSingle() {
const { sourceId } = useParams<{sourceId: string}>();
const classes = useStyles();
const [error, setError] = useState(false);
- const [mangas, setMangas] = useState([]);
+ const [mangas, setMangas] = useState([]);
const [message, setMessage] = useState('');
const [searchTerm, setSearchTerm] = useState('');
const [hasNextPage, setHasNextPage] = useState(false);
diff --git a/webUI/react/src/screens/SourceMangas.tsx b/webUI/react/src/screens/SourceMangas.tsx
index fdfea4c..15868e1 100644
--- a/webUI/react/src/screens/SourceMangas.tsx
+++ b/webUI/react/src/screens/SourceMangas.tsx
@@ -13,7 +13,7 @@ export default function SourceMangas(props: { popular: boolean }) {
useEffect(() => { setTitle('Source'); setAction(<>>); }, []);
const { sourceId } = useParams<{sourceId: string}>();
- const [mangas, setMangas] = useState([]);
+ const [mangas, setMangas] = useState([]);
const [hasNextPage, setHasNextPage] = useState(false);
const [lastPageNum, setLastPageNum] = useState(1);
diff --git a/webUI/react/src/typings.d.ts b/webUI/react/src/typings.d.ts
index d4466e8..89e9dad 100644
--- a/webUI/react/src/typings.d.ts
+++ b/webUI/react/src/typings.d.ts
@@ -21,12 +21,28 @@ interface ISource {
history: any
}
-interface IManga {
+interface IMangaCard {
id: number
- sourceId?: string
title: string
thumbnailUrl: string
- inLibrary?: boolean
+}
+
+interface IManga {
+ id: number
+ sourceId: string
+
+ url: string
+ title: string
+ thumbnailUrl: string
+
+ artist: string
+ author: string
+ description: string
+ genre: string
+ status: string
+
+ inLibrary: boolean
+ source: ISource
}
interface IChapter {