import React from 'react'; import PropTypes from 'prop-types'; import { useDispatch } from 'react-redux'; import { useNavigate } from 'react-router-dom'; /* !- Redux Actions */ import { setUser } from './actions'; /* !- React Elements */ import Form, { Input, Submit, } from '../form/intl'; /* !- Constants */ import { LOGIN_SCHEME, LOGIN_FIELDS } from './constants'; /* !- Types */ const defaultProps = { id: "reset", } type PropTypes = Partial & { } /** * Reset: classic password change form component. * If login success set user via Redux. */ const Reset = ({ id }: PropTypes) => { const dispatch = useDispatch(); const navigate = useNavigate(); return (
{ dispatch(setUser(response.records)); navigate('/', { replace: true }); }} > ) }; Reset.defaultProps = defaultProps; export default Reset;