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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user