feat(bookReader): autoorientation, showcontrols on click, no more toast on load

This commit is contained in:
Julien Froidefond
2025-02-15 18:01:11 +01:00
parent 1984d2be97
commit bc9a754563
3 changed files with 78 additions and 35 deletions

View File

@@ -5,7 +5,6 @@ import { useRouter } from "next/navigation";
import { KomgaBook } from "@/types/komga";
import { BookReader } from "./BookReader";
import { Button } from "@/components/ui/button";
import { useToast } from "@/components/ui/use-toast";
interface ClientBookReaderProps {
book: KomgaBook;
@@ -14,17 +13,9 @@ interface ClientBookReaderProps {
export function ClientBookReader({ book, pages }: ClientBookReaderProps) {
const router = useRouter();
const { toast } = useToast();
const [isReading, setIsReading] = useState(false);
const handleStartReading = () => {
// Si le livre a une progression de lecture, on l'affiche dans un toast
if (book.readProgress && book.readProgress.page && book.readProgress.page > 0) {
toast({
title: "Reprise de la lecture",
description: `Reprise à la page ${book.readProgress.page}`,
});
}
setIsReading(true);
};