2016-06-06 10:10:27 -04:00
|
|
|
var Formsy = require('formsy-react');
|
|
|
|
var React = require('react');
|
|
|
|
|
2016-07-05 12:03:27 -04:00
|
|
|
require('./general-error.scss');
|
|
|
|
|
2016-06-13 12:49:17 -04:00
|
|
|
/*
|
|
|
|
* A special formsy-react component that only outputs
|
|
|
|
* error messages. If you want to display errors that
|
|
|
|
* don't apply to a specific field, insert one of these,
|
|
|
|
* give it a name, and apply your validation error to
|
|
|
|
* the name of the GeneralError component.
|
|
|
|
*/
|
2016-06-06 10:10:27 -04:00
|
|
|
module.exports = Formsy.HOC(React.createClass({
|
|
|
|
render: function () {
|
|
|
|
if (!this.props.showError()) return null;
|
|
|
|
return (
|
2016-07-05 12:03:27 -04:00
|
|
|
<p className="general-error">
|
2016-06-06 10:10:27 -04:00
|
|
|
{this.props.getErrorMessage()}
|
|
|
|
</p>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}));
|