From c33948b7853e65e00b489172e82b779842d6b623 Mon Sep 17 00:00:00 2001 From: Luc Date: Thu, 19 Dec 2024 00:21:51 +0100 Subject: [PATCH] Improve required fields --- web/src/components/input/BaseInput.tsx | 15 ++++++++++++++- web/src/routes/settings/fields/index.tsx | 6 ++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/web/src/components/input/BaseInput.tsx b/web/src/components/input/BaseInput.tsx index 3e6e9ba..45ba46d 100644 --- a/web/src/components/input/BaseInput.tsx +++ b/web/src/components/input/BaseInput.tsx @@ -22,13 +22,25 @@ export const BaseInput = ({ errorMessage, description, width = 'fit', + required, ...rest }: BaseInputProperties) => { const id = useId(); return (
- {label && } + {label && ( + + )}
onChange?.(event.target.value)} + required={required} {...rest} />
diff --git a/web/src/routes/settings/fields/index.tsx b/web/src/routes/settings/fields/index.tsx index d527759..9c6aa42 100644 --- a/web/src/routes/settings/fields/index.tsx +++ b/web/src/routes/settings/fields/index.tsx @@ -82,12 +82,14 @@ const FieldDefinitionEditor = ({ )} @@ -105,11 +107,13 @@ const FieldDefinitionEditor = ({ )} @@ -119,6 +123,7 @@ const FieldDefinitionEditor = ({