From 63693a418540171dc7c827fe0128b9afe8feb63f Mon Sep 17 00:00:00 2001 From: palash-signoz Date: Tue, 3 May 2022 21:19:35 +0530 Subject: [PATCH] chore: name field is hidden when empty name is received from invite details api (#1036) --- frontend/src/pages/SignUp/SignUp.tsx | 34 +++++++++++++++++----------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/frontend/src/pages/SignUp/SignUp.tsx b/frontend/src/pages/SignUp/SignUp.tsx index d45b14b72e..9a3a967738 100644 --- a/frontend/src/pages/SignUp/SignUp.tsx +++ b/frontend/src/pages/SignUp/SignUp.tsx @@ -173,6 +173,11 @@ function SignUp({ version }: SignUpProps): JSX.Element { setFunction(value); }; + const getIsNameVisible = (): boolean => + !(firstName.length === 0 && !isPreferenceVisible); + + const isNameVisible = getIsNameVisible(); + return ( @@ -194,19 +199,22 @@ function SignUp({ version }: SignUpProps): JSX.Element { /> -
- - { - setState(e.target.value, setFirstName); - }} - required - id="signupFirstName" - disabled={isDetailsDisable} - /> -
+ {isNameVisible && ( +
+ + { + setState(e.target.value, setFirstName); + }} + required + id="signupFirstName" + disabled={isDetailsDisable} + /> +
+ )} +