0.1.5
This commit is contained in:
@@ -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 />
|
||||
|
||||
@@ -86,7 +86,7 @@ export default function Histories({ auth, histories }) {
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
<Table>
|
||||
<Table className="mt-2">
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>Select</TableHead>
|
||||
@@ -120,22 +120,16 @@ export default function Histories({ auth, histories }) {
|
||||
)) }
|
||||
</TableBody>
|
||||
</Table>
|
||||
<div>
|
||||
<div className="pt-2">
|
||||
<Pagination className="justify-end">
|
||||
<PaginationContent>
|
||||
{ histories.current_page > 1 && (
|
||||
<PaginationItem>
|
||||
<PaginationPrevious href={ histories.prev_page_url } only={['histories']} />
|
||||
{ histories.links.map((h, i) => (
|
||||
<PaginationItem key={ i }>
|
||||
{ h.label.includes('Previous') && <PaginationPrevious href={ h.url } only={['histories']} isActive={ h.active } /> }
|
||||
{ !h.label.includes('Previous') && !h.label.includes('Next') && <PaginationLink href={ h.url } only={['histories']} isActive={ h.active }>{ h.label }</PaginationLink> }
|
||||
{ h.label.includes('Next') && <PaginationNext href={ h.url } only={['histories']} isActive={ h.active } /> }
|
||||
</PaginationItem>
|
||||
) }
|
||||
<PaginationItem>
|
||||
<PaginationLink href="#">{ histories.current_page }</PaginationLink>
|
||||
</PaginationItem>
|
||||
{ histories.current_page < histories.last_page && (
|
||||
<PaginationItem>
|
||||
<PaginationNext href={ histories.next_page_url } only={['histories']} />
|
||||
</PaginationItem>
|
||||
) }
|
||||
) ) }
|
||||
</PaginationContent>
|
||||
</Pagination>
|
||||
</div>
|
||||
|
||||
@@ -67,23 +67,23 @@ export default function Histories({ auth, histories }) {
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{ histories.map((comic, i) =>
|
||||
comic.histories.map((record, j) => (
|
||||
<TableRow key={ j }>
|
||||
{ (j === 0) ? <TableCell className="w-[40%]" rowspan={ comic.histories.length }>
|
||||
<Link href={ route('comics.chapters', comic.comic.comic_pathword) }>
|
||||
{ comic.comic.comic_name }
|
||||
</Link>
|
||||
</TableCell> : null }
|
||||
<TableCell>
|
||||
<Link href={ route('comics.read', [comic.comic.comic_pathword, record.chapter_uuid]) }>
|
||||
{ record.chapter_name }
|
||||
</Link>
|
||||
</TableCell>
|
||||
<TableCell>{ record.read_at }</TableCell>
|
||||
</TableRow>
|
||||
) )
|
||||
) }
|
||||
{ histories.map((comic, i) => comic.histories.map((record, j) => (
|
||||
<TableRow key={ j }>
|
||||
{ (j === 0) && <TableCell className="w-[40%]" rowSpan={ comic.histories.length }>
|
||||
<Link href={ route('comics.chapters', comic.comic.comic_pathword) }>
|
||||
{ comic.comic.comic_name }
|
||||
</Link>
|
||||
</TableCell> }
|
||||
<TableCell>
|
||||
<Link href={ route('comics.read', [comic.comic.comic_pathword, record.chapter_uuid]) }>
|
||||
{ record.chapter_name }
|
||||
</Link>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{ record.read_at }
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
) ) ) }
|
||||
</TableBody>
|
||||
</Table>
|
||||
</div>
|
||||
|
||||
@@ -14,9 +14,11 @@ export default function Index({ comics, offset, auth }) {
|
||||
|
||||
const url = new URL(window.location); // searchParams
|
||||
|
||||
const [favourites, setFavourites] = useState(auth.user?.favourites ?? []);
|
||||
const [favourites, setFavourites] = useState((auth?.user?.favourites !== null) ? auth.user.favourites : []);
|
||||
const { toast } = useToast();
|
||||
|
||||
const itemsPerPage = 30;
|
||||
|
||||
/**
|
||||
* On click handler for the star
|
||||
* Do posting and make a toast
|
||||
@@ -84,19 +86,21 @@ export default function Index({ comics, offset, auth }) {
|
||||
</Head>
|
||||
<div className="p-3 pt-1 pb-1 flex flex-wrap justify-center" scroll-region="true"
|
||||
style={{ overflowAnchor: "none", height: "calc(100dvh - 90px)", overflowY: "scroll" }}>
|
||||
<div className="grid 2xl:grid-cols-6 xl:grid-cols-4 sm:grid-cols-2 gap-2">
|
||||
<div className="grid 2xl:grid-cols-6 xl:grid-cols-4 grid-cols-2 gap-2">
|
||||
<ComicCards { ...comics } />
|
||||
</div>
|
||||
<Pagination className="justify-end pt-2">
|
||||
<PaginationContent>
|
||||
{ parseInt(offset) !== 0 &&
|
||||
<PaginationItem>
|
||||
<PaginationPrevious href={ `${ url.pathname }?${ url.searchParams }` } only={['comics', 'offset']} headers={{ offset: parseInt(offset) - 30 }} />
|
||||
<PaginationPrevious href={ `${ url.pathname }?${ url.searchParams }` } only={['comics', 'offset']} headers={{ offset: parseInt(offset) - itemsPerPage }} />
|
||||
</PaginationItem>
|
||||
}
|
||||
{ parseInt(comics.total) > parseInt(offset) + itemsPerPage &&
|
||||
<PaginationItem>
|
||||
<PaginationNext href={ `${ url.pathname }?${ url.searchParams }` } only={['comics', 'offset']} headers={{ offset: parseInt(offset) + itemsPerPage }} />
|
||||
</PaginationItem>
|
||||
}
|
||||
<PaginationItem>
|
||||
<PaginationNext href={ `${ url.pathname }?${ url.searchParams }` } only={['comics', 'offset']} headers={{ offset: parseInt(offset) + 30 }} />
|
||||
</PaginationItem>
|
||||
</PaginationContent>
|
||||
</Pagination>
|
||||
</div>
|
||||
|
||||
@@ -11,6 +11,19 @@ export default function Updates({ auth }) {
|
||||
<title>Updates</title>
|
||||
</Head>
|
||||
<div className="p-3 pt-1">
|
||||
<Card className="w-[90%] m-3 mx-auto">
|
||||
<CardHeader>
|
||||
<CardTitle>0.1.5</CardTitle>
|
||||
<CardDescription>Release: 07 Feb 2025</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<ul>
|
||||
<li>General bug fixes and system improvements</li>
|
||||
<li>Toggle reading history</li>
|
||||
<li>Queue driver, Horizon is now default driver</li>
|
||||
</ul>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Card className="w-[90%] m-3 mx-auto">
|
||||
<CardHeader>
|
||||
<CardTitle>0.1.4</CardTitle>
|
||||
|
||||
@@ -17,7 +17,7 @@ Sentry.init({
|
||||
// Tracing
|
||||
tracesSampleRate: 0.1, // Capture 10% of the transactions
|
||||
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
|
||||
tracePropagationTargets: ["localhost", /^https:\/\/c\.yumj\.in/],
|
||||
tracePropagationTargets: [/^https:\/\/c\.yumj\.in/],
|
||||
// Session Replay
|
||||
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
|
||||
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
|
||||
|
||||
@@ -8,10 +8,15 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/component
|
||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
|
||||
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarMenu, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem } from '@/components/ui/sidebar';
|
||||
|
||||
import { useToast } from '@/hooks/use-toast.js';
|
||||
|
||||
export function AppSidebar({ auth }) {
|
||||
|
||||
const { tags } = usePage().props;
|
||||
const [search, setSearch] = useState('');
|
||||
const [historyDisabled, setHistoryDisabled] = useState(false);
|
||||
|
||||
const { toast } = useToast();
|
||||
|
||||
const searchOnSubmitHandler = (e) => {
|
||||
e.preventDefault();
|
||||
@@ -68,9 +73,22 @@ export function AppSidebar({ auth }) {
|
||||
|
||||
const [theme, setTheme] = useState(getTheme());
|
||||
|
||||
const toggleHistoryButtonHandler = () => {
|
||||
axios.post(route('comics.toggleHistory')).then(res => {
|
||||
setHistoryDisabled(res.data.historyDisabled);
|
||||
toast({
|
||||
title: "All set",
|
||||
description: `Histories are now ${ res.data.historyDisabled ? 'Disabled' : 'Enabled' }`,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setTheme(getTheme());
|
||||
setThemeInHtml(getTheme());
|
||||
|
||||
// Set historyDisabled
|
||||
setHistoryDisabled(auth.user.historyDisabled);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
@@ -86,7 +104,7 @@ export function AppSidebar({ auth }) {
|
||||
</div>
|
||||
<div className="flex flex-col gap-0.5 leading-none">
|
||||
<span className="font-semibold">Comic</span>
|
||||
<span>0.1.4</span>
|
||||
<span>0.1.5</span>
|
||||
</div>
|
||||
</Link>
|
||||
</SidebarMenuButton>
|
||||
@@ -214,13 +232,13 @@ export function AppSidebar({ auth }) {
|
||||
</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuGroup>
|
||||
<DropdownMenuItem>
|
||||
<SquarePower /> History On
|
||||
<DropdownMenuItem onClick={ () => toggleHistoryButtonHandler() }>
|
||||
<SquarePower /> { (historyDisabled) ? "History Off" : "History On" }
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={ () => themeButtonOnclickHandler() }>
|
||||
<>{ theme === 'dark' ? (<Sun />) : (<Moon />) } Toggle theme</>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem asChild><a href="/queues" target="_blank"><Layers /> Queues</a></DropdownMenuItem>
|
||||
<DropdownMenuItem asChild><a href="/horizon" target="_blank"><Layers /> Queues</a></DropdownMenuItem>
|
||||
<DropdownMenuItem asChild><Link href={ route('profile.edit') }><BadgeCheck /> Profile</Link></DropdownMenuItem>
|
||||
<DropdownMenuItem asChild><Link href={ route('comics.favourites') }><Star /> Favourites</Link></DropdownMenuItem>
|
||||
<DropdownMenuItem asChild><Link href={ route('comics.histories') }><History /> History</Link></DropdownMenuItem>
|
||||
|
||||
Reference in New Issue
Block a user