refactor(dropzone): extract DropzoneInner and unify state management with zustand (#165)

Simplified Dropzone implementation by extracting inner logic to a new component, `DropzoneInner`. Replaced local dropzone state logic with centralized state management using zustand. Adjusted API exports and props accordingly for consistency and maintainability.
This commit is contained in:
dswbx
2025-04-25 22:37:28 -07:00
committed by GitHub
parent b60fd01960
commit eec8b64bae
15 changed files with 664 additions and 389 deletions
+5 -1
View File
@@ -51,6 +51,7 @@ if (example) {
let app: App;
const recreate = import.meta.env.VITE_APP_FRESH === "1";
const debugRerenders = import.meta.env.VITE_DEBUG_RERENDERS === "1";
let firstStart = true;
export default {
async fetch(request: Request) {
@@ -61,7 +62,7 @@ export default {
app.emgr.onEvent(
App.Events.AppBuiltEvent,
async () => {
app.registerAdminController({ forceDev: true });
app.registerAdminController({ forceDev: true, debugRerenders });
app.module.server.client.get("/assets/*", serveStatic({ root: "./" }));
},
"sync",
@@ -73,11 +74,14 @@ export default {
// log routes
if (firstStart) {
firstStart = false;
// biome-ignore lint/suspicious/noConsoleLog:
console.log("[DB]", credentials);
if (import.meta.env.VITE_SHOW_ROUTES === "1") {
// biome-ignore lint/suspicious/noConsoleLog:
console.log("\n[APP ROUTES]");
showRoutes(app.server);
// biome-ignore lint/suspicious/noConsoleLog:
console.log("-------\n");
}
}