From c079c69915f4bad28db9a5c1a2ed1b810c522654 Mon Sep 17 00:00:00 2001 From: apostolof Date: Sun, 28 Feb 2021 20:02:45 +0200 Subject: [PATCH] fix: disable personal information submit button if all fields are empty --- .../src/views/Register/PersonalInformationStep/index.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/concordia-app/src/views/Register/PersonalInformationStep/index.jsx b/packages/concordia-app/src/views/Register/PersonalInformationStep/index.jsx index 264928f..4d71e54 100644 --- a/packages/concordia-app/src/views/Register/PersonalInformationStep/index.jsx +++ b/packages/concordia-app/src/views/Register/PersonalInformationStep/index.jsx @@ -99,6 +99,9 @@ const PersonalInformationStep = (props) => { } }, [error, locationInput, profilePictureInput, pushNextStep]); + const submitEnabled = useMemo(() => (profilePictureInput && profilePictureUrlValid) || locationInput, + [locationInput, profilePictureInput, profilePictureUrlValid]); + const goToHomePage = () => history.push('/'); return ( @@ -154,7 +157,7 @@ const PersonalInformationStep = (props) => { floated="right" content={t('register.form.personal.information.step.button.submit')} onClick={handleSubmit} - disabled={!profilePictureUrlValid} + disabled={!submitEnabled} />