Repository URL to install this package:
|
Version:
2.8.0-studio-release ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const mobx_react_1 = require("xmobx/mobx-react");
const exotic_1 = require("exotic");
const utils_1 = require("@skava/utils");
const forms_1 = require("../../../../../forms");
const words_1 = require("../../../../../words");
const styled_1 = require("../styled");
const styled_2 = require("./styled");
const FormState_1 = require("./FormState");
class FormButton extends react_1.default.PureComponent {
render() {
const passThroughProps = utils_1.omit(this.props, ['children']);
return react_1.default.createElement(styled_1.StyledButton, Object.assign({}, passThroughProps, {
text: words_1.wording.resetPassword,
"data-qa": 'qa-reset-password'
}));
}
}
let FormCard = class FormCard extends forms_1.ObserverForm {
constructor() {
super(...arguments);
this.SubmitButton = FormButton;
this.handleSubmit = event => {
const {
onResetPassword
} = this.props;
event.preventDefault();
if (this.validateForm()) {
if (exotic_1.isFunction(onResetPassword)) {
onResetPassword(this.state);
}
}
};
}
};
FormCard.FormCard = FormState_1.formStateCard;
FormCard.defaultProps = {
state: FormState_1.formStateCard
};
FormCard = tslib_1.__decorate([mobx_react_1.observer], FormCard);
class ChangePassword extends react_1.default.PureComponent {
render() {
return react_1.default.createElement(styled_2.ChangePasswordWrapper, null, react_1.default.createElement(styled_2.Heading, {
breedType: "h2",
content: words_1.wording.changePassword
}), react_1.default.createElement(FormCard, Object.assign({}, this.props)));
}
}
exports.ChangePassword = ChangePassword;
exports.default = ChangePassword; //# sourceMappingURL=ChangePassword.js.map