mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-03 19:04:39 -05:00
add page title
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import React, { useEffect, useState, useContext } from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import ChapterCard from '../components/ChapterCard';
|
||||
import MangaDetails from '../components/MangaDetails';
|
||||
import NavBarTitle from '../context/NavbarTitle';
|
||||
|
||||
export default function Manga() {
|
||||
const { id } = useParams<{id: string}>();
|
||||
const { setTitle } = useContext(NavBarTitle);
|
||||
|
||||
const [manga, setManga] = useState<IManga>();
|
||||
const [chapters, setChapters] = useState<IChapter[]>([]);
|
||||
@@ -12,7 +14,10 @@ export default function Manga() {
|
||||
useEffect(() => {
|
||||
fetch(`http://127.0.0.1:4567/api/v1/manga/${id}/`)
|
||||
.then((response) => response.json())
|
||||
.then((data) => setManga(data));
|
||||
.then((data: IManga) => {
|
||||
setManga(data);
|
||||
setTitle(data.title);
|
||||
});
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user