Hotfix: Signup fix error not shown (#3815)

* Fix error not shown

* Simplifying

* Removing dead code
improvements/app-store-cli-video-apps
Leo Giovanetti 2022-08-11 20:48:58 -03:00 committed by GitHub
parent a2a5d48037
commit f57726dc95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 19 deletions

View File

@ -55,13 +55,6 @@ function HintsOrErrors<T extends FieldValues = FieldValues>(props: {
if (!hintErrors && fieldErrors && !fieldErrors.message) {
// no hints passed, field errors exist and they are custom ones
return (
<>
{fieldErrors?.message && (
<div className="text-gray mt-2 flex items-center text-sm text-red-700">
<Info className="mr-1 h-3 w-3" />
{fieldErrors.message}
</div>
)}
<div className="text-gray mt-2 flex items-center text-sm text-gray-700">
<ul className="ml-2">
{Object.keys(fieldErrors).map((key: string) => {
@ -73,7 +66,6 @@ function HintsOrErrors<T extends FieldValues = FieldValues>(props: {
})}
</ul>
</div>
</>
);
}
@ -107,6 +99,16 @@ function HintsOrErrors<T extends FieldValues = FieldValues>(props: {
);
}
// errors exist, not custom ones, just show them as is
if (fieldErrors) {
return (
<div className="text-gray mt-2 flex items-center text-sm text-red-700">
<Info className="mr-1 h-3 w-3" />
{fieldErrors.message}
</div>
);
}
if (!hintErrors) return null;
// hints passed, no errors exist, proceed to just show hints