1
- import React , { useMemo , useState } from 'react' ;
1
+ import React , { useContext , useMemo , useState } from 'react' ;
2
2
import { useSelector } from 'react-redux' ;
3
3
import { InternalAccount } from '@metamask/keyring-internal-api' ;
4
4
import { isEvmAccountType } from '@metamask/keyring-api' ;
@@ -20,6 +20,7 @@ import {
20
20
Box ,
21
21
Button ,
22
22
ButtonLink ,
23
+ ButtonLinkSize ,
23
24
ButtonSize ,
24
25
ButtonVariant ,
25
26
Text ,
@@ -53,6 +54,12 @@ import {
53
54
getAvatarFallbackLetter ,
54
55
transformOriginToTitle ,
55
56
} from '../../../helpers/utils/util' ;
57
+ import ZENDESK_URLS from '../../../helpers/constants/zendesk-url' ;
58
+ import {
59
+ MetaMetricsEventCategory ,
60
+ MetaMetricsEventName ,
61
+ } from '../../../../shared/constants/metametrics' ;
62
+ import { MetaMetricsContext } from '../../../contexts/metametrics' ;
56
63
import {
57
64
getCaip25PermissionsResponse ,
58
65
getRequestedSessionScopes ,
@@ -88,6 +95,7 @@ export const ConnectPage: React.FC<ConnectPageProps> = ({
88
95
targetSubjectMetadata,
89
96
} ) => {
90
97
const t = useI18nContext ( ) ;
98
+ const trackEvent = useContext ( MetaMetricsContext ) ;
91
99
92
100
const requestedSessionsScopes = getRequestedSessionScopes (
93
101
request . permissions ,
@@ -187,6 +195,18 @@ export const ConnectPage: React.FC<ConnectPageProps> = ({
187
195
188
196
const title = transformOriginToTitle ( targetSubjectMetadata . origin ) ;
189
197
198
+ const handleOpenAccountsModal = ( ) => {
199
+ setShowEditAccountsModal ( true ) ;
200
+ trackEvent ( {
201
+ category : MetaMetricsEventCategory . Navigation ,
202
+ event : MetaMetricsEventName . ViewPermissionedAccounts ,
203
+ properties : {
204
+ location :
205
+ 'Connect view (accounts tab), Permissions toast, Permissions (dapp)' ,
206
+ } ,
207
+ } ) ;
208
+ } ;
209
+
190
210
return (
191
211
< Page
192
212
data-testid = "connect-page"
@@ -201,13 +221,17 @@ export const ConnectPage: React.FC<ConnectPageProps> = ({
201
221
>
202
222
{ targetSubjectMetadata . iconUrl ? (
203
223
< >
204
- < Box style = { { filter : 'blur(16px)' , position : 'absolute' } } >
224
+ < Box
225
+ style = { {
226
+ filter : 'blur(20px) brightness(1.2)' ,
227
+ position : 'absolute' ,
228
+ } }
229
+ >
205
230
< AvatarFavicon
206
231
backgroundColor = { BackgroundColor . backgroundAlternative }
207
232
size = { AvatarFaviconSize . Xl }
208
233
src = { targetSubjectMetadata . iconUrl }
209
234
name = { title }
210
- style = { { filter : 'brightness(1.2)' } }
211
235
/>
212
236
</ Box >
213
237
< AvatarFavicon
@@ -232,10 +256,25 @@ export const ConnectPage: React.FC<ConnectPageProps> = ({
232
256
</ AvatarBase >
233
257
) }
234
258
</ Box >
235
- < Text variant = { TextVariant . headingLg } marginTop = { 2 } >
259
+ < Text variant = { TextVariant . headingLg } marginTop = { 2 } marginBottom = { 2 } >
236
260
{ title }
237
261
</ Text >
238
- < Text > { t ( 'connectionDescription' ) } </ Text >
262
+ < Text >
263
+ { t ( 'connectionDescription' ) }
264
+ < ButtonLink
265
+ paddingLeft = { 1 }
266
+ key = "permission-connect-footer-learn-more-link"
267
+ size = { ButtonLinkSize . Inherit }
268
+ target = "_blank"
269
+ onClick = { ( ) => {
270
+ global . platform . openTab ( {
271
+ url : ZENDESK_URLS . USER_GUIDE_DAPPS ,
272
+ } ) ;
273
+ } }
274
+ >
275
+ { t ( 'learnMoreUpperCase' ) }
276
+ </ ButtonLink >
277
+ </ Text >
239
278
</ Header >
240
279
< Content
241
280
paddingLeft = { 4 }
@@ -261,7 +300,11 @@ export const ConnectPage: React.FC<ConnectPageProps> = ({
261
300
< Box
262
301
backgroundColor = { BackgroundColor . backgroundDefault }
263
302
borderRadius = { BorderRadius . XL }
264
- style = { { overflow : 'auto' , maxHeight : '290px' } }
303
+ style = { {
304
+ overflow : 'auto' ,
305
+ maxHeight : '268px' ,
306
+ scrollbarColor : 'var(--color-icon-muted) transparent' ,
307
+ } }
265
308
>
266
309
{ selectedAccounts . map ( ( account ) => (
267
310
< AccountListItem
@@ -277,7 +320,7 @@ export const ConnectPage: React.FC<ConnectPageProps> = ({
277
320
justifyContent = { JustifyContent . center }
278
321
>
279
322
< ButtonLink
280
- onClick = { ( ) => setShowEditAccountsModal ( true ) }
323
+ onClick = { ( ) => handleOpenAccountsModal ( ) }
281
324
data-testid = "edit"
282
325
>
283
326
{ t ( 'editAccounts' ) }
0 commit comments