This commit is contained in:
User
2025-02-07 18:24:52 -05:00
parent 75d4a616dd
commit b7f9b0aff7
17 changed files with 304 additions and 245 deletions

View File

@@ -66,7 +66,7 @@ export default function Chapters({ auth, comic, chapters, histories, offset }) {
}
const ComicChapterLink = (props) => {
const isNew = Date.now() - Date.parse(props.datetime_created) < 6.048e+8;
const isNew = Date.now() - Date.parse(props.datetime_created) < 6.048e+8; // 1 week
const isRead = histories.includes(props.uuid);
return (
@@ -226,7 +226,7 @@ export default function Chapters({ auth, comic, chapters, histories, offset }) {
<TabsContent value={ group }>
<div
className="w-full grid grid-cols-1 md:grid-cols-2 lg:grid-cols-6 2xl:grid-cols-12 gap-1">
{ (chapters.total > (chapters.limit + chapters.offset) && chapters.offset > 0) && (
{ (chapters.total > chapters.limit && chapters.offset > 0) && (
<Button size="sm" variant="outline" asChild>
<Link href="?" only={['chapters', 'offset']} headers={{ offset: parseInt(chapters.offset) - chapters.limit }}>
<ChevronsLeft /> Prev
@@ -236,7 +236,7 @@ export default function Chapters({ auth, comic, chapters, histories, offset }) {
{ chapters.list.sort((a, b) => ascending ? (a.index - b.index) : (b.index - a.index)).map(c => (
<ComicChapterLink key={ c.uuid } { ...c } />
) ) }
{ (chapters.total > chapters.limit && chapters.total > chapters.offset) && (
{ (chapters.total > (chapters.limit + chapters.offset)) && (
<Button size="sm" variant="outline" asChild>
<Link href="?" only={['chapters', 'offset']} headers={{ offset: parseInt(chapters.offset) + chapters.limit }}>
Next <ChevronsRight />