fix: wire up URL import to home page dropzone and prevent click-through

Pass onUrlImport handler through AppLayout to Dropzone so URL-imported
files are loaded on the home page. Add stopPropagation on the modal
overlay to prevent clicks from reaching elements underneath.
This commit is contained in:
SnapOtter
2026-05-11 23:35:26 +08:00
parent d14691f75b
commit da692e68b3
4 changed files with 50 additions and 4 deletions
+8 -1
View File
@@ -71,11 +71,18 @@ export function HomePage() {
[setFiles, reset],
);
const handleUrlImport = useCallback(
(file: File) => {
setFiles([file]);
},
[setFiles],
);
const hasFile = files.length > 0;
// If no file uploaded, show default layout (tool panel + dropzone)
if (!hasFile) {
return <AppLayout onFiles={handleFiles} />;
return <AppLayout onFiles={handleFiles} onUrlImport={handleUrlImport} />;
}
// File uploaded — show tool selector on left, image preview on right