diff --git a/CHANGELOG.md b/CHANGELOG.md index 68b1c3ebb..ef62c9ee6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ changes. - Add redirect to the connected DRep Directory page if a connected user enters a non-connected DRep Directory url [Issue 1117](https://github.com/IntersectMBO/govtool/issues/1117) - Add PDF_API_URL to the frontend config [Issue 1575](https://github.com/IntersectMBO/govtool/issues/1575) - Provide DB-Sync Postgres envs to the backend config +- Add redirects to cards on Home after user connects [Issue 1442](https://github.com/IntersectMBO/govtool/issues/1442) ### Fixed diff --git a/govtool/frontend/src/components/organisms/HomeCards.tsx b/govtool/frontend/src/components/organisms/HomeCards.tsx index c2aa04bf8..47e16bc47 100644 --- a/govtool/frontend/src/components/organisms/HomeCards.tsx +++ b/govtool/frontend/src/components/organisms/HomeCards.tsx @@ -15,9 +15,17 @@ export const HomeCards = () => { const { screenWidth } = useScreenDimension(); const { t } = useTranslation(); - const openWalletModal = useCallback(() => { - openModal({ type: "chooseWallet" }); - }, [openModal]); + const openWalletModal = useCallback( + (pathToNavigate: string) => { + openModal({ + type: "chooseWallet", + state: { + pathToNavigate, + }, + }); + }, + [openModal], + ); const onClickLearnMoreAboutDelegation = () => openInNewTab( @@ -97,7 +105,7 @@ export const HomeCards = () => { dataTestIdFirstButton="register-connect-wallet-button" dataTestIdSecondButton="register-learn-more-button" description={t("home.cards.registerAsDRep.description")} - firstButtonAction={openWalletModal} + firstButtonAction={() => openWalletModal(PATHS.registerAsdRep)} firstButtonLabel={t("home.cards.registerAsDRep.firstButtonLabel")} imageHeight={80} imageURL={IMAGES.govActionRegisterImage} @@ -107,12 +115,12 @@ export const HomeCards = () => { title={t("home.cards.registerAsDRep.title")} /> {/* REGISTER AS DREP CARD END */} - {/* REGISTER AS SOLE VOTER CARD */} + {/* REGISTER AS DIRECT VOTER CARD */} openWalletModal(PATHS.registerAsDirectVoter)} firstButtonLabel={t( "home.cards.registerAsDirectVoter.firstButtonLabel", )} @@ -123,7 +131,7 @@ export const HomeCards = () => { secondButtonLabel={t("learnMore")} title={t("home.cards.registerAsDirectVoter.title")} /> - {/* REGISTER AS SOLE VOTER CARD END */} + {/* REGISTER AS DIRECT VOTER CARD END */} {/* GOV ACTIONS CARD */} { openWalletModal(PATHS.createGovernanceAction)} firstButtonLabel={t( "home.cards.proposeAGovernanceAction.firstButtonLabel", )}