Skip to content

Commit 7e09643

Browse files
authored
fix: Cp-13289 link to account amnagement (#782)
1 parent 12a7689 commit 7e09643

File tree

1 file changed

+17
-4
lines changed
  • apps/next/src/pages/Portfolio/components/PortfolioHome/components/AccountInfo/components

1 file changed

+17
-4
lines changed

apps/next/src/pages/Portfolio/components/PortfolioHome/components/AccountInfo/components/WalletSummaryInfo.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { WalletIcon } from '@/components/WalletIcon';
55
import { MdNavigateNext } from 'react-icons/md';
66
import { ClickableStack } from '../styled';
77
import { TruncatedText } from '@/components/Header/components/styledComponents';
8+
import { IMPORTED_ACCOUNTS_WALLET_ID } from '@core/types';
9+
import { useCallback } from 'react';
810

911
type Props = {
1012
walletSummary: WalletSummary;
@@ -14,16 +16,27 @@ export const WalletSummaryInfo = ({ walletSummary }: Props) => {
1416
const history = useHistory();
1517
const theme = useTheme();
1618

19+
const handleClick = useCallback(
20+
(e: React.MouseEvent<HTMLDivElement>) => {
21+
e.stopPropagation();
22+
23+
const route =
24+
walletSummary.id === IMPORTED_ACCOUNTS_WALLET_ID
25+
? '/account-management'
26+
: `/wallet/${walletSummary.id}`;
27+
28+
history.push(route);
29+
},
30+
[history, walletSummary.id],
31+
);
32+
1733
return (
1834
<ClickableStack
1935
direction="row"
2036
alignItems="center"
2137
maxWidth="75%"
2238
position="relative"
23-
onClick={(e) => {
24-
e.stopPropagation();
25-
history.push(`/wallet/${walletSummary.id}`);
26-
}}
39+
onClick={handleClick}
2740
>
2841
<Box flexShrink={0} display="flex" alignItems="center" marginRight={0.5}>
2942
<WalletIcon

0 commit comments

Comments
 (0)