Display form errors on new lines if there are multiple

This commit is contained in:
mabashian 2020-03-31 10:57:30 -04:00
parent 288ce123ca
commit 33a699b8ae

View File

@ -33,7 +33,17 @@ function FormSubmitError({ error }) {
return null;
}
return <Alert variant="danger" isInline title={errorMessage} />;
return (
<Alert
variant="danger"
isInline
title={
Array.isArray(errorMessage)
? errorMessage.map(msg => <div key={msg}>{msg}</div>)
: errorMessage
}
/>
);
}
export default FormSubmitError;