Compare commits
4 Commits
8723d5e2dc
...
c82089bb15
Author | SHA1 | Date | |
---|---|---|---|
c82089bb15 | |||
a179d0b392 | |||
956b02b2cd | |||
fd176658dd |
BIN
public/logo.png
BIN
public/logo.png
Binary file not shown.
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 203 KiB |
@ -1,6 +1,5 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import RSS from "rss";
|
||||
import { subDays } from "date-fns";
|
||||
import { fetchChaptersRSS } from "@/lib/api";
|
||||
import { Chapter } from "@/lib/types";
|
||||
|
||||
|
@ -2,9 +2,13 @@ import React from "react";
|
||||
import NavigationButtons from "@/components/NavigationButtons";
|
||||
import { Book, Chapter } from "@/lib/types";
|
||||
import { fetchBookById } from "@/lib/api";
|
||||
import Head from "next/head";
|
||||
export type paramsType = Promise<{ bookId: string; chapterId: string }>;
|
||||
|
||||
export const metadata = {
|
||||
title: 'Null Translation Group',
|
||||
description: 'This is the chapter page default description',
|
||||
};
|
||||
|
||||
// Dynamic page component
|
||||
export default async function ChapterPage(props: { params: paramsType}) {
|
||||
const { bookId, chapterId } = await props.params;
|
||||
@ -15,17 +19,12 @@ export default async function ChapterPage(props: { params: paramsType}) {
|
||||
}
|
||||
catch (error) {
|
||||
console.error(error);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>Chapter not found</title>
|
||||
<meta name="description" content="Chapter not found" />
|
||||
</Head>
|
||||
<div className="prose dark:prose-invert mx-auto p-6 bg-white dark:bg-gray-800 shadow-md rounded-lg mt-4">
|
||||
<div dangerouslySetInnerHTML={{ __html: '<center><h1> Chapter not found !</h1></center>' }}></div>
|
||||
<NavigationButtons bookId={bookId} documentId={chapterId} prevChapter={""} nextChapter={""} />
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@ -37,31 +36,19 @@ export default async function ChapterPage(props: { params: paramsType}) {
|
||||
|
||||
if(current_chapter === null){
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>Chapter not found</title>
|
||||
<meta name="description" content="Chapter not found" />
|
||||
</Head>
|
||||
<div className="prose dark:prose-invert mx-auto p-6 bg-white dark:bg-gray-800 shadow-md rounded-lg mt-4">
|
||||
<div dangerouslySetInnerHTML={{ __html: '<center><h1> Chapter not found !</h1></center>' }}></div>
|
||||
<NavigationButtons bookId={bookId} documentId={chapterId} prevChapter={""} nextChapter={""} />
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{book.title} - Chapter {current_chapter?.number}</title>
|
||||
<meta name="description" content={book.description} />
|
||||
</Head>
|
||||
<div className="prose dark:prose-invert mx-auto p-6 bg-white dark:bg-gray-800 shadow-md rounded-lg mt-4">
|
||||
<NavigationButtons bookId={bookId} documentId={chapterId} prevChapter={prev_chapter} nextChapter={next_chapter} />
|
||||
<div className="pt-4" dangerouslySetInnerHTML={{ __html: current_chapter.content }}></div>
|
||||
|
||||
<NavigationButtons bookId={bookId} documentId={chapterId} prevChapter={prev_chapter} nextChapter={next_chapter}/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
@ -3,14 +3,16 @@ import { Book } from "@/lib/types";
|
||||
import { formatDateToMonthDayYear } from "@/lib/utils";
|
||||
import ChapterDropdown from "@/components/ChapterDropdown";
|
||||
import { Ad } from "@/lib/types";
|
||||
import Head from "next/head";
|
||||
|
||||
export type paramsType = Promise<{ bookId: string}>;
|
||||
|
||||
export const metadata = {
|
||||
title: 'Null Translation Group',
|
||||
description: 'Null Translatin Group book',
|
||||
};
|
||||
|
||||
export default async function BookPage(props: { params: paramsType }) {
|
||||
const { bookId } = await props.params;
|
||||
|
||||
let book: Book;
|
||||
try {
|
||||
book = await fetchBookById(bookId);
|
||||
@ -26,12 +28,8 @@ export default async function BookPage(props: { params: paramsType }) {
|
||||
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 (
|
||||
<>
|
||||
<Head>
|
||||
<title>{title}</title>
|
||||
<meta name="description" content={description} />
|
||||
</Head>
|
||||
<div className="max-w-6xl mx-auto py-10 px-4">
|
||||
<div className="flex flex-col items-center justify-center">
|
||||
<img src={`${process.env.NEXT_PUBLIC_API_URL}${cover_media?.url}`}
|
||||
@ -94,7 +92,6 @@ export default async function BookPage(props: { params: paramsType }) {
|
||||
</li>
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 218 KiB |
@ -34,8 +34,6 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
||||
return (
|
||||
<html lang="en" className={isDarkMode ? "dark" : ""} suppressHydrationWarning>
|
||||
<head>
|
||||
<meta charSet="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
|
@ -1,7 +1,11 @@
|
||||
import { Book } from "@/lib/types";
|
||||
import { fetchBooks } from "@/lib/api";
|
||||
import { Ad } from "@/lib/types";
|
||||
import Head from "next/head";
|
||||
|
||||
export const metadata = {
|
||||
title: 'Null Translation Group',
|
||||
description: 'This is the Something page description.',
|
||||
};
|
||||
|
||||
export default async function HomePage() {
|
||||
let books: Book[] = [];
|
||||
@ -18,11 +22,7 @@ export default async function HomePage() {
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>Null Translation Group</title>
|
||||
<meta name="description" content="Null Translation Group main hub for all the books we are currently translating" />
|
||||
</Head>
|
||||
|
||||
<div className="mx-auto p-6 bg-gray-100 dark:bg-gray-900 text-gray-900 dark:text-gray-100 min-h-screen">
|
||||
<div className="hidden md:block bg-yellow-500 text-black py-2 px-4 rounded-lg hover:bg-yellow-600 transition duration-200 mb-6">
|
||||
<a
|
||||
@ -69,7 +69,5 @@ export default async function HomePage() {
|
||||
)})}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
||||
);
|
||||
}
|
||||
|
@ -17,6 +17,5 @@ export default {
|
||||
darkMode: "class",
|
||||
plugins: [
|
||||
require("@tailwindcss/typography"),
|
||||
require("@tailwindcss/line-clamp"),
|
||||
require('@tailwindcss/aspect-ratio')],
|
||||
} satisfies Config;
|
||||
|
Loading…
Reference in New Issue
Block a user