From abc5fa66914ce7e75e22db970cdb111bf7fe2a3a Mon Sep 17 00:00:00 2001 From: Vincent Date: Fri, 17 Mar 2023 18:36:25 +0100 Subject: [PATCH] (ui) Add label for user profil form gender field --- .../src/javascript/components/user/gender-input.tsx | 11 ++++++++--- .../javascript/components/user/user-profile-form.tsx | 2 +- .../src/stylesheets/modules/user/gender-input.scss | 12 ++++++++++++ config/locales/app.shared.de.yml | 1 + config/locales/app.shared.en.yml | 1 + config/locales/app.shared.es.yml | 1 + config/locales/app.shared.fr.yml | 1 + config/locales/app.shared.no.yml | 1 + config/locales/app.shared.pt.yml | 1 + config/locales/app.shared.zu.yml | 1 + 10 files changed, 28 insertions(+), 4 deletions(-) diff --git a/app/frontend/src/javascript/components/user/gender-input.tsx b/app/frontend/src/javascript/components/user/gender-input.tsx index 66d3dc071..5958fe753 100644 --- a/app/frontend/src/javascript/components/user/gender-input.tsx +++ b/app/frontend/src/javascript/components/user/gender-input.tsx @@ -7,12 +7,13 @@ import { useTranslation } from 'react-i18next'; interface GenderInputProps { register: UseFormRegister, disabled?: boolean|((id: string) => boolean), + required?: boolean } /** * Input component to set the gender for the user */ -export const GenderInput = ({ register, disabled = false }: GenderInputProps) => { +export const GenderInput = ({ register, disabled = false, required }: GenderInputProps) => { const { t } = useTranslation('shared'); const [isDisabled, setIsDisabled] = useState(false); @@ -26,21 +27,25 @@ export const GenderInput = ({ register, disabl }, [disabled]); return ( -
+
+ {t('app.shared.gender_input.label')} -
+ ); }; diff --git a/app/frontend/src/javascript/components/user/user-profile-form.tsx b/app/frontend/src/javascript/components/user/user-profile-form.tsx index f5125fb23..940315ed7 100644 --- a/app/frontend/src/javascript/components/user/user-profile-form.tsx +++ b/app/frontend/src/javascript/components/user/user-profile-form.tsx @@ -184,7 +184,7 @@ export const UserProfileForm: React.FC = ({ action, size,

{t('app.shared.user_profile_form.personal_data')}

- +