diff --git a/client/src/Components/v1/TextLink/index.jsx b/client/src/Components/v1/TextLink/index.jsx index 83ae251a5..e226250a6 100644 --- a/client/src/Components/v1/TextLink/index.jsx +++ b/client/src/Components/v1/TextLink/index.jsx @@ -5,7 +5,7 @@ import PropTypes from "prop-types"; import { useTheme } from "@emotion/react"; import { Link as RouterLink } from "react-router-dom"; -const TextLink = ({ text, linkText, href, target = "_self" }) => { +const TextLink = ({ text, linkText, href, state, target = "_self" }) => { const theme = useTheme(); return ( @@ -19,6 +19,7 @@ const TextLink = ({ text, linkText, href, target = "_self" }) => { to={href} component={RouterLink} target={target} + state={state} > {linkText} @@ -30,6 +31,7 @@ TextLink.propTypes = { text: PropTypes.string, linkText: PropTypes.string, href: PropTypes.string, + state: PropTypes.object, target: PropTypes.string, }; diff --git a/client/src/Pages/Account/components/PasswordPanel.jsx b/client/src/Pages/Account/components/PasswordPanel.jsx index 1c365804f..7deb6dc8c 100644 --- a/client/src/Pages/Account/components/PasswordPanel.jsx +++ b/client/src/Pages/Account/components/PasswordPanel.jsx @@ -13,6 +13,8 @@ import { getTouchedFieldErrors } from "../../../Validation/error.js"; import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; import { clearAuthState } from "../../../Features/Auth/authSlice.js"; +import TextLink from "@/Components/v1/TextLink/index.jsx"; +import { useLocation } from "react-router-dom"; const defaultPasswordsState = { password: "", @@ -31,6 +33,7 @@ const PasswordPanel = () => { const dispatch = useDispatch(); const { t } = useTranslation(); const navigate = useNavigate(); + const location = useLocation(); const SPACING_GAP = theme.spacing(12); @@ -267,8 +270,15 @@ const PasswordPanel = () => { )} +