Move info and redraw actions to ComicCanvas, update sidebar UI

Shifted the info and redraw buttons from the editor toolbar to the ComicCanvas component, allowing for contextual actions per page. Enhanced ComicCanvas to support page navigation via image clicks and added optional callbacks for info and navigation. Updated the page sidebar to display page thumbnails instead of numbers, improved the add page button, and adjusted button sizes for better usability.
This commit is contained in:
Riccardo Giorato
2025-12-26 17:40:41 +01:00
parent 9895200db6
commit 47263231af
4 changed files with 101 additions and 63 deletions
+8 -8
View File
@@ -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() {
<div className="h-screen flex flex-col bg-background">
<EditorToolbar
title={story.title}
onInfoClick={() => setShowInfoSheet(true)}
onContinueStory={handleAddPage}
/>
@@ -229,7 +224,12 @@ export default function StoryEditorPage() {
loadingPageId={loadingPageId}
onApiKeyClick={handleApiKeyClick}
/>
<ComicCanvas page={pages[currentPage]} />
<ComicCanvas
page={pages[currentPage]}
onInfoClick={() => setShowInfoSheet(true)}
onNextPage={() => setCurrentPage((prev) => (prev < pages.length - 1 ? prev + 1 : prev))}
onPrevPage={() => setCurrentPage((prev) => (prev > 0 ? prev - 1 : prev))}
/>
</div>
<ApiKeyModal