%PDF- %PDF-
Direktori : /home/emergentqj/actioncivile/pre-auth/.f81b4c9eb38fd76cdf20462cf2027aa3/static/js/containers/ForgotPassword/ |
Current File : /home/emergentqj/actioncivile/pre-auth/.f81b4c9eb38fd76cdf20462cf2027aa3/static/js/containers/ForgotPassword/ResetPasswordContainer.js |
import { connect } from "react-redux"; import { trackMixpanelActions } from "utils"; import MIXPANEL_ACTIONS from "constants/mixpanel_actions"; import ResetPasswordForm from "../../components/ForgotPassword/ResetPasswordForm"; import { resetPassword, resetPasswordToken, } from "../../actions/list_actions"; const mapStateToProps = (state) => { const resetPasswordForm = state.form.resetPasswordForm ? state.form.resetPasswordForm : null; return { resetPasswordForm, phone: state.resetPassword.get("phoneNumber"), token: state.resetPassword.get("token"), fullToken: state.resetPassword.get("fullToken"), newPassword: resetPasswordForm && resetPasswordForm.values ? resetPasswordForm.values.rpass : null, pswValidationMsg: state.resetPassword.get("pswValidationMsg"), showPassword: state.resetPassword.get("showPassword"), showPasswordConfirmation: state.resetPassword.get( "showPasswordConfirmation", ), isOpenedWithToken: state.resetPassword.get("isOpenedWithToken"), }; }; const mapDispatchToProps = (dispatch) => ({ resetPasswordToken: ( phone, token, newPassword, fullToken, isOpenedWithToken, ) => { trackMixpanelActions(MIXPANEL_ACTIONS.FORGOT_PASSWORD_NEW_SET, { category: "Selfservice", channel: "DesktopWeb", eventType: "forgotPassword", label: MIXPANEL_ACTIONS.FORGOT_PASSWORD_NEW_SET, }); if (isOpenedWithToken) { dispatch(resetPasswordToken(fullToken, newPassword)); } else { dispatch(resetPassword(phone, token, newPassword)); } }, }); export default connect( mapStateToProps, mapDispatchToProps, )(ResetPasswordForm);