@dynamic-labs/sdk-react-core 3.0.3 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/lib/components/QRCode/QRCode.cjs +2 -2
- package/src/lib/components/QRCode/QRCode.js +2 -2
- package/src/lib/components/WalletInformationCard/WalletInformationCard.cjs +1 -1
- package/src/lib/components/WalletInformationCard/WalletInformationCard.js +1 -1
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/data/api/transactions/blockaid.cjs +23 -0
- package/src/lib/data/api/transactions/blockaid.js +19 -0
- package/src/lib/locale/en/translation.cjs +35 -1
- package/src/lib/locale/en/translation.d.ts +34 -0
- package/src/lib/locale/en/translation.js +35 -1
- package/src/lib/shared/assets/caution-triangle.cjs +54 -0
- package/src/lib/shared/assets/caution-triangle.js +30 -0
- package/src/lib/shared/assets/exclamation-circle.cjs +54 -0
- package/src/lib/shared/assets/exclamation-circle.js +30 -0
- package/src/lib/shared/assets/exclamation.cjs +52 -0
- package/src/lib/shared/assets/exclamation.js +28 -0
- package/src/lib/shared/assets/index.d.ts +5 -0
- package/src/lib/shared/assets/warning-orange.cjs +54 -0
- package/src/lib/shared/assets/warning-orange.js +30 -0
- package/src/lib/shared/assets/warning-red.cjs +54 -0
- package/src/lib/shared/assets/warning-red.js +30 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.js +1 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +1 -0
- package/src/lib/utils/hooks/useResetCookieLocalStorage/useResetCookieLocalStorage.cjs +8 -1
- package/src/lib/utils/hooks/useResetCookieLocalStorage/useResetCookieLocalStorage.js +8 -1
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +148 -114
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +151 -117
- package/src/lib/views/GlobalWalletMaliciousView/GlobalWalletMaliciousView.cjs +139 -0
- package/src/lib/views/GlobalWalletMaliciousView/GlobalWalletMaliciousView.d.ts +11 -0
- package/src/lib/views/GlobalWalletMaliciousView/GlobalWalletMaliciousView.js +134 -0
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.cjs +1 -1
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.js +1 -1
- package/src/lib/views/viewToComponentMap.cjs +2 -0
- package/src/lib/views/viewToComponentMap.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.js +2 -0
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.cjs +3 -3
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.d.ts +1 -0
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.js +3 -3
- package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.cjs +31 -8
- package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.js +31 -8
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
|
-
import { useMemo, useState } from 'react';
|
|
3
|
+
import { useMemo, useState, useCallback } from 'react';
|
|
4
4
|
import { ProviderEnum } from '@dynamic-labs/sdk-api-core';
|
|
5
5
|
import { SocialOAuthErrorCode } from '@dynamic-labs/types';
|
|
6
|
-
import {
|
|
6
|
+
import { SocialAccountAlreadyExistsError, PlatformService, isMobile, Oauth2Service } from '@dynamic-labs/utils';
|
|
7
7
|
import '../../../context/DynamicContext/DynamicContext.js';
|
|
8
8
|
import { logger } from '../../../shared/logger.js';
|
|
9
9
|
import '@dynamic-labs/iconic';
|
|
@@ -28,7 +28,7 @@ import { getProviderByType } from '../../functions/getProviderByType/getProvider
|
|
|
28
28
|
import { randomString } from '../../functions/randomString/randomString.js';
|
|
29
29
|
import '../../../config/ApiEndpoint.js';
|
|
30
30
|
import '../../../store/state/user/user.js';
|
|
31
|
-
import {
|
|
31
|
+
import { telegramSignIn, signInOAuth, telegramVerify, verifyOAuth, getOAuthResult, initAuth, farcasterSignIn, farcasterVerify } from '../../../data/api/oauth/oauth.js';
|
|
32
32
|
import '../../../locale/locale.js';
|
|
33
33
|
import '../../../store/state/projectSettings/projectSettings.js';
|
|
34
34
|
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
@@ -127,11 +127,11 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
127
127
|
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys(environmentId);
|
|
128
128
|
const [isProcessing, setIsProcessing] = useState(false);
|
|
129
129
|
const [error, setError] = useState();
|
|
130
|
-
const clearError = () => {
|
|
130
|
+
const clearError = useCallback(() => {
|
|
131
131
|
setError(undefined);
|
|
132
132
|
setContextError(undefined);
|
|
133
|
-
};
|
|
134
|
-
const onFailed = (provider, reason, options) => {
|
|
133
|
+
}, [setContextError]);
|
|
134
|
+
const onFailed = useCallback((provider, reason, options) => {
|
|
135
135
|
setIsProcessing(false);
|
|
136
136
|
onError === null || onError === void 0 ? void 0 : onError();
|
|
137
137
|
onSettled === null || onSettled === void 0 ? void 0 : onSettled();
|
|
@@ -141,15 +141,15 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
141
141
|
provider,
|
|
142
142
|
type: 'social',
|
|
143
143
|
}, reason);
|
|
144
|
-
};
|
|
145
|
-
const handleError = (provider, code, message, options) => {
|
|
144
|
+
}, [onError, onSettled]);
|
|
145
|
+
const handleError = useCallback((provider, code, message, options) => {
|
|
146
146
|
const error = { code, message };
|
|
147
147
|
logger.error(message);
|
|
148
148
|
setError(error);
|
|
149
149
|
setErrorMessage(code);
|
|
150
150
|
onFailed(provider, { error }, options);
|
|
151
|
-
};
|
|
152
|
-
const checkValidProvider = (provider, authMode) => {
|
|
151
|
+
}, [onFailed, setErrorMessage]);
|
|
152
|
+
const checkValidProvider = useCallback((provider, authMode) => {
|
|
153
153
|
if (!provider) {
|
|
154
154
|
handleError(provider, SocialOAuthErrorCode.NO_PROVIDER, 'Provider is required', { raiseAuthFailure: authMode === 'signin' });
|
|
155
155
|
return false;
|
|
@@ -159,8 +159,8 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
159
159
|
return false;
|
|
160
160
|
}
|
|
161
161
|
return true;
|
|
162
|
-
};
|
|
163
|
-
const linkAccount = (provider, apiCall) => __awaiter(void 0, void 0, void 0, function* () {
|
|
162
|
+
}, [handleError]);
|
|
163
|
+
const linkAccount = useCallback((provider, apiCall) => __awaiter(void 0, void 0, void 0, function* () {
|
|
164
164
|
try {
|
|
165
165
|
const response = yield apiCall();
|
|
166
166
|
if (!response) {
|
|
@@ -174,112 +174,16 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
174
174
|
handleError(provider, SocialOAuthErrorCode.ACCOUNT_ALREADY_LINKED_TO_DIFFERENT_PROFILE, `Social account already linked to a different profile: ${provider}`, { raiseAuthFailure: false });
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
});
|
|
178
|
-
const signInAccount = (provider, apiCall) => __awaiter(void 0, void 0, void 0, function* () {
|
|
177
|
+
}), [handleError, onSettled]);
|
|
178
|
+
const signInAccount = useCallback((provider, apiCall) => __awaiter(void 0, void 0, void 0, function* () {
|
|
179
179
|
yield initAuth$1({
|
|
180
180
|
onError: () => handleError(provider, SocialOAuthErrorCode.SIGNIN_ERROR, `Failed to sign-in with social account: ${provider}`, { raiseAuthFailure: true }),
|
|
181
181
|
onSettled,
|
|
182
182
|
options: { provider },
|
|
183
183
|
verifyFunction: () => apiCall(),
|
|
184
184
|
});
|
|
185
|
-
});
|
|
186
|
-
const
|
|
187
|
-
var _b, _c;
|
|
188
|
-
clearError();
|
|
189
|
-
setIsProcessing(true);
|
|
190
|
-
if (!authMode) {
|
|
191
|
-
logger.error('Auth mode is required. Please use either "link" or "signin"');
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
if (!checkValidProvider(provider, authMode)) {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
// invalid connect request
|
|
198
|
-
if (validator && !validator(provider)) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
dynamicEvents.emit('authInit', {
|
|
202
|
-
option: provider,
|
|
203
|
-
provider,
|
|
204
|
-
type: 'social',
|
|
205
|
-
});
|
|
206
|
-
if (provider === ProviderEnum.Farcaster) {
|
|
207
|
-
return connectWithFarcaster(authMode, {
|
|
208
|
-
captchaToken,
|
|
209
|
-
redirectUrl,
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
const state = randomString(32);
|
|
213
|
-
const verifier = randomString(43);
|
|
214
|
-
// Whether we will use PKCE (code verifier/challenge) for this provider
|
|
215
|
-
const usingPkce = providersRequiringPkce.includes(provider);
|
|
216
|
-
setSocialStorageFor(provider, {
|
|
217
|
-
captchaToken,
|
|
218
|
-
codeVerifier: usingPkce ? verifier : undefined,
|
|
219
|
-
state,
|
|
220
|
-
});
|
|
221
|
-
const loginUrlString = getOauthLoginUrl((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _b !== void 0 ? _b : [], provider);
|
|
222
|
-
if (!loginUrlString) {
|
|
223
|
-
handleError(provider, SocialOAuthErrorCode.NO_OAUTH_URL, `Failed to get login url to connect social account: ${provider}`, { raiseAuthFailure: authMode === 'signin' });
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
const oauthLoginUrl = new URL(loginUrlString);
|
|
227
|
-
oauthLoginUrl.searchParams.set('state', state);
|
|
228
|
-
// only add pkce params for providers that support/require it
|
|
229
|
-
if (usingPkce) {
|
|
230
|
-
const digest = yield digestSHA256(verifier);
|
|
231
|
-
oauthLoginUrl.searchParams.set('code_challenge', encodeBase64URL(digest));
|
|
232
|
-
oauthLoginUrl.searchParams.set('code_challenge_method', 'S256');
|
|
233
|
-
}
|
|
234
|
-
const isMobile$1 = isMobile();
|
|
235
|
-
try {
|
|
236
|
-
const authCode = yield Oauth2Service.getOauthCode({
|
|
237
|
-
apiProvider: getProviderByType((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _c !== void 0 ? _c : [], provider),
|
|
238
|
-
getOAuthResultFromApi: () => getOAuthResult(environmentId, provider, {
|
|
239
|
-
state,
|
|
240
|
-
}),
|
|
241
|
-
initWebAuth: ({ redirectUrl } = {}) => initAuth(environmentId, provider, {
|
|
242
|
-
redirectUrl: redirectUrl
|
|
243
|
-
? removeDynamicOauthParamsFromUrl(redirectUrl)
|
|
244
|
-
: undefined,
|
|
245
|
-
state,
|
|
246
|
-
}),
|
|
247
|
-
isMobile: isMobile$1,
|
|
248
|
-
oauthLoginUrl,
|
|
249
|
-
onSettled,
|
|
250
|
-
provider,
|
|
251
|
-
redirectUrl: redirectUrl !== null && redirectUrl !== void 0 ? redirectUrl : defaultRedirectUrl,
|
|
252
|
-
sessionTimeout,
|
|
253
|
-
setIsProcessing,
|
|
254
|
-
state,
|
|
255
|
-
strategy,
|
|
256
|
-
});
|
|
257
|
-
yield completeConnection({
|
|
258
|
-
authCode,
|
|
259
|
-
authMode,
|
|
260
|
-
captchaToken,
|
|
261
|
-
provider,
|
|
262
|
-
state,
|
|
263
|
-
telegramAuthToken,
|
|
264
|
-
verifier,
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
catch (error) {
|
|
268
|
-
if (!Oauth2Service.isGetOauthCodeError(error)) {
|
|
269
|
-
logger.error('Social connection failed with unexpected error:', error);
|
|
270
|
-
onFailed(provider, { error }, { raiseAuthFailure: authMode === 'signin' });
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
if (error === 'user-cancelled')
|
|
274
|
-
onFailed(provider, 'user-cancelled');
|
|
275
|
-
else {
|
|
276
|
-
handleError(provider, error.code, error.message, {
|
|
277
|
-
raiseAuthFailure: authMode === 'signin',
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
const completeConnection = (_d) => __awaiter(void 0, [_d], void 0, function* ({ authMode, provider, state, authCode, captchaToken, verifier, telegramAuthToken, }) {
|
|
185
|
+
}), [handleError, initAuth$1, onSettled]);
|
|
186
|
+
const completeConnection = useCallback((_a) => __awaiter(void 0, [_a], void 0, function* ({ authMode, provider, state, authCode, captchaToken, verifier, telegramAuthToken, }) {
|
|
283
187
|
try {
|
|
284
188
|
let sessionPublicKey = undefined;
|
|
285
189
|
if (shouldRegisterSessionKeysOnSignin()) {
|
|
@@ -335,8 +239,15 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
335
239
|
logger.error('Social connection failed with unexpected error:', error);
|
|
336
240
|
onFailed(provider, { error }, { raiseAuthFailure: authMode === 'signin' });
|
|
337
241
|
}
|
|
338
|
-
})
|
|
339
|
-
|
|
242
|
+
}), [
|
|
243
|
+
environmentId,
|
|
244
|
+
generateSessionKey,
|
|
245
|
+
linkAccount,
|
|
246
|
+
onFailed,
|
|
247
|
+
shouldRegisterSessionKeysOnSignin,
|
|
248
|
+
signInAccount,
|
|
249
|
+
]);
|
|
250
|
+
const connectWithFarcaster = useCallback((authMode_1, _b) => __awaiter(void 0, [authMode_1, _b], void 0, function* (authMode, { captchaToken, redirectUrl }) {
|
|
340
251
|
const dynamicNonce = consumeNonce();
|
|
341
252
|
const domain = PlatformService.getHost();
|
|
342
253
|
const data = yield connect({
|
|
@@ -408,8 +319,124 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
408
319
|
setShowAuthFlow(false, { clearErrors: false });
|
|
409
320
|
}
|
|
410
321
|
setIsProcessing(false);
|
|
411
|
-
})
|
|
412
|
-
|
|
322
|
+
}), [
|
|
323
|
+
consumeNonce,
|
|
324
|
+
defaultRedirectUrl,
|
|
325
|
+
environmentId,
|
|
326
|
+
generateSessionKey,
|
|
327
|
+
handleError,
|
|
328
|
+
linkAccount,
|
|
329
|
+
onFarcasterUrl,
|
|
330
|
+
setShowAuthFlow,
|
|
331
|
+
shouldRegisterSessionKeysOnSignin,
|
|
332
|
+
signInAccount,
|
|
333
|
+
]);
|
|
334
|
+
const connectSocialAccount = useCallback((_c) => __awaiter(void 0, [_c], void 0, function* ({ authMode, provider, validator, captchaToken, redirectUrl, telegramAuthToken, }) {
|
|
335
|
+
var _d, _e;
|
|
336
|
+
clearError();
|
|
337
|
+
setIsProcessing(true);
|
|
338
|
+
if (!authMode) {
|
|
339
|
+
logger.error('Auth mode is required. Please use either "link" or "signin"');
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
if (!checkValidProvider(provider, authMode)) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
// invalid connect request
|
|
346
|
+
if (validator && !validator(provider)) {
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
dynamicEvents.emit('authInit', {
|
|
350
|
+
option: provider,
|
|
351
|
+
provider,
|
|
352
|
+
type: 'social',
|
|
353
|
+
});
|
|
354
|
+
if (provider === ProviderEnum.Farcaster) {
|
|
355
|
+
return connectWithFarcaster(authMode, {
|
|
356
|
+
captchaToken,
|
|
357
|
+
redirectUrl,
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
const state = randomString(32);
|
|
361
|
+
const verifier = randomString(43);
|
|
362
|
+
// Whether we will use PKCE (code verifier/challenge) for this provider
|
|
363
|
+
const usingPkce = providersRequiringPkce.includes(provider);
|
|
364
|
+
setSocialStorageFor(provider, {
|
|
365
|
+
captchaToken,
|
|
366
|
+
codeVerifier: usingPkce ? verifier : undefined,
|
|
367
|
+
state,
|
|
368
|
+
});
|
|
369
|
+
const loginUrlString = getOauthLoginUrl((_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _d !== void 0 ? _d : [], provider);
|
|
370
|
+
if (!loginUrlString) {
|
|
371
|
+
handleError(provider, SocialOAuthErrorCode.NO_OAUTH_URL, `Failed to get login url to connect social account: ${provider}`, { raiseAuthFailure: authMode === 'signin' });
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
const oauthLoginUrl = new URL(loginUrlString);
|
|
375
|
+
oauthLoginUrl.searchParams.set('state', state);
|
|
376
|
+
// only add pkce params for providers that support/require it
|
|
377
|
+
if (usingPkce) {
|
|
378
|
+
const digest = yield digestSHA256(verifier);
|
|
379
|
+
oauthLoginUrl.searchParams.set('code_challenge', encodeBase64URL(digest));
|
|
380
|
+
oauthLoginUrl.searchParams.set('code_challenge_method', 'S256');
|
|
381
|
+
}
|
|
382
|
+
const isMobile$1 = isMobile();
|
|
383
|
+
try {
|
|
384
|
+
const authCode = yield Oauth2Service.getOauthCode({
|
|
385
|
+
apiProvider: getProviderByType((_e = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _e !== void 0 ? _e : [], provider),
|
|
386
|
+
getOAuthResultFromApi: () => getOAuthResult(environmentId, provider, {
|
|
387
|
+
state,
|
|
388
|
+
}),
|
|
389
|
+
initWebAuth: ({ redirectUrl } = {}) => initAuth(environmentId, provider, {
|
|
390
|
+
redirectUrl: redirectUrl
|
|
391
|
+
? removeDynamicOauthParamsFromUrl(redirectUrl)
|
|
392
|
+
: undefined,
|
|
393
|
+
state,
|
|
394
|
+
}),
|
|
395
|
+
isMobile: isMobile$1,
|
|
396
|
+
oauthLoginUrl,
|
|
397
|
+
onSettled,
|
|
398
|
+
provider,
|
|
399
|
+
redirectUrl: redirectUrl !== null && redirectUrl !== void 0 ? redirectUrl : defaultRedirectUrl,
|
|
400
|
+
sessionTimeout,
|
|
401
|
+
setIsProcessing,
|
|
402
|
+
state,
|
|
403
|
+
strategy,
|
|
404
|
+
});
|
|
405
|
+
yield completeConnection({
|
|
406
|
+
authCode,
|
|
407
|
+
authMode,
|
|
408
|
+
captchaToken,
|
|
409
|
+
provider,
|
|
410
|
+
state,
|
|
411
|
+
telegramAuthToken,
|
|
412
|
+
verifier,
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
catch (error) {
|
|
416
|
+
if (Oauth2Service.isGetOauthCodeError(error)) {
|
|
417
|
+
handleError(provider, error.code, error.message, {
|
|
418
|
+
raiseAuthFailure: authMode === 'signin',
|
|
419
|
+
});
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
logger.error('Social connection failed with unexpected error:', error);
|
|
423
|
+
onFailed(provider, { error }, { raiseAuthFailure: authMode === 'signin' });
|
|
424
|
+
}
|
|
425
|
+
}), [
|
|
426
|
+
checkValidProvider,
|
|
427
|
+
clearError,
|
|
428
|
+
completeConnection,
|
|
429
|
+
connectWithFarcaster,
|
|
430
|
+
defaultRedirectUrl,
|
|
431
|
+
environmentId,
|
|
432
|
+
handleError,
|
|
433
|
+
onFailed,
|
|
434
|
+
onSettled,
|
|
435
|
+
projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers,
|
|
436
|
+
sessionTimeout,
|
|
437
|
+
strategy,
|
|
438
|
+
]);
|
|
439
|
+
return useMemo(() => ({
|
|
413
440
|
checkValidProvider,
|
|
414
441
|
completeConnection,
|
|
415
442
|
connectSocialAccount,
|
|
@@ -418,7 +445,14 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
418
445
|
isProcessing,
|
|
419
446
|
setError,
|
|
420
447
|
setIsProcessing,
|
|
421
|
-
}
|
|
448
|
+
}), [
|
|
449
|
+
checkValidProvider,
|
|
450
|
+
completeConnection,
|
|
451
|
+
connectSocialAccount,
|
|
452
|
+
error,
|
|
453
|
+
handleError,
|
|
454
|
+
isProcessing,
|
|
455
|
+
]);
|
|
422
456
|
};
|
|
423
457
|
const removeDynamicOauthParamsFromUrl = (url) => {
|
|
424
458
|
const urlObject = new URL(url);
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var reactI18next = require('react-i18next');
|
|
8
|
+
require('@dynamic-labs/sdk-api-core');
|
|
9
|
+
require('../../shared/logger.cjs');
|
|
10
|
+
require('@dynamic-labs/iconic');
|
|
11
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
12
|
+
require('../../context/ViewContext/ViewContext.cjs');
|
|
13
|
+
require('react');
|
|
14
|
+
var exclamation = require('../../shared/assets/exclamation.cjs');
|
|
15
|
+
var exclamationCircle = require('../../shared/assets/exclamation-circle.cjs');
|
|
16
|
+
var cautionTriangle = require('../../shared/assets/caution-triangle.cjs');
|
|
17
|
+
var warningRed = require('../../shared/assets/warning-red.cjs');
|
|
18
|
+
var warningOrange = require('../../shared/assets/warning-orange.cjs');
|
|
19
|
+
require('@dynamic-labs/wallet-book');
|
|
20
|
+
require('@dynamic-labs/utils');
|
|
21
|
+
require('../../utils/constants/colors.cjs');
|
|
22
|
+
require('../../utils/constants/values.cjs');
|
|
23
|
+
require('../../store/state/loadingAndLifecycle.cjs');
|
|
24
|
+
require('../../shared/consts/index.cjs');
|
|
25
|
+
var DynamicWidgetContext = require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
26
|
+
require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
27
|
+
require('../../components/Alert/Alert.cjs');
|
|
28
|
+
require('../../events/dynamicEvents.cjs');
|
|
29
|
+
require('../../../../_virtual/_tslib.cjs');
|
|
30
|
+
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
31
|
+
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
32
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
33
|
+
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
34
|
+
require('@dynamic-labs/multi-wallet');
|
|
35
|
+
require('react-international-phone');
|
|
36
|
+
require('../../config/ApiEndpoint.cjs');
|
|
37
|
+
require('../../store/state/user/user.cjs');
|
|
38
|
+
require('../../locale/locale.cjs');
|
|
39
|
+
require('../../store/state/projectSettings/projectSettings.cjs');
|
|
40
|
+
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
41
|
+
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
42
|
+
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
43
|
+
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
44
|
+
require('react-dom');
|
|
45
|
+
require('../../context/WalletContext/WalletContext.cjs');
|
|
46
|
+
require('../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
|
|
47
|
+
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
48
|
+
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
|
|
49
|
+
require('@dynamic-labs/types');
|
|
50
|
+
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
51
|
+
require('yup');
|
|
52
|
+
require('../../context/MockContext/MockContext.cjs');
|
|
53
|
+
require('../CollectUserDataView/useFields.cjs');
|
|
54
|
+
require('../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
55
|
+
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
56
|
+
require('@dynamic-labs/rpc-providers');
|
|
57
|
+
require('../../store/state/environmentId.cjs');
|
|
58
|
+
require('../../store/state/walletConnectorOptions.cjs');
|
|
59
|
+
var Typography = require('../../components/Typography/Typography.cjs');
|
|
60
|
+
require('../../context/FooterAnimationContext/index.cjs');
|
|
61
|
+
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
62
|
+
require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
63
|
+
require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
64
|
+
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
65
|
+
require('../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
66
|
+
require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
67
|
+
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
68
|
+
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
69
|
+
require('react-focus-lock');
|
|
70
|
+
require('../../components/IconButton/IconButton.cjs');
|
|
71
|
+
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
72
|
+
var TypographyButton = require('../../components/TypographyButton/TypographyButton.cjs');
|
|
73
|
+
require('formik');
|
|
74
|
+
require('../../store/state/sendBalances.cjs');
|
|
75
|
+
require('../../components/Input/Input.cjs');
|
|
76
|
+
require('../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
77
|
+
require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
78
|
+
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
79
|
+
require('../../../polyfills.cjs');
|
|
80
|
+
require('../../context/ErrorBoundary/ErrorBoundaryBase.cjs');
|
|
81
|
+
require('../../context/ErrorBoundary/ErrorBoundaryContext.cjs');
|
|
82
|
+
require('../../widgets/DynamicBridgeWidget/context/DynamicBridgeWidgetContext/DynamicBridgeWidgetContext.cjs');
|
|
83
|
+
require('../../widgets/DynamicWidget/components/DynamicWidgetCard/DynamicWidgetCard.cjs');
|
|
84
|
+
require('../../components/IsBrowser/IsBrowser.cjs');
|
|
85
|
+
require('../../context/WidgetRegistry/WidgetRegistryContextProvider.cjs');
|
|
86
|
+
require('../../context/FundingContext/FundingContext.cjs');
|
|
87
|
+
require('../../components/Popper/Popper/Popper.cjs');
|
|
88
|
+
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
89
|
+
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
90
|
+
require('@hcaptcha/react-hcaptcha');
|
|
91
|
+
require('../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
92
|
+
require('../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
93
|
+
require('../../context/SendBalanceContext/SendBalanceContext.cjs');
|
|
94
|
+
require('../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
95
|
+
require('../../context/ConnectWithOtpContext/constants.cjs');
|
|
96
|
+
require('../../context/ReinitializeContext/ReinitializeContextProvider.cjs');
|
|
97
|
+
require('../../store/state/tokenBalances.cjs');
|
|
98
|
+
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
99
|
+
require('qrcode');
|
|
100
|
+
|
|
101
|
+
const GlobalWalletMaliciousView = ({ maliciousSiteInfo }) => {
|
|
102
|
+
const { t } = reactI18next.useTranslation();
|
|
103
|
+
const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
104
|
+
const { setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
|
|
105
|
+
const handleBack = () => {
|
|
106
|
+
setDynamicWidgetView('global-wallet');
|
|
107
|
+
setShowAuthFlow(false, {
|
|
108
|
+
ignoreIfIsEmbeddedWidget: false,
|
|
109
|
+
performMultiWalletChecks: false,
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
const handleProceed = () => {
|
|
113
|
+
var _a;
|
|
114
|
+
(_a = maliciousSiteInfo.proceedFlow) === null || _a === void 0 ? void 0 : _a.call(maliciousSiteInfo);
|
|
115
|
+
};
|
|
116
|
+
return (jsxRuntime.jsx("div", { className: 'malicious-site-view', children: jsxRuntime.jsx("div", { className: 'popup-content', children: jsxRuntime.jsxs("div", { className: 'wallet-connection-view', children: [jsxRuntime.jsxs("div", { className: 'warning-icon-container', style: { position: 'relative' }, children: [maliciousSiteInfo.isDefinitelyMalicious ? (jsxRuntime.jsx(warningRed.ReactComponent, { className: 'warning-icon' })) : (jsxRuntime.jsx(warningOrange.ReactComponent, { className: 'warning-icon' })), jsxRuntime.jsx(exclamation.ReactComponent, { className: 'exclamation-icon', style: {
|
|
117
|
+
left: '50%',
|
|
118
|
+
position: 'absolute',
|
|
119
|
+
top: '50%',
|
|
120
|
+
transform: 'translate(-50%, -50%)',
|
|
121
|
+
} })] }), jsxRuntime.jsx(Typography.Typography, { className: 'connection-title', variant: 'title', font: 'bold', color: 'primary', children: maliciousSiteInfo.isDefinitelyMalicious
|
|
122
|
+
? t('global_wallet.malicious_site.certain.title')
|
|
123
|
+
: t('global_wallet.malicious_site.unknown.title') }), jsxRuntime.jsxs("div", { className: `subtitle-container ${maliciousSiteInfo.isDefinitelyMalicious
|
|
124
|
+
? 'definitely-malicious'
|
|
125
|
+
: 'unknown'}`, children: [jsxRuntime.jsxs("div", { className: 'subtitle-header-container', children: [maliciousSiteInfo.isDefinitelyMalicious ? (jsxRuntime.jsx(exclamationCircle.ReactComponent, { className: 'caution-icon' })) : (jsxRuntime.jsx(cautionTriangle.ReactComponent, { className: 'caution-icon' })), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', className: 'subtitle-header', color: 'primary', children: maliciousSiteInfo.isDefinitelyMalicious
|
|
126
|
+
? t('global_wallet.malicious_site.certain.subtitle_header')
|
|
127
|
+
: t('global_wallet.malicious_site.unknown.subtitle_header') })] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', className: 'subtitle', color: 'secondary', children: maliciousSiteInfo.isDefinitelyMalicious
|
|
128
|
+
? t('global_wallet.malicious_site.certain.subtitle_text')
|
|
129
|
+
: t('global_wallet.malicious_site.unknown.subtitle_text') })] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', className: 'site-info', color: 'secondary', children: maliciousSiteInfo.url }), jsxRuntime.jsxs("div", { className: 'button-group', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'cancel-button', buttonVariant: 'primary', type: 'submit', buttonPadding: 'large', onClick: handleBack, copykey: 'global_wallet.malicious_site.go_back', children: maliciousSiteInfo.isDefinitelyMalicious
|
|
130
|
+
? t('global_wallet.malicious_site.certain.go_back')
|
|
131
|
+
: t('global_wallet.malicious_site.unknown.go_back') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'proceed-button', buttonVariant: 'secondary', type: 'submit', buttonPadding: 'large', onClick: handleProceed, copykey: 'global_wallet.malicious_site.proceed', typographyProps: {
|
|
132
|
+
color: 'error-1',
|
|
133
|
+
}, children: maliciousSiteInfo.isDefinitelyMalicious
|
|
134
|
+
? t('global_wallet.malicious_site.certain.proceed')
|
|
135
|
+
: t('global_wallet.malicious_site.unknown.proceed') })] })] }) }) }));
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
exports.GlobalWalletMaliciousView = GlobalWalletMaliciousView;
|
|
139
|
+
exports["default"] = GlobalWalletMaliciousView;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MaliciousSiteInfo {
|
|
3
|
+
isDefinitelyMalicious: boolean;
|
|
4
|
+
url: string;
|
|
5
|
+
proceedFlow: () => void;
|
|
6
|
+
}
|
|
7
|
+
export interface GlobalWalletMaliciousViewProps {
|
|
8
|
+
maliciousSiteInfo: MaliciousSiteInfo;
|
|
9
|
+
}
|
|
10
|
+
export declare const GlobalWalletMaliciousView: React.FC<GlobalWalletMaliciousViewProps>;
|
|
11
|
+
export default GlobalWalletMaliciousView;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import '@dynamic-labs/sdk-api-core';
|
|
5
|
+
import '../../shared/logger.js';
|
|
6
|
+
import '@dynamic-labs/iconic';
|
|
7
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
8
|
+
import '../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import 'react';
|
|
10
|
+
import { ReactComponent as SvgExclamation } from '../../shared/assets/exclamation.js';
|
|
11
|
+
import { ReactComponent as SvgExclamationCircle } from '../../shared/assets/exclamation-circle.js';
|
|
12
|
+
import { ReactComponent as SvgCautionTriangle } from '../../shared/assets/caution-triangle.js';
|
|
13
|
+
import { ReactComponent as SvgWarningRed } from '../../shared/assets/warning-red.js';
|
|
14
|
+
import { ReactComponent as SvgWarningOrange } from '../../shared/assets/warning-orange.js';
|
|
15
|
+
import '@dynamic-labs/wallet-book';
|
|
16
|
+
import '@dynamic-labs/utils';
|
|
17
|
+
import '../../utils/constants/colors.js';
|
|
18
|
+
import '../../utils/constants/values.js';
|
|
19
|
+
import '../../store/state/loadingAndLifecycle.js';
|
|
20
|
+
import '../../shared/consts/index.js';
|
|
21
|
+
import { useWidgetContext } from '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
22
|
+
import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
23
|
+
import '../../components/Alert/Alert.js';
|
|
24
|
+
import '../../events/dynamicEvents.js';
|
|
25
|
+
import '../../../../_virtual/_tslib.js';
|
|
26
|
+
import '../../context/DynamicContext/DynamicContext.js';
|
|
27
|
+
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
28
|
+
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
29
|
+
import '../../context/ErrorContext/ErrorContext.js';
|
|
30
|
+
import '@dynamic-labs/multi-wallet';
|
|
31
|
+
import 'react-international-phone';
|
|
32
|
+
import '../../config/ApiEndpoint.js';
|
|
33
|
+
import '../../store/state/user/user.js';
|
|
34
|
+
import '../../locale/locale.js';
|
|
35
|
+
import '../../store/state/projectSettings/projectSettings.js';
|
|
36
|
+
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
37
|
+
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
38
|
+
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
39
|
+
import '../../context/VerificationContext/VerificationContext.js';
|
|
40
|
+
import 'react-dom';
|
|
41
|
+
import '../../context/WalletContext/WalletContext.js';
|
|
42
|
+
import '../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
|
|
43
|
+
import '../../context/ThemeContext/ThemeContext.js';
|
|
44
|
+
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
|
|
45
|
+
import '@dynamic-labs/types';
|
|
46
|
+
import '../../context/LoadingContext/LoadingContext.js';
|
|
47
|
+
import 'yup';
|
|
48
|
+
import '../../context/MockContext/MockContext.js';
|
|
49
|
+
import '../CollectUserDataView/useFields.js';
|
|
50
|
+
import '../../context/FieldsStateContext/FieldsStateContext.js';
|
|
51
|
+
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
52
|
+
import '@dynamic-labs/rpc-providers';
|
|
53
|
+
import '../../store/state/environmentId.js';
|
|
54
|
+
import '../../store/state/walletConnectorOptions.js';
|
|
55
|
+
import { Typography } from '../../components/Typography/Typography.js';
|
|
56
|
+
import '../../context/FooterAnimationContext/index.js';
|
|
57
|
+
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
58
|
+
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
59
|
+
import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
60
|
+
import '../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
61
|
+
import '../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.js';
|
|
62
|
+
import '../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
63
|
+
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
64
|
+
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
65
|
+
import 'react-focus-lock';
|
|
66
|
+
import '../../components/IconButton/IconButton.js';
|
|
67
|
+
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
68
|
+
import { TypographyButton } from '../../components/TypographyButton/TypographyButton.js';
|
|
69
|
+
import 'formik';
|
|
70
|
+
import '../../store/state/sendBalances.js';
|
|
71
|
+
import '../../components/Input/Input.js';
|
|
72
|
+
import '../TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
73
|
+
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
74
|
+
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
75
|
+
import '../../../polyfills.js';
|
|
76
|
+
import '../../context/ErrorBoundary/ErrorBoundaryBase.js';
|
|
77
|
+
import '../../context/ErrorBoundary/ErrorBoundaryContext.js';
|
|
78
|
+
import '../../widgets/DynamicBridgeWidget/context/DynamicBridgeWidgetContext/DynamicBridgeWidgetContext.js';
|
|
79
|
+
import '../../widgets/DynamicWidget/components/DynamicWidgetCard/DynamicWidgetCard.js';
|
|
80
|
+
import '../../components/IsBrowser/IsBrowser.js';
|
|
81
|
+
import '../../context/WidgetRegistry/WidgetRegistryContextProvider.js';
|
|
82
|
+
import '../../context/FundingContext/FundingContext.js';
|
|
83
|
+
import '../../components/Popper/Popper/Popper.js';
|
|
84
|
+
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
85
|
+
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
86
|
+
import '@hcaptcha/react-hcaptcha';
|
|
87
|
+
import '../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
88
|
+
import '../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
89
|
+
import '../../context/SendBalanceContext/SendBalanceContext.js';
|
|
90
|
+
import '../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
91
|
+
import '../../context/ConnectWithOtpContext/constants.js';
|
|
92
|
+
import '../../context/ReinitializeContext/ReinitializeContextProvider.js';
|
|
93
|
+
import '../../store/state/tokenBalances.js';
|
|
94
|
+
import '../../components/InlineWidget/InlineWidget.js';
|
|
95
|
+
import 'qrcode';
|
|
96
|
+
|
|
97
|
+
const GlobalWalletMaliciousView = ({ maliciousSiteInfo }) => {
|
|
98
|
+
const { t } = useTranslation();
|
|
99
|
+
const { setDynamicWidgetView } = useWidgetContext();
|
|
100
|
+
const { setShowAuthFlow } = useInternalDynamicContext();
|
|
101
|
+
const handleBack = () => {
|
|
102
|
+
setDynamicWidgetView('global-wallet');
|
|
103
|
+
setShowAuthFlow(false, {
|
|
104
|
+
ignoreIfIsEmbeddedWidget: false,
|
|
105
|
+
performMultiWalletChecks: false,
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
const handleProceed = () => {
|
|
109
|
+
var _a;
|
|
110
|
+
(_a = maliciousSiteInfo.proceedFlow) === null || _a === void 0 ? void 0 : _a.call(maliciousSiteInfo);
|
|
111
|
+
};
|
|
112
|
+
return (jsx("div", { className: 'malicious-site-view', children: jsx("div", { className: 'popup-content', children: jsxs("div", { className: 'wallet-connection-view', children: [jsxs("div", { className: 'warning-icon-container', style: { position: 'relative' }, children: [maliciousSiteInfo.isDefinitelyMalicious ? (jsx(SvgWarningRed, { className: 'warning-icon' })) : (jsx(SvgWarningOrange, { className: 'warning-icon' })), jsx(SvgExclamation, { className: 'exclamation-icon', style: {
|
|
113
|
+
left: '50%',
|
|
114
|
+
position: 'absolute',
|
|
115
|
+
top: '50%',
|
|
116
|
+
transform: 'translate(-50%, -50%)',
|
|
117
|
+
} })] }), jsx(Typography, { className: 'connection-title', variant: 'title', font: 'bold', color: 'primary', children: maliciousSiteInfo.isDefinitelyMalicious
|
|
118
|
+
? t('global_wallet.malicious_site.certain.title')
|
|
119
|
+
: t('global_wallet.malicious_site.unknown.title') }), jsxs("div", { className: `subtitle-container ${maliciousSiteInfo.isDefinitelyMalicious
|
|
120
|
+
? 'definitely-malicious'
|
|
121
|
+
: 'unknown'}`, children: [jsxs("div", { className: 'subtitle-header-container', children: [maliciousSiteInfo.isDefinitelyMalicious ? (jsx(SvgExclamationCircle, { className: 'caution-icon' })) : (jsx(SvgCautionTriangle, { className: 'caution-icon' })), jsx(Typography, { variant: 'body_normal', className: 'subtitle-header', color: 'primary', children: maliciousSiteInfo.isDefinitelyMalicious
|
|
122
|
+
? t('global_wallet.malicious_site.certain.subtitle_header')
|
|
123
|
+
: t('global_wallet.malicious_site.unknown.subtitle_header') })] }), jsx(Typography, { variant: 'body_normal', className: 'subtitle', color: 'secondary', children: maliciousSiteInfo.isDefinitelyMalicious
|
|
124
|
+
? t('global_wallet.malicious_site.certain.subtitle_text')
|
|
125
|
+
: t('global_wallet.malicious_site.unknown.subtitle_text') })] }), jsx(Typography, { variant: 'body_normal', className: 'site-info', color: 'secondary', children: maliciousSiteInfo.url }), jsxs("div", { className: 'button-group', children: [jsx(TypographyButton, { buttonClassName: 'cancel-button', buttonVariant: 'primary', type: 'submit', buttonPadding: 'large', onClick: handleBack, copykey: 'global_wallet.malicious_site.go_back', children: maliciousSiteInfo.isDefinitelyMalicious
|
|
126
|
+
? t('global_wallet.malicious_site.certain.go_back')
|
|
127
|
+
: t('global_wallet.malicious_site.unknown.go_back') }), jsx(TypographyButton, { buttonClassName: 'proceed-button', buttonVariant: 'secondary', type: 'submit', buttonPadding: 'large', onClick: handleProceed, copykey: 'global_wallet.malicious_site.proceed', typographyProps: {
|
|
128
|
+
color: 'error-1',
|
|
129
|
+
}, children: maliciousSiteInfo.isDefinitelyMalicious
|
|
130
|
+
? t('global_wallet.malicious_site.certain.proceed')
|
|
131
|
+
: t('global_wallet.malicious_site.unknown.proceed') })] })] }) }) }));
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export { GlobalWalletMaliciousView, GlobalWalletMaliciousView as default };
|
|
@@ -126,7 +126,7 @@ const MfaChooseDeviceView = ({ isInitialSetup = true, }) => {
|
|
|
126
126
|
? t('dyn_mfa.choose_device_view.title')
|
|
127
127
|
: t('dyn_mfa.choose_device_view.choose_another_method') }) }) }), jsxRuntime.jsxs("div", { className: 'mfa-choose-device-view__body', "data-testid": 'mfa-choose-device-view', children: [jsxRuntime.jsx(secureAccount.ReactComponent, {}), jsxRuntime.jsx(Typography.Typography, { className: 'mfa-choose-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', children: isInitialSetup
|
|
128
128
|
? t('dyn_mfa.choose_device_view.select_options')
|
|
129
|
-
: t('dyn_mfa.choose_device_view.choose_another_method_description') }), mfaOptions.map((option) => (jsxRuntime.jsxs(Button.Button, { buttonClassName: 'mfa-choose-device-view__button', expanded: true, onClick: () => handleClick(option), children: [jsxRuntime.jsxs("div", { className: 'mfa-choose-device-view__button__header', children: [jsxRuntime.jsx(Typography.Typography, { copykey: option.labelKey, children: t(option.labelKey) }), jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'mfa-choose-device-view__icon--rotate' })] }), jsxRuntime.jsx(Typography.Typography, { className: 'mfa-choose-device-view__button__description', color: 'secondary', copykey: option.descriptionKey, children: t(option.descriptionKey) })] }, option.type))), jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-choose-device-view__logout', onClick: handleLogOut, copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.choose_device_view.logout') })] })] }));
|
|
129
|
+
: t('dyn_mfa.choose_device_view.choose_another_method_description') }), mfaOptions.map((option) => (jsxRuntime.jsxs(Button.Button, { buttonClassName: 'mfa-choose-device-view__button', expanded: true, onClick: () => handleClick(option), children: [jsxRuntime.jsxs("div", { className: 'mfa-choose-device-view__button__header', children: [jsxRuntime.jsx(Typography.Typography, { copykey: option.labelKey, color: 'primary', children: t(option.labelKey) }), jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'mfa-choose-device-view__icon--rotate' })] }), jsxRuntime.jsx(Typography.Typography, { className: 'mfa-choose-device-view__button__description', color: 'secondary', copykey: option.descriptionKey, children: t(option.descriptionKey) })] }, option.type))), jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-choose-device-view__logout', onClick: handleLogOut, copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.choose_device_view.logout') })] })] }));
|
|
130
130
|
};
|
|
131
131
|
|
|
132
132
|
exports.MfaChooseDeviceView = MfaChooseDeviceView;
|