Skip to content

Commit

Permalink
fix: a lot
Browse files Browse the repository at this point in the history
  • Loading branch information
yarre-uk committed Dec 13, 2023
1 parent 2b513c7 commit 9ef64cf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/app/(main)/manga/[mangaId]/components/ChapterCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function ChapterCard({
return (
<div className="flex flex-row gap-4">
<Card
className="z-0 flex w-full flex-row items-center justify-between p-2 px-8"
className="z-0 flex w-full cursor-pointer flex-row items-center justify-between p-2 px-8"
onClick={() => {
router.push(`${ROUTE.MANGA}/${mangaId}/${chapter.chapterId}`);
}}
Expand Down
26 changes: 15 additions & 11 deletions src/app/(main)/manga/[mangaId]/components/Chapters.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BookPlusIcon } from 'lucide-react';
import { useRouter } from 'next/navigation';
import { useSession } from 'next-auth/react';

import ChapterCard from './ChapterCard';
import { ChapterDTO } from '../types';
Expand All @@ -21,22 +22,25 @@ function Chapters({
refetchData,
}: ChaptersProps) {
const router = useRouter();
const { data: session } = useSession();

return (
<div className="flex flex-col gap-2">
<p className="text-2xl">Chapters</p>
<div>
<Button
variant="outline"
onClick={() => {
router.push(`/chapter/add?mangaId=${mangaId}`);
}}
className="w-full p-6"
>
<p className="flex flex-row gap-4">
Add Chapter <BookPlusIcon />
</p>
</Button>
{session?.user?.accessToken ? (
<Button
variant="outline"
onClick={() => {
router.push(`/chapter/add?mangaId=${mangaId}`);
}}
className="w-full p-6"
>
<p className="flex flex-row gap-4">
Add Chapter <BookPlusIcon />
</p>
</Button>
) : null}
</div>
<div className={`${className} flex flex-col gap-4`}>
{chapters?.length !== 0 ? (
Expand Down
7 changes: 4 additions & 3 deletions src/app/(main)/manga/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function MangaPage() {

const handleClear = () => {
setValue('title', '');
setValue('genre', undefined);
setValue('genre', '');
setValue('rating', 0);

fetchManga().then((data) => setManga(data));
Expand Down Expand Up @@ -144,8 +144,9 @@ function MangaPage() {
<MangaList manga={manga} />
</div>
<Button
className="mx-16"
disabled={manga?.length % 6 != 0}
className="mx-auto w-[500px]"
variant="outline"
disabled={manga?.length % 6 != 0 || manga?.length == 0}
onClick={handleLoadNewPage}
>
<LucideArrowBigDownDash />
Expand Down

0 comments on commit 9ef64cf

Please sign in to comment.