Created
January 29, 2017 19:56
-
-
Save zrod/5c0c63bd45c2e059de413c05ee8b17a3 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
import React, { PropTypes } from 'react'; | |
import { Message } from 'semantic-ui-react'; | |
import I18n from '../../helpers/I18n'; | |
const ErrorBlock = ({errors}) => { | |
let errorList = []; | |
for (let error in errors) { | |
errorList.push(errors[error]); | |
} | |
if (errorList.length > 0) { | |
return ( | |
<Message | |
error | |
header={i18n.validation.common.form_errors} | |
list={errorList} | |
/> | |
); | |
} | |
return (<span></span>); | |
}; | |
ErrorBlock.propTypes = { | |
errors: PropTypes.object | |
}; | |
export default ErrorBlock; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment