Created
September 26, 2018 16:19
-
-
Save esshka/0c116421f1419b34f0c0797ec199b794 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ErrorsContainer = ({errors}) => { | |
if (errors.length === 0) { | |
return null; | |
} | |
return errors.map(err => { | |
if (err.displayType === MODAL_ERROR_DISPLAY_TYPE) { | |
return <ModalError error={err} key={Math.random()} />; | |
} | |
if (err.displayType === EAPI_TIMEOUT_ERROR_DISPLAY_TYPE) { | |
return <ModalError error={err} key={Math.random()} withActionOk />; | |
} | |
return <InlineError error={err} key={Math.random()} />; | |
}); | |
}; | |
export default ErrorsContainer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment