-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
02a4dbd
commit fc912c8
Showing
15 changed files
with
428 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ | |
"account.viewApplications": "View applications", | ||
"account.myApplicationsSubtitle": "See lottery dates and listings for properties for which you've applied", | ||
"account.noApplications": "It looks like you haven't applied to any listings yet.", | ||
"account.reviewTerms": "Review Terms of Use", | ||
"account.reviewTermsHelper": "You must accept the terms of use before creating an account.", | ||
"account.signUpSaveTime.applyFaster": "Apply faster with saved application details", | ||
"account.signUpSaveTime.checkStatus": "Check on the status of an application at any time", | ||
"account.signUpSaveTime.resetPassword": "Simply reset your password if you forget it", | ||
|
@@ -37,6 +39,16 @@ | |
"account.settings.placeholders.year": "YYYY", | ||
"account.settings.update": "Update", | ||
"account.settings.iconTitle": "generic user", | ||
"account.pwdless.code": "Your code", | ||
"account.pwdless.codeAlert": "We sent a code to %{email} to finish signing up. Be aware, the code will expire in 5 minutes.", | ||
"account.pwdless.codeNewAlert": "A new code has been sent to %{email}. Be aware, the code will expire in 5 minutes.", | ||
"account.pwdless.continue": "Continue", | ||
"account.pwdless.notReceived": "Didn't receive your code?", | ||
"account.pwdless.resend": "Resend", | ||
"account.pwdless.resendCode": "Resend Code", | ||
"account.pwdless.resendCodeButton": "Resend the code", | ||
"account.pwdless.resendCodeHelper": "If there is an account made with that email, we’ll send a new code. Be aware, the code will expire in 5 minutes.", | ||
"account.pwdless.verifyTitle": "Verify that it's you", | ||
"alert.maintenance": "This site is undergoing scheduled maintenance. We apologize for any inconvenience.", | ||
"application.ada.hearing": "For Hearing Impairments", | ||
"application.ada.label": "ADA Accessible Units", | ||
|
@@ -530,14 +542,19 @@ | |
"authentication.signIn.changeYourPassword": "You can change your password", | ||
"authentication.signIn.enterLoginEmail": "Please enter your login email", | ||
"authentication.signIn.enterLoginPassword": "Please enter your login password", | ||
"authentication.signIn.enterValidEmailAndPassword": "Please enter a valid email and password.", | ||
"authentication.signIn.enterValidEmailAndPasswordAndMFA": "Please enter a valid code.", | ||
"authentication.signIn.enterValidEmailAndPassword": "Please enter a valid email and password", | ||
"authentication.signIn.enterValidEmailAndPasswordAndMFA": "Please enter a valid code", | ||
"authentication.signIn.error": "There was an error signing you in", | ||
"authentication.signIn.errorGenericMessage": "Please try again, or contact support for help.", | ||
"authentication.signIn.forgotPassword": "Forgot password?", | ||
"authentication.signIn.loginError": "Please enter a valid email address", | ||
"authentication.signIn.passwordError": "Please enter a valid password", | ||
"authentication.signIn.passwordOutdated": "Your password has expired. Please reset your password.", | ||
"authentication.signIn.pwdless.createAccountCopy": "Sign up quicky with no need to remember any passwords.", | ||
"authentication.signIn.pwdless.emailHelperText": "Enter your email and we'll send you a code to sign in.", | ||
"authentication.signIn.pwdless.getCode": "Get code to sign in", | ||
"authentication.signIn.pwdless.useCode": "Get a code instead", | ||
"authentication.signIn.pwdless.usePassword": "Use your password instead", | ||
"authentication.signIn.success": "Welcome back, %{name}!", | ||
"authentication.signIn.youHaveToWait": "You’ll have to wait 30 minutes since the last failed attempt before trying again.", | ||
"authentication.signIn.yourAccountIsNotConfirmed": "Your account is not confirmed", | ||
|
@@ -917,6 +934,7 @@ | |
"t.email": "Email", | ||
"t.emailAddressPlaceholder": "[email protected]", | ||
"t.filter": "Filter", | ||
"t.finish": "Finish", | ||
"t.floor": "floor", | ||
"t.floors": "floors", | ||
"t.getDirections": "Get Directions", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import React, { useContext } from "react" | ||
import { useRouter } from "next/router" | ||
import type { UseFormMethods } from "react-hook-form" | ||
import { Field, Form, NavigationContext, t } from "@bloom-housing/ui-components" | ||
import { Button } from "@bloom-housing/ui-seeds" | ||
import { getListingRedirectUrl } from "../../utilities/getListingRedirectUrl" | ||
import styles from "./FormSignIn.module.scss" | ||
|
||
export type FormSignInDefaultProps = { | ||
control: FormSignInDefaultControl | ||
onSubmit: (data: FormSignInDefaultValues) => void | ||
} | ||
|
||
export type FormSignInDefaultValues = { | ||
email: string | ||
password: string | ||
} | ||
|
||
export type FormSignInDefaultControl = { | ||
errors: UseFormMethods["errors"] | ||
handleSubmit: UseFormMethods["handleSubmit"] | ||
register: UseFormMethods["register"] | ||
} | ||
|
||
const FormSignInDefault = ({ | ||
onSubmit, | ||
control: { errors, register, handleSubmit }, | ||
}: FormSignInDefaultProps) => { | ||
const onError = () => { | ||
window.scrollTo(0, 0) | ||
} | ||
const { LinkComponent } = useContext(NavigationContext) | ||
const router = useRouter() | ||
const listingIdRedirect = router.query?.listingId as string | ||
const forgetPasswordURL = getListingRedirectUrl(listingIdRedirect, "/forgot-password") | ||
|
||
return ( | ||
<Form id="sign-in" onSubmit={handleSubmit(onSubmit, onError)}> | ||
<Field | ||
className={styles["sign-in-email-input"]} | ||
name="email" | ||
label={t("t.email")} | ||
labelClassName="text__caps-spaced" | ||
validation={{ required: true }} | ||
error={errors.email} | ||
errorMessage={t("authentication.signIn.enterLoginEmail")} | ||
register={register} | ||
dataTestId="sign-in-email-field" | ||
/> | ||
<aside> | ||
<LinkComponent href={forgetPasswordURL} className={styles["forgot-password"]}> | ||
{t("authentication.signIn.forgotPassword")} | ||
</LinkComponent> | ||
</aside> | ||
<Field | ||
className={styles["sign-in-password-input"]} | ||
name="password" | ||
label={t("authentication.createAccount.password")} | ||
labelClassName="text__caps-spaced" | ||
validation={{ required: true }} | ||
error={errors.password} | ||
errorMessage={t("authentication.signIn.enterLoginPassword")} | ||
register={register} | ||
type={"password"} | ||
dataTestId="sign-in-password-field" | ||
/> | ||
<div className={styles["sign-in-action"]}> | ||
<Button type="submit" variant="primary" id="sign-in-button"> | ||
{t("nav.signIn")} | ||
</Button> | ||
</div> | ||
</Form> | ||
) | ||
} | ||
|
||
export { FormSignInDefault as default, FormSignInDefault } |
Oops, something went wrong.