diff --git a/src/components/chaptersTable.tsx b/src/components/chaptersTable.tsx index 957cbf3..2749ddd 100644 --- a/src/components/chaptersTable.tsx +++ b/src/components/chaptersTable.tsx @@ -33,6 +33,11 @@ export function ChaptersTable({ manga }: { manga: MangaWithMetadataAndChaptersLi highlightOnHover records={records} recordsPerPage={PAGE_SIZE} + sx={(themes) => ({ + '*': { + fontSize: `${themes.fontSizes.xs}px !important`, + }, + })} page={page} totalRecords={manga.chapters.length} onPageChange={(p) => setPage(p)} diff --git a/src/components/mangaDetail.tsx b/src/components/mangaDetail.tsx index 0ce612a..5e6f255 100644 --- a/src/components/mangaDetail.tsx +++ b/src/components/mangaDetail.tsx @@ -1,8 +1,21 @@ -import { Badge, createStyles, Divider, Grid, Group, Image, Text, Title, Tooltip } from '@mantine/core'; +import { Badge, createStyles, Divider, Grid, Group, Image, Spoiler, Text, Title } from '@mantine/core'; +import { NextLink } from '@mantine/next'; import { Prisma } from '@prisma/client'; +import { IconExternalLink } from '@tabler/icons'; -const useStyles = createStyles((_theme) => ({ - root: {}, +const useStyles = createStyles((theme) => ({ + root: { + wordBreak: 'break-word', + }, + outsideLink: { + textDecoration: 'none', + fontWeight: 600, + color: theme.colors.blue[7], + '&:hover': { + color: theme.colors.indigo[7], + }, + fontSize: 24, + }, placeHolder: { alignItems: 'start !important', justifyContent: 'flex-start !important', @@ -19,83 +32,97 @@ export function MangaDetail({ manga }: { manga: MangaWithMetadataAndChapters }) const { classes } = useStyles(); return ( - - - ({ - width: 210, - boxShadow: theme.shadows.xl, - })} - withPlaceholder - placeholder={ - ({ - width: 210, - boxShadow: theme.shadows.xl, - })} - src="/cover-not-found.jpg" - alt={manga.title} - /> - } - src={manga.metadata.cover} - /> - - - {manga.title}} /> - - {manga.metadata.synonyms.map((synonym) => ( - -
- - {synonym} - -
-
- ))} -
- - - {manga.metadata.status} - - - - - There are   - - {manga.chapters.length} + } + hideLabel={} + > + + + ({ + width: 210, + boxShadow: theme.shadows.xl, + })} + withPlaceholder + placeholder={ + ({ + width: 210, + boxShadow: theme.shadows.xl, + })} + src="/cover-not-found.jpg" + alt={manga.title} + /> + } + src={manga.metadata.cover} + /> + + + url.includes('anilist')) ? ( + url.includes('anilist')) || '#'} + > + + {manga.title} + + + + ) : ( + + {manga.title} + + ) + } + /> + + {manga.metadata.synonyms.map((synonym) => ( + + {synonym} + + ))} + + + + {manga.metadata.status} -   chapters - - - {manga.metadata.summary || 'No summary...'} - - - {manga.metadata.genres.map((genre) => ( - -
- - {genre} - -
-
- ))} -
- - - {manga.metadata.tags.map((tag) => ( - -
- - {tag} - -
-
- ))} -
-
-
+ + + {manga.metadata.summary || 'No summary...'} + + + {manga.metadata.genres.map((genre) => ( + + {genre} + + ))} + + + + {manga.metadata.tags.map((tag) => ( + + {tag} + + ))} + + + + ); } diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 8d3ba54..6bc621a 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -97,7 +97,10 @@ export default function IndexPage() { title={manga.title} cover={manga.metadata.cover} onRemove={() => handleRemove(manga.id, manga.title)} - onClick={() => router.push(`/manga/${manga.id}`)} + onClick={() => { + mangaQuery.refetch(); + router.push(`/manga/${manga.id}`); + }} /> ); diff --git a/src/pages/manga/[id].tsx b/src/pages/manga/[id].tsx index 3cdf539..68d2316 100644 --- a/src/pages/manga/[id].tsx +++ b/src/pages/manga/[id].tsx @@ -4,7 +4,7 @@ import { ChaptersTable } from '../../components/chaptersTable'; import { MangaDetail } from '../../components/mangaDetail'; import { trpc } from '../../utils/trpc'; -export default function LibraryPage() { +export default function MangaPage() { const router = useRouter(); const { id } = router.query; const mangaQuery = trpc.manga.get.useQuery(