diff --git a/src/components/molecules/AccountSummaryItem.tsx b/src/components/molecules/AccountSummaryItem.tsx index 216b230..4e1e9c4 100644 --- a/src/components/molecules/AccountSummaryItem.tsx +++ b/src/components/molecules/AccountSummaryItem.tsx @@ -2,6 +2,7 @@ import { FC } from 'react'; import { useNavigate } from 'react-router-dom'; interface IProps { + accountId: number; title: string; totalMoney: number; icons: string; @@ -9,6 +10,7 @@ interface IProps { } export const AccountSummaryItem: FC = ({ + accountId, title, totalMoney, icons, @@ -17,6 +19,13 @@ export const AccountSummaryItem: FC = ({ const navigate = useNavigate(); const movePageHandler = () => { + if (link === '/account') { + navigate('/account', { + state: { + accountId: accountId, + }, + }); + } if (title === '머니박스 통장') navigate('/moneyBox'); else if (title === '하나머니') return; else navigate(link); diff --git a/src/pages/main/Home.tsx b/src/pages/main/Home.tsx index 5d6c524..075c4ae 100644 --- a/src/pages/main/Home.tsx +++ b/src/pages/main/Home.tsx @@ -68,7 +68,7 @@ export const Home = () => { )} -
+
{
{hanaMoney && ( { accounts.map((item: AccountType) => ( { : 'icons/bankbook.svg' } link={ - item.type === 'moneybox' - ? '/moneyBox' - : item.type === 'saving100' + item.type === 'DEPOSITWITHDRAWL' + ? '/account' + : item.type === 'SAVING100' ? '/saving100' - : item.type === 'saving' + : item.type === 'SAVING' ? '/roadmap4' - : item.type === 'deposit' + : item.type === 'DEPOSIT' ? '/roadmap5' : '' }