diff --git a/app/editor/[storySlug]/page.tsx b/app/editor/[storySlug]/page.tsx index cc14c41..8551d40 100644 --- a/app/editor/[storySlug]/page.tsx +++ b/app/editor/[storySlug]/page.tsx @@ -128,14 +128,10 @@ export default function StoryEditorPage() { if (wasGenerating) { setShowGenerateModal(true); } - - toast({ - title: "API key saved", - description: "Your Together API key has been saved successfully", - duration: 3000, - }); }; + + const handleGeneratePage = async (data: { prompt: string; style: string; @@ -216,7 +212,6 @@ export default function StoryEditorPage() {
setShowInfoSheet(true)} onContinueStory={handleAddPage} /> @@ -229,7 +224,12 @@ export default function StoryEditorPage() { loadingPageId={loadingPageId} onApiKeyClick={handleApiKeyClick} /> - + setShowInfoSheet(true)} + onNextPage={() => setCurrentPage((prev) => (prev < pages.length - 1 ? prev + 1 : prev))} + onPrevPage={() => setCurrentPage((prev) => (prev > 0 ? prev - 1 : prev))} + />
void; + onNextPage?: () => void; + onPrevPage?: () => void; } -export function ComicCanvas({ page }: ComicCanvasProps) { +export function ComicCanvas({ page, onInfoClick, onNextPage, onPrevPage }: ComicCanvasProps) { return (
{/* Dot grid background */} @@ -32,7 +35,20 @@ export function ComicCanvas({ page }: ComicCanvasProps) { {`Page { + const rect = e.currentTarget.getBoundingClientRect(); + const clickX = e.clientX - rect.left; + const imageWidth = rect.width; + + if (clickX > imageWidth / 2) { + // Right half - next page + onNextPage?.(); + } else { + // Left half - previous page + onPrevPage?.(); + } + }} />
@@ -44,6 +60,28 @@ export function ComicCanvas({ page }: ComicCanvasProps) {
+ {/* Action buttons below the page image */} +
+ {onInfoClick && ( + + )} + + +
+
{/*
Page {page.id}
*/} diff --git a/components/editor/editor-toolbar.tsx b/components/editor/editor-toolbar.tsx index 8682f30..c5ed48c 100644 --- a/components/editor/editor-toolbar.tsx +++ b/components/editor/editor-toolbar.tsx @@ -6,13 +6,11 @@ import { useRouter } from "next/navigation"; interface EditorToolbarProps { title: string; - onInfoClick: () => void; onContinueStory?: () => void; } export function EditorToolbar({ title, - onInfoClick, onContinueStory, }: EditorToolbarProps) { const router = useRouter(); @@ -34,41 +32,24 @@ export function EditorToolbar({
-
- +
+ - - - - - -
+ +
); } diff --git a/components/editor/page-sidebar.tsx b/components/editor/page-sidebar.tsx index 12d9f18..6153315 100644 --- a/components/editor/page-sidebar.tsx +++ b/components/editor/page-sidebar.tsx @@ -31,37 +31,56 @@ export function PageSidebar({ onApiKeyClick, }: PageSidebarProps) { return ( -