@@ -6,8 +6,8 @@ import { OnboardingState } from '@/constants/account';
6
6
import { ButtonAction , ButtonShape , ButtonSize , ButtonType } from '@/constants/buttons' ;
7
7
8
8
import { DialogTypes } from '@/constants/dialogs' ;
9
- import { STRING_KEYS } from '@/constants/localization' ;
10
- import { wallets , WalletType } from '@/constants/wallets' ;
9
+ import { STRING_KEYS , TOOLTIP_STRING_KEYS } from '@/constants/localization' ;
10
+ import { wallets } from '@/constants/wallets' ;
11
11
12
12
import { layoutMixins } from '@/styles/layoutMixins' ;
13
13
import { headerMixins } from '@/styles/headerMixins' ;
@@ -29,6 +29,7 @@ import { getOnboardingState } from '@/state/accountSelectors';
29
29
30
30
import { isTruthy } from '@/lib/isTruthy' ;
31
31
import { truncateAddress } from '@/lib/wallet' ;
32
+ import { WithTooltip } from '@/components/WithTooltip' ;
32
33
33
34
export const AccountMenu = ( ) => {
34
35
const stringGetter = useStringGetter ( ) ;
@@ -53,13 +54,29 @@ export const AccountMenu = () => {
53
54
< Styled . AddressRow >
54
55
< AssetIcon symbol = "DYDX" />
55
56
< Styled . Column >
56
- < Styled . Label > { stringGetter ( { key : STRING_KEYS . DYDX_CHAIN_ADDRESS } ) } </ Styled . Label >
57
+ < WithTooltip
58
+ slotTooltip = {
59
+ < dl >
60
+ < dt >
61
+ { stringGetter ( {
62
+ key : TOOLTIP_STRING_KEYS . DYDX_ADDRESS_BODY ,
63
+ params : {
64
+ DYDX_ADDRESS : < strong > { truncateAddress ( dydxAddress ) } </ strong > ,
65
+ EVM_ADDRESS : truncateAddress ( evmAddress , '0x' ) ,
66
+ } ,
67
+ } ) }
68
+ </ dt >
69
+ </ dl >
70
+ }
71
+ >
72
+ < Styled . Label >
73
+ { stringGetter ( { key : STRING_KEYS . DYDX_CHAIN_ADDRESS } ) }
74
+ </ Styled . Label >
75
+ </ WithTooltip >
57
76
< Styled . Address > { truncateAddress ( dydxAddress ) } </ Styled . Address >
58
77
</ Styled . Column >
59
-
60
- < CopyButton buttonType = "icon" value = { dydxAddress } shape = { ButtonShape . Square } />
61
-
62
- < IconButton
78
+ < Styled . CopyButton buttonType = "icon" value = { dydxAddress } shape = { ButtonShape . Square } />
79
+ < Styled . IconButton
63
80
action = { ButtonAction . Base }
64
81
href = { `${ import . meta. env . VITE_MINTSCAN_URL } /account/${ dydxAddress } ` }
65
82
iconName = { IconName . LinkOut }
@@ -71,17 +88,17 @@ export const AccountMenu = () => {
71
88
{ walletType && (
72
89
< Styled . SourceIcon >
73
90
< Styled . ConnectorIcon iconName = { IconName . AddressConnector } />
74
- < Icon iconComponent = { wallets [ walletType as WalletType ] . icon } />
91
+ < Icon iconComponent = { wallets [ walletType ] . icon } />
75
92
</ Styled . SourceIcon >
76
93
) }
77
94
< Styled . Column >
78
95
< Styled . Label > { stringGetter ( { key : STRING_KEYS . SOURCE_ADDRESS } ) } </ Styled . Label >
79
96
< Styled . Address > { truncateAddress ( evmAddress , '0x' ) } </ Styled . Address >
80
97
</ Styled . Column >
81
98
82
- < CopyButton buttonType = "icon" value = { evmAddress } shape = { ButtonShape . Square } />
99
+ < Styled . CopyButton buttonType = "icon" value = { evmAddress } shape = { ButtonShape . Square } />
83
100
84
- < IconButton
101
+ < Styled . IconButton
85
102
action = { ButtonAction . Base }
86
103
href = { `${ import . meta. env . VITE_ETHERSCAN_URL } /address/${ evmAddress } ` }
87
104
iconName = { IconName . LinkOut }
@@ -135,7 +152,7 @@ export const AccountMenu = () => {
135
152
{ onboardingState === OnboardingState . WalletConnected ? (
136
153
< Styled . WarningIcon iconName = { IconName . Warning } />
137
154
) : onboardingState === OnboardingState . AccountConnected ? (
138
- walletType && < Icon iconComponent = { wallets [ walletType as WalletType ] . icon } />
155
+ walletType && < Icon iconComponent = { wallets [ walletType ] . icon } />
139
156
) : null }
140
157
{ ! isTablet && < Styled . Address > { truncateAddress ( dydxAddress ) } </ Styled . Address > }
141
158
</ Styled . DropdownMenu >
@@ -241,3 +258,13 @@ Styled.Balance = styled.div`
241
258
Styled . BalanceOutput = styled ( Output ) `
242
259
font-size: var(--fontSize-medium);
243
260
` ;
261
+
262
+ Styled . IconButton = styled ( IconButton ) `
263
+ --button-padding: 0 0.25rem;
264
+ --button-border: solid var(--border-width) var(--color-layer-6);
265
+ ` ;
266
+
267
+ Styled . CopyButton = styled ( CopyButton ) `
268
+ --button-padding: 0 0.25rem;
269
+ --button-border: solid var(--border-width) var(--color-layer-6);
270
+ ` ;
0 commit comments