diff --git a/public/logo.png b/public/logo.png index ce5c9ad..65daab9 100644 Binary files a/public/logo.png and b/public/logo.png differ diff --git a/src/app/books/[bookId]/chapters/[chapterId]/page.tsx b/src/app/books/[bookId]/chapters/[chapterId]/page.tsx index 0d0c943..ee1a04b 100644 --- a/src/app/books/[bookId]/chapters/[chapterId]/page.tsx +++ b/src/app/books/[bookId]/chapters/[chapterId]/page.tsx @@ -12,34 +12,28 @@ export default async function ChapterPage(props: { params: paramsType}) { const book = await fetchBookById(bookId); const chapters :Chapter[] = book.chapters; - const sorted_chapters:Chapter[] = chapters.sort((a, b) => a.Chapter_Number - b.Chapter_Number); + const sorted_chapters:Chapter[] = chapters.sort((a, b) => a.number - b.number); const current_chapter = sorted_chapters.find((chapter) => chapter.documentId === chapterId) || undefined; - const next_chapter = current_chapter ? sorted_chapters.find((chapter) => chapter.Chapter_Number === current_chapter.Chapter_Number + 1)?.documentId || "" : ""; - const prev_chapter = current_chapter ? sorted_chapters.find((chapter) => chapter.Chapter_Number === current_chapter.Chapter_Number - 1)?.documentId || "" : ""; + const next_chapter = current_chapter ? sorted_chapters.find((chapter) => chapter.number === current_chapter.number + 1)?.documentId || "" : ""; + const prev_chapter = current_chapter ? sorted_chapters.find((chapter) => chapter.number === current_chapter.number - 1)?.documentId || "" : ""; // Fetch chapter data if (current_chapter === undefined) { return ( -
-
-

Chapter not found !

' }}>
- - {/* Client component for navigation */} - -
-
+
+

Chapter not found !

' }}>
+ +
) } return ( -
+
- -
+
- {/* Client component for navigation */} - +
); diff --git a/src/app/books/[bookId]/page.tsx b/src/app/books/[bookId]/page.tsx index 30d1b26..5b2fa4b 100644 --- a/src/app/books/[bookId]/page.tsx +++ b/src/app/books/[bookId]/page.tsx @@ -1,7 +1,8 @@ -import { fetchBookChapterLinks } from "@/lib/api"; +import { fetchBookById, fetchBookChapterLinks } from "@/lib/api"; import { Book } from "@/lib/types"; import { formatDateToMonthDayYear } from "@/lib/utils"; import ChapterDropdown from "@/components/ChapterDropdown"; +import Image from "next/image"; export type paramsType = Promise<{ bookId: string}>; @@ -11,7 +12,7 @@ export default async function BookPage(props: { params: paramsType }) { let book: Book; try { - book = await fetchBookChapterLinks(bookId); + book = await fetchBookById(bookId); } catch (error) { console.error(error); return ( @@ -21,31 +22,35 @@ export default async function BookPage(props: { params: paramsType }) { ); } - const { Name, Author, Description, chapters } = book; + const { title, author, description, chapters, cover } = book; + const cover_media = cover?.at(0); const recentChapters = chapters.length > 6 ? chapters.slice(chapters.length - 6, chapters.length) : chapters; return (
-
- {/* Book Title */} -

{Name}

- - {/* Patreon Button */} - - Join Our Patreon for Unreleased Chapters - +
+ {cover_media?.alternativeText +
+

{title}

+ + Join Our Patreon for Unreleased Chapters + +

- Author: {Author} + Author: {author}

Translator: Null Translation Group

-

{Description}

+

{description}

Recent Chapters