diff --git a/apps/mochi-web/components/Profile/RecapSection.tsx b/apps/mochi-web/components/Profile/RecapSection.tsx index d089a1d6c..3b1e618cb 100644 --- a/apps/mochi-web/components/Profile/RecapSection.tsx +++ b/apps/mochi-web/components/Profile/RecapSection.tsx @@ -36,6 +36,9 @@ import { useTheme } from '~hooks/useTheme' import clsx from 'clsx' import { useState } from 'react' import { useFetchTotalBalance } from '~hooks/profile/useFetchTotalBalance' +import { ROUTES } from '~constants/routes' +import { useRouter } from 'next/router' +import events from '~constants/events' const intervals = [ { @@ -120,6 +123,14 @@ const UserSection = ({ type, statTx }: Props) => { /> ) + const { pathname, push } = useRouter() + const redirectToTipWidget = async () => { + if (pathname !== ROUTES.HOME) { + await push(ROUTES.HOME) + } + window.dispatchEvent(new Event(events.TIP_WIDGET.FOCUS_AMOUNT)) + } + if (type === 'sent' && !statTx) { return (
@@ -128,7 +139,12 @@ const UserSection = ({ type, statTx }: Props) => { To send money -