Skip to content

Commit

Permalink
fix(core): update styles for reset password validation
Browse files Browse the repository at this point in the history
  • Loading branch information
bc-alexsaiannyi committed Oct 24, 2024
1 parent 0d76ad1 commit 432a75c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/shy-ads-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bigcommerce/catalyst-core": patch
---

update styles for reset password validation
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const ChangePasswordForm = ({ customerId, customerToken }: Props) => {
/>
</FieldControl>
<FieldMessage
className="absolute inset-x-0 bottom-0 inline-flex w-full text-sm text-gray-500"
className="absolute inset-x-0 bottom-0 inline-flex w-full text-xs text-error"
match={(value: string) => value !== newPassword}
>
{t('confirmPasswordValidationMessage')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const ResetPasswordForm = ({ reCaptchaSettings }: Props) => {
};

const handleEmailValidation = (e: ChangeEvent<HTMLInputElement>) => {
const validationStatus = e.target.validity.valueMissing;
const validationStatus = e.target.validity.valueMissing || e.target.validity.typeMismatch;

setIsEmailValid(!validationStatus);
};
Expand Down Expand Up @@ -144,11 +144,17 @@ export const ResetPasswordForm = ({ reCaptchaSettings }: Props) => {
/>
</FieldControl>
<FieldMessage
className="absolute inset-x-0 bottom-0 inline-flex w-full text-sm text-gray-500"
className="absolute inset-x-0 bottom-0 inline-flex w-full text-xs text-error"
match="valueMissing"
>
{t('emailValidationMessage')}
</FieldMessage>
<FieldMessage
className="absolute inset-x-0 bottom-0 inline-flex w-full text-xs text-error"
match="typeMismatch"
>
{t('emailValidationMessage')}
</FieldMessage>
</Field>

{reCaptchaSettings?.isEnabledOnStorefront && (
Expand All @@ -159,7 +165,7 @@ export const ResetPasswordForm = ({ reCaptchaSettings }: Props) => {
sitekey={reCaptchaSettings.siteKey}
/>
{!isReCaptchaValid && (
<span className="absolute inset-x-0 bottom-0 inline-flex w-full text-xs font-normal text-red-200">
<span className="absolute inset-x-0 bottom-0 inline-flex w-full text-xs text-error">
{t('recaptchaText')}
</span>
)}
Expand Down

0 comments on commit 432a75c

Please sign in to comment.