From 9010401af67d8258d7d977a82ce5f52613cfad40 Mon Sep 17 00:00:00 2001 From: dswbx Date: Tue, 22 Apr 2025 15:43:27 +0200 Subject: [PATCH] remove unused useTheme import and add loading state for entity detail view (#154) --- app/src/ui/elements/auth/AuthForm.tsx | 2 - app/src/ui/routes/data/data.$entity.$id.tsx | 50 ++++++++++++--------- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/app/src/ui/elements/auth/AuthForm.tsx b/app/src/ui/elements/auth/AuthForm.tsx index 02d6706..2753c46 100644 --- a/app/src/ui/elements/auth/AuthForm.tsx +++ b/app/src/ui/elements/auth/AuthForm.tsx @@ -10,7 +10,6 @@ import { SocialLink } from "./SocialLink"; import type { ValueError } from "@sinclair/typebox/value"; import { type TSchema, Value } from "core/utils"; import type { Validator } from "json-schema-form-react"; -import { useTheme } from "ui/client/use-theme"; class TypeboxValidator implements Validator { async validate(schema: TSchema, data: any) { @@ -46,7 +45,6 @@ export function AuthForm({ buttonLabel = action === "login" ? "Sign in" : "Sign up", ...props }: LoginFormProps) { - const { theme } = useTheme(); const basepath = auth?.basepath ?? "/api/auth"; const password = { action: `${basepath}/password/${action}`, diff --git a/app/src/ui/routes/data/data.$entity.$id.tsx b/app/src/ui/routes/data/data.$entity.$id.tsx index e042934..ba8e989 100644 --- a/app/src/ui/routes/data/data.$entity.$id.tsx +++ b/app/src/ui/routes/data/data.$entity.$id.tsx @@ -164,26 +164,36 @@ export function DataEntityUpdate({ params }) { ]} /> - - {error && ( -
- Update failed: {error} -
- )} - - {targetRelations.length > 0 ? ( - - ) : null} -
+ {$q.isLoading ? ( +
+ Loading... +
+ ) : ( + + {error && ( +
+ Update failed: {error} +
+ )} + + {targetRelations.length > 0 ? ( + + ) : null} +
+ )} ); }