IO-761 User Reset updates
This commit is contained in:
@@ -4,7 +4,10 @@ import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import ImEXOnlineLogo from "../../assets/logo192.png";
|
||||
import { sendPasswordReset } from "../../redux/user/user.actions";
|
||||
import {
|
||||
sendPasswordReset,
|
||||
sendPasswordResetAgain,
|
||||
} from "../../redux/user/user.actions";
|
||||
import { selectPasswordReset } from "../../redux/user/user.selectors";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import "./user-request-pw-reset.styles.scss";
|
||||
@@ -14,9 +17,14 @@ const mapStateToProps = createStructuredSelector({
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
sendPasswordReset: (email) => dispatch(sendPasswordReset(email)),
|
||||
sendPasswordResetAgain: (email) => dispatch(sendPasswordResetAgain(email)),
|
||||
});
|
||||
|
||||
export function UserRequestResetPw({ passwordReset, sendPasswordReset }) {
|
||||
export function UserRequestResetPw({
|
||||
passwordReset,
|
||||
sendPasswordReset,
|
||||
sendPasswordResetAgain,
|
||||
}) {
|
||||
const handleFinish = (values) => {
|
||||
try {
|
||||
sendPasswordReset(values.email);
|
||||
@@ -35,7 +43,8 @@ export function UserRequestResetPw({ passwordReset, sendPasswordReset }) {
|
||||
extra={[
|
||||
<Button
|
||||
key="send-again"
|
||||
onClick={() => sendPasswordReset(passwordReset.email)}
|
||||
onClick={() => sendPasswordResetAgain(passwordReset.email)}
|
||||
loading={passwordReset.loading}
|
||||
>
|
||||
{t("general.labels.sendagain")}
|
||||
</Button>,
|
||||
@@ -68,7 +77,12 @@ export function UserRequestResetPw({ passwordReset, sendPasswordReset }) {
|
||||
{passwordReset.error ? (
|
||||
<AlertComponent message={passwordReset.error} type="warning" />
|
||||
) : null}
|
||||
<Button className="login-btn" type="primary" htmlType="submit">
|
||||
<Button
|
||||
className="login-btn"
|
||||
type="primary"
|
||||
htmlType="submit"
|
||||
loading={passwordReset.loading}
|
||||
>
|
||||
{t("general.actions.submit")}
|
||||
</Button>
|
||||
</Form>
|
||||
|
||||
Reference in New Issue
Block a user