mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-02 02:14:36 -05:00
manga details done
This commit is contained in:
17
webUI/react/src/screens/Manga.tsx
Normal file
17
webUI/react/src/screens/Manga.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import ChapterCard from '../components/ChapterCard';
|
||||
import MangaDetails from '../components/MangaDetails';
|
||||
|
||||
export default function Manga() {
|
||||
const { id } = useParams<{id: string}>();
|
||||
|
||||
return (
|
||||
<>
|
||||
<MangaDetails id={id} />
|
||||
<ol style={{ listStyle: 'none', padding: 0 }}>
|
||||
<ChapterCard />
|
||||
</ol>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -2,11 +2,6 @@ import React, { useEffect, useState } from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import MangaCard from '../components/MangaCard';
|
||||
|
||||
interface IManga {
|
||||
title: string
|
||||
thumbnailUrl: string
|
||||
}
|
||||
|
||||
export default function MangaList(props: { popular: boolean }) {
|
||||
const { sourceId } = useParams<{sourceId: string}>();
|
||||
let mapped;
|
||||
@@ -17,8 +12,8 @@ export default function MangaList(props: { popular: boolean }) {
|
||||
const sourceType = props.popular ? 'popular' : 'latest';
|
||||
fetch(`http://127.0.0.1:4567/api/v1/source/${sourceId}/${sourceType}/${lastPageNum}`)
|
||||
.then((response) => response.json())
|
||||
.then((data: { title: string, thumbnail_url: string }[]) => setMangas(
|
||||
data.map((it) => ({ title: it.title, thumbnailUrl: it.thumbnail_url })),
|
||||
.then((data: { title: string, thumbnail_url: string, id:number }[]) => setMangas(
|
||||
data.map((it) => ({ title: it.title, thumbnailUrl: it.thumbnail_url, id: it.id })),
|
||||
));
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user