Hotfix: Signup fix error not shown (#3815)
* Fix error not shown * Simplifying * Removing dead codeimprovements/app-store-cli-video-apps
parent
a2a5d48037
commit
f57726dc95
|
@ -55,25 +55,17 @@ 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) => {
|
||||
return (
|
||||
<li key={key} className="text-blue-700">
|
||||
{t(`${fieldName}_hint_${key}`)}
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
</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) => {
|
||||
return (
|
||||
<li key={key} className="text-blue-700">
|
||||
{t(`${fieldName}_hint_${key}`)}
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</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
|
||||
|
|
Loading…
Reference in New Issue