mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-12-13 09:11:19 -05:00
b15b5b8614
Resolves #647
22 lines
641 B
JavaScript
22 lines
641 B
JavaScript
var Formsy = require('formsy-react');
|
|
var React = require('react');
|
|
|
|
require('./general-error.scss');
|
|
|
|
/*
|
|
* 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.
|
|
*/
|
|
module.exports = Formsy.HOC(React.createClass({
|
|
render: function () {
|
|
if (!this.props.showError()) return null;
|
|
return (
|
|
<p className="general-error">
|
|
{this.props.getErrorMessage()}
|
|
</p>
|
|
);
|
|
}
|
|
}));
|