diff --git a/apps/token/src/routes/staking/node/stake-success.tsx b/apps/token/src/routes/staking/node/stake-success.tsx index 03f0c0fed..7a586c57c 100644 --- a/apps/token/src/routes/staking/node/stake-success.tsx +++ b/apps/token/src/routes/staking/node/stake-success.tsx @@ -1,6 +1,6 @@ import { Dialog, Icon, Intent } from '@vegaprotocol/ui-toolkit'; import { useTranslation } from 'react-i18next'; -import { Link } from 'react-router-dom'; +import { Link, useNavigate } from 'react-router-dom'; import Routes from '../../routes'; import type { StakeAction } from './staking-form'; import { Actions, RemoveType } from './staking-form'; @@ -23,6 +23,7 @@ export const StakeSuccess = ({ toggleDialog, }: StakeSuccessProps) => { const { t } = useTranslation(); + const navigate = useNavigate(); const isAdd = action === Actions.Add; const title = isAdd ? t('stakeAddSuccessTitle', { amount }) @@ -44,7 +45,15 @@ export const StakeSuccess = ({

{message}

- + { + event.preventDefault(); + toggleDialog(); + setTimeout(() => navigate(Routes.VALIDATORS), 0); + }} + > {t('backToStaking')}

diff --git a/yarn.lock b/yarn.lock index d48c91da8..8fbd567a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19195,9 +19195,9 @@ react-refresh@^0.11.0: integrity sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A== react-remove-scroll-bar@^2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.3.tgz#e291f71b1bb30f5f67f023765b7435f4b2b2cd94" - integrity sha512-i9GMNWwpz8XpUpQ6QlevUtFjHGqnPG4Hxs+wlIJntu/xcsZVEpJcIV71K3ZkqNy2q3GfgvkD7y6t/Sv8ofYSbw== + version "2.3.4" + resolved "https://registry.yarnpkg.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.4.tgz#53e272d7a5cb8242990c7f144c44d8bd8ab5afd9" + integrity sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A== dependencies: react-style-singleton "^2.2.1" tslib "^2.0.0"