Skip to content

Commit

Permalink
fix: resolves UX issues in "form-error" blocks
Browse files Browse the repository at this point in the history
- GiftForm.tsx
- OnBehalf.tsx
  • Loading branch information
mohitb35 committed Nov 9, 2023
1 parent bbb9b28 commit ab46edd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/Donations/Micros/GiftForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ export default function GiftForm(): ReactElement {
)}
/>
{errors.recipientName && (
<span className={"form-errors"}>
<div className={"form-errors"}>
{t("recipientNameRequired")}
</span>
</div>
)}
</div>

Expand Down Expand Up @@ -151,11 +151,11 @@ export default function GiftForm(): ReactElement {
)}
/>
{errors.recipientEmail && (
<span className={"form-errors"}>
<div className={"form-errors"}>
{errors.recipientEmail.type === "required"
? t("emailRequired")
: t("enterValidEmail")}
</span>
</div>
)}
</div>
<div className={"form-field mt-30"}>
Expand Down
8 changes: 4 additions & 4 deletions src/Donations/Micros/OnBehalf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const OnBehalf: FC = () => {
)}
/>
{errors.firstName && (
<span className={"form-errors"}>{t("firstNameRequired")}</span>
<div className={"form-errors"}>{t("firstNameRequired")}</div>
)}
</Grid>
<Grid item xs={6}>
Expand All @@ -91,7 +91,7 @@ const OnBehalf: FC = () => {
)}
/>
{errors.lastName && (
<span className={"form-errors"}>{t("lastNameRequired")}</span>
<div className={"form-errors"}>{t("lastNameRequired")}</div>
)}
</Grid>
{shouldNotify ? (
Expand Down Expand Up @@ -128,13 +128,13 @@ const OnBehalf: FC = () => {
)}
/>
{errors.email && errors.email.type === "required" && (
<span className={"form-errors"}>
<div className={"form-errors"}>
{errors.email.type === "required"
? t("emailRequired")
: t("inValidField", {
fieldName: "Email",
})}
</span>
</div>
)}
</Grid>
) : (
Expand Down

0 comments on commit ab46edd

Please sign in to comment.