cosmo-ui
Version:
Common React components
39 lines • 1.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = require("react");
var actions_1 = require("../actions");
var form_1 = require("../abstract/form");
var selectors_1 = require("../selectors");
var react_redux_1 = require("react-redux");
var react_native_1 = require("react-native");
var FormComponent = (function (_super) {
tslib_1.__extends(FormComponent, _super);
function FormComponent() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Render a form tag
*/
FormComponent.prototype.render = function () {
var _a = this.props, name = _a.name, id = _a.id, children = _a.children, className = _a.className, style = _a.style;
return (React.createElement(react_native_1.View, { style: this.styles() }, children));
};
FormComponent.prototype.styles = function () {
return {
height: 50,
};
};
return FormComponent;
}(form_1.BaseForm));
var mapStateToProps = function (state, ownProps) { return ({
formData: selectors_1.getForm(state, ownProps.name),
}); };
var mapDispatchToProps = {
resetForm: actions_1.resetForm,
destroyForm: actions_1.destroyForm,
submitFormValid: actions_1.submitFormValid,
submitFormInvalid: actions_1.submitFormInvalid,
};
exports.Form = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(FormComponent);
//# sourceMappingURL=form.js.map