mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-12-13 01:01:29 -05:00
25 lines
598 B
React
25 lines
598 B
React
|
var classNames = require('classnames');
|
||
|
var Formsy = require('formsy-react');
|
||
|
var React = require('react');
|
||
|
var validations = require('./validations');
|
||
|
|
||
|
for (var validation in validations) {
|
||
|
Formsy.addValidationRule(validation, validations[validation]);
|
||
|
}
|
||
|
|
||
|
var Form = React.createClass({
|
||
|
render: function () {
|
||
|
var classes = classNames(
|
||
|
'form',
|
||
|
this.props.className
|
||
|
);
|
||
|
return (
|
||
|
<Formsy.Form {... this.props} className={classes}>
|
||
|
{this.props.children}
|
||
|
</Formsy.Form>
|
||
|
);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
module.exports = Form;
|