From a77eb9013dcc4c8cb8551e522c4ac1ce859de963 Mon Sep 17 00:00:00 2001 From: Maxwell Austensen Date: Mon, 25 Mar 2024 14:57:37 -0400 Subject: [PATCH 1/3] fix user conditional on building page --- client/src/components/EmailAlertSignup.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/EmailAlertSignup.tsx b/client/src/components/EmailAlertSignup.tsx index 9bde84af..670f798c 100644 --- a/client/src/components/EmailAlertSignup.tsx +++ b/client/src/components/EmailAlertSignup.tsx @@ -135,14 +135,14 @@ const EmailAlertSignupWithoutI18n = (props: EmailAlertProps) => { NEW - {!user ? ( + {!user?.email ? ( Get Data Updates for this building ) : ( Data Updates )}
- {user && !loginRegisterInProgress ? ( + {!!user?.email && !loginRegisterInProgress ? ( ) : ( Date: Mon, 25 Mar 2024 14:58:04 -0400 Subject: [PATCH 2/3] change input submits to buttons --- client/src/components/UserSettingField.tsx | 4 +++- client/src/styles/Login.scss | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/components/UserSettingField.tsx b/client/src/components/UserSettingField.tsx index 8b1330d6..c9f97cbe 100644 --- a/client/src/components/UserSettingField.tsx +++ b/client/src/components/UserSettingField.tsx @@ -231,7 +231,9 @@ const UserSettingFieldWithoutI18n = (props: UserSettingFieldProps) => { <> {children}
- + diff --git a/client/src/styles/Login.scss b/client/src/styles/Login.scss index f74868c7..a1677d4e 100644 --- a/client/src/styles/Login.scss +++ b/client/src/styles/Login.scss @@ -17,8 +17,7 @@ .submit-button-group { display: flex; - button[type="submit"], - input[type="submit"] { + .button.is-primary { padding: 1rem 2rem !important; align-self: center; margin: 0 auto !important; From c6edae4f3e7f0f8944a9500925b4911ebc0d9d96 Mon Sep 17 00:00:00 2001 From: Maxwell Austensen Date: Mon, 25 Mar 2024 14:58:36 -0400 Subject: [PATCH 3/3] add on-page placeholder during login modal --- client/src/components/Login.tsx | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/client/src/components/Login.tsx b/client/src/components/Login.tsx index de690a6f..0f586934 100644 --- a/client/src/components/Login.tsx +++ b/client/src/components/Login.tsx @@ -84,6 +84,8 @@ const LoginWithoutI18n = (props: LoginProps) => { onChange: onChangeUserType, } = useInput(""); + const [placeholderEmail, setPlaceholderEmail] = useState(""); + const [invalidAuthError, setInvalidAuthError] = useState(false); const [existingUserError, setExistingUserError] = useState(false); @@ -271,6 +273,8 @@ const LoginWithoutI18n = (props: LoginProps) => { } } } + + setPlaceholderEmail(email); }; const onLoginSubmit = async () => { @@ -392,6 +396,31 @@ const LoginWithoutI18n = (props: LoginProps) => { break; } + const renderOnPagePlaceholder = () => { + return ( +
+ + Get weekly Data Updates for complaints, violations, and evictions. + +
+ {}} + error={false} + setError={() => {}} + showError={false} + labelText={i18n._(t`Email address`)} + /> +
+ +
+
+
+ ); + }; + const renderLoginFlow = () => { return (
@@ -462,8 +491,7 @@ const LoginWithoutI18n = (props: LoginProps) => { return ( <> - {(!showRegisterModal || isCheckEmailStep || isLoginStep || isVerifyEmailStep) && - renderLoginFlow()} + {!showRegisterModal ? renderLoginFlow() : renderOnPagePlaceholder()} {registerInModal && (