Skip to content

Commit

Permalink
fix: 버그 수정2
Browse files Browse the repository at this point in the history
  • Loading branch information
abcxj123 committed Jun 11, 2024
1 parent 09a48f8 commit bbfe950
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
9 changes: 9 additions & 0 deletions src/components/molecules/AccountSummaryItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import { FC } from 'react';
import { useNavigate } from 'react-router-dom';

interface IProps {
accountId: number;
title: string;
totalMoney: number;
icons: string;
link: string;
}

export const AccountSummaryItem: FC<IProps> = ({
accountId,
title,
totalMoney,
icons,
Expand All @@ -17,6 +19,13 @@ export const AccountSummaryItem: FC<IProps> = ({
const navigate = useNavigate();

const movePageHandler = () => {
if (link === '/account') {
navigate('/account', {
state: {
accountId: accountId,
},
});
}
if (title === '머니박스 통장') navigate('/moneyBox');
else if (title === '하나머니') return;
else navigate(link);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/main/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const Home = () => {
</AlertModal>
)}

<div className='w-full'>
<div className='fixed w-full'>
<div className='w-full flex items-center pt-24 px-10'>
<img
src={isExistToken ? 'icons/moneybox_icon.svg' : 'icons/person.svg'}
Expand Down
12 changes: 7 additions & 5 deletions src/pages/main/MyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const MyPage = () => {
<div className='flex flex-col items-center gap-7'>
{hanaMoney && (
<AccountSummaryItem
accountId={1}
title='하나머니'
totalMoney={hanaMoney.points}
icons='icons/piggybank.svg'
Expand All @@ -76,6 +77,7 @@ export const MyPage = () => {
accounts.map((item: AccountType) => (
<AccountSummaryItem
key={item.accountId}
accountId={item.accountId}
title={item.name}
totalMoney={item.balance}
icons={
Expand All @@ -84,13 +86,13 @@ export const MyPage = () => {
: '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'
: ''
}
Expand Down

0 comments on commit bbfe950

Please sign in to comment.