@reown/appkit-react-native 0.0.0-feat-multi-social-20250701154123 → 0.0.0-feat-multi-social-20250703185818
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/lib/commonjs/AppKit.js +18 -11
- package/lib/commonjs/AppKit.js.map +1 -1
- package/lib/commonjs/connectors/WalletConnectConnector.js +15 -3
- package/lib/commonjs/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/commonjs/modal/w3m-router/index.js +0 -9
- package/lib/commonjs/modal/w3m-router/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-activity/index.js +4 -4
- package/lib/commonjs/partials/w3m-account-activity/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-tokens/index.js +11 -10
- package/lib/commonjs/partials/w3m-account-tokens/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-wallet-features/index.js +10 -10
- package/lib/commonjs/partials/w3m-account-wallet-features/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-header/index.js +0 -3
- package/lib/commonjs/partials/w3m-header/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-send-input-token/index.js +3 -3
- package/lib/commonjs/partials/w3m-send-input-token/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-send-input-token/utils.js +2 -2
- package/lib/commonjs/partials/w3m-send-input-token/utils.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/components/auth-buttons.js +4 -13
- package/lib/commonjs/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/index.js +19 -32
- package/lib/commonjs/views/w3m-account-default-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-account-view/index.js +11 -22
- package/lib/commonjs/views/w3m-account-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-account-view/styles.js +0 -5
- package/lib/commonjs/views/w3m-account-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/social-login-list.js +14 -7
- package/lib/commonjs/views/w3m-connect-view/components/social-login-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-siwe-view/index.js +10 -8
- package/lib/commonjs/views/w3m-connecting-siwe-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-social-view/index.js +1 -1
- package/lib/commonjs/views/w3m-connecting-social-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-view/index.js +1 -1
- package/lib/commonjs/views/w3m-swap-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js +5 -4
- package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-receive-view/index.js +10 -12
- package/lib/commonjs/views/w3m-wallet-receive-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-preview-view/index.js +1 -1
- package/lib/commonjs/views/w3m-wallet-send-preview-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-select-token-view/index.js +7 -9
- package/lib/commonjs/views/w3m-wallet-send-select-token-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-view/index.js +5 -5
- package/lib/commonjs/views/w3m-wallet-send-view/index.js.map +1 -1
- package/lib/module/AppKit.js +18 -11
- package/lib/module/AppKit.js.map +1 -1
- package/lib/module/connectors/WalletConnectConnector.js +15 -3
- package/lib/module/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/module/modal/w3m-router/index.js +0 -9
- package/lib/module/modal/w3m-router/index.js.map +1 -1
- package/lib/module/partials/w3m-account-activity/index.js +5 -5
- package/lib/module/partials/w3m-account-activity/index.js.map +1 -1
- package/lib/module/partials/w3m-account-tokens/index.js +12 -11
- package/lib/module/partials/w3m-account-tokens/index.js.map +1 -1
- package/lib/module/partials/w3m-account-wallet-features/index.js +11 -11
- package/lib/module/partials/w3m-account-wallet-features/index.js.map +1 -1
- package/lib/module/partials/w3m-header/index.js +0 -3
- package/lib/module/partials/w3m-header/index.js.map +1 -1
- package/lib/module/partials/w3m-send-input-token/index.js +3 -3
- package/lib/module/partials/w3m-send-input-token/index.js.map +1 -1
- package/lib/module/partials/w3m-send-input-token/utils.js +2 -2
- package/lib/module/partials/w3m-send-input-token/utils.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/components/auth-buttons.js +5 -14
- package/lib/module/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/index.js +20 -33
- package/lib/module/views/w3m-account-default-view/index.js.map +1 -1
- package/lib/module/views/w3m-account-view/index.js +13 -24
- package/lib/module/views/w3m-account-view/index.js.map +1 -1
- package/lib/module/views/w3m-account-view/styles.js +0 -5
- package/lib/module/views/w3m-account-view/styles.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/social-login-list.js +14 -7
- package/lib/module/views/w3m-connect-view/components/social-login-list.js.map +1 -1
- package/lib/module/views/w3m-connecting-siwe-view/index.js +11 -9
- package/lib/module/views/w3m-connecting-siwe-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-social-view/index.js +1 -1
- package/lib/module/views/w3m-connecting-social-view/index.js.map +1 -1
- package/lib/module/views/w3m-swap-view/index.js +2 -2
- package/lib/module/views/w3m-swap-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-compatible-networks-view/index.js +6 -5
- package/lib/module/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-receive-view/index.js +11 -13
- package/lib/module/views/w3m-wallet-receive-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-preview-view/index.js +1 -1
- package/lib/module/views/w3m-wallet-send-preview-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-select-token-view/index.js +8 -10
- package/lib/module/views/w3m-wallet-send-select-token-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-view/index.js +6 -6
- package/lib/module/views/w3m-wallet-send-view/index.js.map +1 -1
- package/lib/typescript/AppKit.d.ts +1 -1
- package/lib/typescript/AppKit.d.ts.map +1 -1
- package/lib/typescript/connectors/WalletConnectConnector.d.ts +2 -2
- package/lib/typescript/connectors/WalletConnectConnector.d.ts.map +1 -1
- package/lib/typescript/hooks/useAppKitEvents.d.ts +0 -9
- package/lib/typescript/hooks/useAppKitEvents.d.ts.map +1 -1
- package/lib/typescript/modal/w3m-router/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-account-activity/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-account-tokens/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-account-wallet-features/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-header/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-account-default-view/components/auth-buttons.d.ts.map +1 -1
- package/lib/typescript/views/w3m-account-default-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-account-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-account-view/styles.d.ts +0 -5
- package/lib/typescript/views/w3m-account-view/styles.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-view/components/social-login-list.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connecting-siwe-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-compatible-networks-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-receive-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-send-select-token-view/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/AppKit.ts +24 -12
- package/src/connectors/WalletConnectConnector.ts +25 -6
- package/src/modal/w3m-router/index.tsx +0 -9
- package/src/partials/w3m-account-activity/index.tsx +4 -5
- package/src/partials/w3m-account-tokens/index.tsx +10 -9
- package/src/partials/w3m-account-wallet-features/index.tsx +7 -15
- package/src/partials/w3m-header/index.tsx +0 -3
- package/src/partials/w3m-send-input-token/index.tsx +4 -4
- package/src/partials/w3m-send-input-token/utils.ts +2 -2
- package/src/views/w3m-account-default-view/components/auth-buttons.tsx +4 -15
- package/src/views/w3m-account-default-view/index.tsx +23 -36
- package/src/views/w3m-account-view/index.tsx +9 -26
- package/src/views/w3m-account-view/styles.ts +0 -5
- package/src/views/w3m-connect-view/components/social-login-list.tsx +13 -5
- package/src/views/w3m-connecting-siwe-view/index.tsx +6 -17
- package/src/views/w3m-connecting-social-view/index.tsx +1 -1
- package/src/views/w3m-swap-view/index.tsx +1 -2
- package/src/views/w3m-wallet-compatible-networks-view/index.tsx +9 -11
- package/src/views/w3m-wallet-receive-view/index.tsx +16 -10
- package/src/views/w3m-wallet-send-preview-view/index.tsx +1 -1
- package/src/views/w3m-wallet-send-select-token-view/index.tsx +7 -9
- package/src/views/w3m-wallet-send-view/index.tsx +5 -5
- package/lib/commonjs/views/w3m-email-verify-device-view/index.js +0 -106
- package/lib/commonjs/views/w3m-email-verify-device-view/index.js.map +0 -1
- package/lib/commonjs/views/w3m-email-verify-device-view/styles.js +0 -25
- package/lib/commonjs/views/w3m-email-verify-device-view/styles.js.map +0 -1
- package/lib/commonjs/views/w3m-email-verify-otp-view/index.js +0 -86
- package/lib/commonjs/views/w3m-email-verify-otp-view/index.js.map +0 -1
- package/lib/commonjs/views/w3m-upgrade-to-smart-account-view/index.js +0 -103
- package/lib/commonjs/views/w3m-upgrade-to-smart-account-view/index.js.map +0 -1
- package/lib/commonjs/views/w3m-upgrade-to-smart-account-view/styles.js +0 -35
- package/lib/commonjs/views/w3m-upgrade-to-smart-account-view/styles.js.map +0 -1
- package/lib/module/views/w3m-email-verify-device-view/index.js +0 -99
- package/lib/module/views/w3m-email-verify-device-view/index.js.map +0 -1
- package/lib/module/views/w3m-email-verify-device-view/styles.js +0 -19
- package/lib/module/views/w3m-email-verify-device-view/styles.js.map +0 -1
- package/lib/module/views/w3m-email-verify-otp-view/index.js +0 -79
- package/lib/module/views/w3m-email-verify-otp-view/index.js.map +0 -1
- package/lib/module/views/w3m-upgrade-to-smart-account-view/index.js +0 -96
- package/lib/module/views/w3m-upgrade-to-smart-account-view/index.js.map +0 -1
- package/lib/module/views/w3m-upgrade-to-smart-account-view/styles.js +0 -29
- package/lib/module/views/w3m-upgrade-to-smart-account-view/styles.js.map +0 -1
- package/lib/typescript/views/w3m-email-verify-device-view/index.d.ts +0 -2
- package/lib/typescript/views/w3m-email-verify-device-view/index.d.ts.map +0 -1
- package/lib/typescript/views/w3m-email-verify-device-view/styles.d.ts +0 -18
- package/lib/typescript/views/w3m-email-verify-device-view/styles.d.ts.map +0 -1
- package/lib/typescript/views/w3m-email-verify-otp-view/index.d.ts +0 -2
- package/lib/typescript/views/w3m-email-verify-otp-view/index.d.ts.map +0 -1
- package/lib/typescript/views/w3m-upgrade-to-smart-account-view/index.d.ts +0 -2
- package/lib/typescript/views/w3m-upgrade-to-smart-account-view/index.d.ts.map +0 -1
- package/lib/typescript/views/w3m-upgrade-to-smart-account-view/styles.d.ts +0 -28
- package/lib/typescript/views/w3m-upgrade-to-smart-account-view/styles.d.ts.map +0 -1
- package/src/views/w3m-email-verify-device-view/index.tsx +0 -80
- package/src/views/w3m-email-verify-device-view/styles.ts +0 -19
- package/src/views/w3m-email-verify-otp-view/index.tsx +0 -75
- package/src/views/w3m-upgrade-to-smart-account-view/index.tsx +0 -106
- package/src/views/w3m-upgrade-to-smart-account-view/styles.ts +0 -29
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _appkitUiReactNative = require("@reown/appkit-ui-react-native");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _default = exports.default = _reactNative.StyleSheet.create({
|
|
10
|
-
container: {
|
|
11
|
-
justifyContent: 'center',
|
|
12
|
-
alignItems: 'center'
|
|
13
|
-
},
|
|
14
|
-
title: {
|
|
15
|
-
marginTop: _appkitUiReactNative.Spacing.xl,
|
|
16
|
-
marginVertical: _appkitUiReactNative.Spacing.s
|
|
17
|
-
},
|
|
18
|
-
button: {
|
|
19
|
-
width: 110
|
|
20
|
-
},
|
|
21
|
-
cancelButton: {
|
|
22
|
-
marginRight: _appkitUiReactNative.Spacing.m
|
|
23
|
-
},
|
|
24
|
-
middleIcon: {
|
|
25
|
-
marginHorizontal: _appkitUiReactNative.Spacing.s
|
|
26
|
-
},
|
|
27
|
-
closeButton: {
|
|
28
|
-
alignSelf: 'flex-end',
|
|
29
|
-
right: _appkitUiReactNative.Spacing.xl,
|
|
30
|
-
top: _appkitUiReactNative.Spacing.l,
|
|
31
|
-
position: 'absolute',
|
|
32
|
-
zIndex: 2
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_appkitUiReactNative","require","_reactNative","_default","exports","default","StyleSheet","create","container","justifyContent","alignItems","title","marginTop","Spacing","xl","marginVertical","s","button","width","cancelButton","marginRight","m","middleIcon","marginHorizontal","closeButton","alignSelf","right","top","l","position","zIndex"],"sourceRoot":"../../../../src","sources":["views/w3m-upgrade-to-smart-account-view/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAA0C,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE3BC,uBAAU,CAACC,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDC,KAAK,EAAE;IACLC,SAAS,EAAEC,4BAAO,CAACC,EAAE;IACrBC,cAAc,EAAEF,4BAAO,CAACG;EAC1B,CAAC;EACDC,MAAM,EAAE;IACNC,KAAK,EAAE;EACT,CAAC;EACDC,YAAY,EAAE;IACZC,WAAW,EAAEP,4BAAO,CAACQ;EACvB,CAAC;EACDC,UAAU,EAAE;IACVC,gBAAgB,EAAEV,4BAAO,CAACG;EAC5B,CAAC;EACDQ,WAAW,EAAE;IACXC,SAAS,EAAE,UAAU;IACrBC,KAAK,EAAEb,4BAAO,CAACC,EAAE;IACjBa,GAAG,EAAEd,4BAAO,CAACe,CAAC;IACdC,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE;EACV;AACF,CAAC,CAAC"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { useSnapshot } from 'valtio';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
import { FlexView, Icon, Link, Text, useTheme } from '@reown/appkit-ui-react-native';
|
|
5
|
-
import { ConnectorController, CoreHelperUtil, EventsController, RouterController, SnackController } from '@reown/appkit-core-react-native';
|
|
6
|
-
import useTimeout from '../../hooks/useTimeout';
|
|
7
|
-
import styles from './styles';
|
|
8
|
-
export function EmailVerifyDeviceView() {
|
|
9
|
-
const Theme = useTheme();
|
|
10
|
-
const {
|
|
11
|
-
connectors
|
|
12
|
-
} = useSnapshot(ConnectorController.state);
|
|
13
|
-
const {
|
|
14
|
-
data
|
|
15
|
-
} = RouterController.state;
|
|
16
|
-
const {
|
|
17
|
-
timeLeft,
|
|
18
|
-
startTimer
|
|
19
|
-
} = useTimeout(0);
|
|
20
|
-
const [loading, setLoading] = useState(false);
|
|
21
|
-
const authProvider = connectors.find(c => c.type === 'AUTH')?.provider;
|
|
22
|
-
const listenForDeviceApproval = async () => {
|
|
23
|
-
if (authProvider && data?.email) {
|
|
24
|
-
try {
|
|
25
|
-
await authProvider.connectDevice();
|
|
26
|
-
EventsController.sendEvent({
|
|
27
|
-
type: 'track',
|
|
28
|
-
event: 'DEVICE_REGISTERED_FOR_EMAIL'
|
|
29
|
-
});
|
|
30
|
-
EventsController.sendEvent({
|
|
31
|
-
type: 'track',
|
|
32
|
-
event: 'EMAIL_VERIFICATION_CODE_SENT'
|
|
33
|
-
});
|
|
34
|
-
RouterController.replace('EmailVerifyOtp', {
|
|
35
|
-
email: data.email
|
|
36
|
-
});
|
|
37
|
-
} catch (error) {
|
|
38
|
-
RouterController.goBack();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
const onResendEmail = async () => {
|
|
43
|
-
try {
|
|
44
|
-
if (!data?.email || !authProvider) return;
|
|
45
|
-
setLoading(true);
|
|
46
|
-
authProvider?.connectEmail({
|
|
47
|
-
email: data.email
|
|
48
|
-
});
|
|
49
|
-
listenForDeviceApproval();
|
|
50
|
-
SnackController.showSuccess('Link resent');
|
|
51
|
-
startTimer(30);
|
|
52
|
-
setLoading(false);
|
|
53
|
-
} catch (e) {
|
|
54
|
-
const parsedError = CoreHelperUtil.parseError(e);
|
|
55
|
-
SnackController.showError(parsedError);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
listenForDeviceApproval();
|
|
60
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
|
-
}, []);
|
|
62
|
-
return /*#__PURE__*/React.createElement(FlexView, {
|
|
63
|
-
alignItems: "center",
|
|
64
|
-
padding: ['0', '4xl', '3xl', '4xl']
|
|
65
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
66
|
-
style: [styles.iconContainer, {
|
|
67
|
-
backgroundColor: Theme['accent-glass-010']
|
|
68
|
-
}]
|
|
69
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
70
|
-
name: "verify",
|
|
71
|
-
size: "lg",
|
|
72
|
-
height: 28,
|
|
73
|
-
width: 28,
|
|
74
|
-
color: "accent-100"
|
|
75
|
-
})), /*#__PURE__*/React.createElement(Text, {
|
|
76
|
-
center: true,
|
|
77
|
-
variant: "medium-600",
|
|
78
|
-
style: styles.headingText
|
|
79
|
-
}, "Register this device to continue"), /*#__PURE__*/React.createElement(Text, {
|
|
80
|
-
center: true,
|
|
81
|
-
variant: "paragraph-400"
|
|
82
|
-
}, "Check the instructions sent to", ' '), /*#__PURE__*/React.createElement(Text, {
|
|
83
|
-
variant: "paragraph-500"
|
|
84
|
-
}, data?.email ?? 'your email'), /*#__PURE__*/React.createElement(Text, {
|
|
85
|
-
variant: "small-400",
|
|
86
|
-
color: "fg-200",
|
|
87
|
-
style: styles.expiryText
|
|
88
|
-
}, "The link expires in 20 minutes"), /*#__PURE__*/React.createElement(FlexView, {
|
|
89
|
-
alignItems: "center",
|
|
90
|
-
justifyContent: "center",
|
|
91
|
-
flexDirection: "row"
|
|
92
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
93
|
-
variant: "small-400"
|
|
94
|
-
}, "Didn't receive it?"), /*#__PURE__*/React.createElement(Link, {
|
|
95
|
-
onPress: onResendEmail,
|
|
96
|
-
disabled: timeLeft > 0 || loading
|
|
97
|
-
}, timeLeft > 0 ? `Resend in ${timeLeft}s` : 'Resend link')));
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useSnapshot","View","useEffect","useState","FlexView","Icon","Link","Text","useTheme","ConnectorController","CoreHelperUtil","EventsController","RouterController","SnackController","useTimeout","styles","EmailVerifyDeviceView","Theme","connectors","state","data","timeLeft","startTimer","loading","setLoading","authProvider","find","c","type","provider","listenForDeviceApproval","email","connectDevice","sendEvent","event","replace","error","goBack","onResendEmail","connectEmail","showSuccess","e","parsedError","parseError","showError","React","createElement","alignItems","padding","style","iconContainer","backgroundColor","name","size","height","width","color","center","variant","headingText","expiryText","justifyContent","flexDirection","onPress","disabled"],"sourceRoot":"../../../../src","sources":["views/w3m-email-verify-device-view/index.tsx"],"mappings":"AAAA,SAASA,WAAW,QAAQ,QAAQ;AACpC,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,QAAQ,EAAEC,IAAI,EAAEC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,+BAA+B;AACpF,SACEC,mBAAmB,EACnBC,cAAc,EACdC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe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C,gCACL,EAAC,GAC3B,CAAC,eACPb,KAAA,CAAAC,aAAA,CAACvC,IAAI;IAACmD,OAAO,EAAC;EAAe,GAAEtC,IAAI,EAAEW,KAAK,IAAI,YAAmB,CAAC,eAClEc,KAAA,CAAAC,aAAA,CAACvC,IAAI;IAACmD,OAAO,EAAC,WAAW;IAACF,KAAK,EAAC,QAAQ;IAACP,KAAK,EAAElC,MAAM,CAAC6C;EAAW,GAAC,gCAE7D,CAAC,eACPf,KAAA,CAAAC,aAAA,CAAC1C,QAAQ;IAAC2C,UAAU,EAAC,QAAQ;IAACc,cAAc,EAAC,QAAQ;IAACC,aAAa,EAAC;EAAK,gBACvEjB,KAAA,CAAAC,aAAA,CAACvC,IAAI;IAACmD,OAAO,EAAC;EAAW,GAAC,oBAAwB,CAAC,eACnDb,KAAA,CAAAC,aAAA,CAACxC,IAAI;IAACyD,OAAO,EAAEzB,aAAc;IAAC0B,QAAQ,EAAE3C,QAAQ,GAAG,CAAC,IAAIE;EAAQ,GAC7DF,QAAQ,GAAG,CAAC,GAAI,aAAYA,QAAS,GAAE,GAAG,aACvC,CACE,CACF,CAAC;AAEf"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Spacing } from '@reown/appkit-ui-react-native';
|
|
2
|
-
import { StyleSheet } from 'react-native';
|
|
3
|
-
export default StyleSheet.create({
|
|
4
|
-
iconContainer: {
|
|
5
|
-
height: 64,
|
|
6
|
-
width: 64,
|
|
7
|
-
justifyContent: 'center',
|
|
8
|
-
alignItems: 'center',
|
|
9
|
-
borderRadius: Spacing.xl,
|
|
10
|
-
marginBottom: Spacing['2xl']
|
|
11
|
-
},
|
|
12
|
-
headingText: {
|
|
13
|
-
marginBottom: Spacing.s
|
|
14
|
-
},
|
|
15
|
-
expiryText: {
|
|
16
|
-
marginVertical: Spacing.l
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Spacing","StyleSheet","create","iconContainer","height","width","justifyContent","alignItems","borderRadius","xl","marginBottom","headingText","s","expiryText","marginVertical","l"],"sourceRoot":"../../../../src","sources":["views/w3m-email-verify-device-view/styles.ts"],"mappings":"AAAA,SAASA,OAAO,QAAQ,+BAA+B;AACvD,SAASC,UAAU,QAAQ,cAAc;AAEzC,eAAeA,UAAU,CAACC,MAAM,CAAC;EAC/BC,aAAa,EAAE;IACbC,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE,EAAE;IACTC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBC,YAAY,EAAER,OAAO,CAACS,EAAE;IACxBC,YAAY,EAAEV,OAAO,CAAC,KAAK;EAC7B,CAAC;EACDW,WAAW,EAAE;IACXD,YAAY,EAAEV,OAAO,CAACY;EACxB,CAAC;EACDC,UAAU,EAAE;IACVC,cAAc,EAAEd,OAAO,CAACe;EAC1B;AACF,CAAC,CAAC"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { ConnectionController, ConnectorController, CoreHelperUtil, EventsController, ModalController, RouterController, SnackController } from '@reown/appkit-core-react-native';
|
|
3
|
-
import useTimeout from '../../hooks/useTimeout';
|
|
4
|
-
import { OtpCodeView } from '../../partials/w3m-otp-code';
|
|
5
|
-
export function EmailVerifyOtpView() {
|
|
6
|
-
const {
|
|
7
|
-
timeLeft,
|
|
8
|
-
startTimer
|
|
9
|
-
} = useTimeout(0);
|
|
10
|
-
const {
|
|
11
|
-
data
|
|
12
|
-
} = RouterController.state;
|
|
13
|
-
const [loading, setLoading] = useState(false);
|
|
14
|
-
const [error, setError] = useState('');
|
|
15
|
-
const authConnector = ConnectorController.getAuthConnector();
|
|
16
|
-
const onOtpResend = async () => {
|
|
17
|
-
try {
|
|
18
|
-
if (!data?.email || !authConnector) return;
|
|
19
|
-
setLoading(true);
|
|
20
|
-
const provider = authConnector?.provider;
|
|
21
|
-
await provider.connectEmail({
|
|
22
|
-
email: data.email
|
|
23
|
-
});
|
|
24
|
-
SnackController.showSuccess('Code resent');
|
|
25
|
-
startTimer(30);
|
|
26
|
-
setLoading(false);
|
|
27
|
-
} catch (e) {
|
|
28
|
-
const parsedError = CoreHelperUtil.parseError(e);
|
|
29
|
-
SnackController.showError(parsedError);
|
|
30
|
-
setLoading(false);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const onOtpSubmit = async otp => {
|
|
34
|
-
if (!authConnector) return;
|
|
35
|
-
setLoading(true);
|
|
36
|
-
setError('');
|
|
37
|
-
try {
|
|
38
|
-
const provider = authConnector?.provider;
|
|
39
|
-
await provider.connectOtp({
|
|
40
|
-
otp
|
|
41
|
-
});
|
|
42
|
-
EventsController.sendEvent({
|
|
43
|
-
type: 'track',
|
|
44
|
-
event: 'EMAIL_VERIFICATION_CODE_PASS'
|
|
45
|
-
});
|
|
46
|
-
await ConnectionController.connectExternal(authConnector);
|
|
47
|
-
ModalController.close();
|
|
48
|
-
EventsController.sendEvent({
|
|
49
|
-
type: 'track',
|
|
50
|
-
event: 'CONNECT_SUCCESS',
|
|
51
|
-
properties: {
|
|
52
|
-
method: 'email',
|
|
53
|
-
name: authConnector.name || 'Unknown'
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
} catch (e) {
|
|
57
|
-
EventsController.sendEvent({
|
|
58
|
-
type: 'track',
|
|
59
|
-
event: 'EMAIL_VERIFICATION_CODE_FAIL'
|
|
60
|
-
});
|
|
61
|
-
const parsedError = CoreHelperUtil.parseError(e);
|
|
62
|
-
if (parsedError?.includes('Invalid code')) {
|
|
63
|
-
setError('Invalid code. Try again.');
|
|
64
|
-
} else {
|
|
65
|
-
SnackController.showError(parsedError);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
setLoading(false);
|
|
69
|
-
};
|
|
70
|
-
return /*#__PURE__*/React.createElement(OtpCodeView, {
|
|
71
|
-
loading: loading,
|
|
72
|
-
error: error,
|
|
73
|
-
timeLeft: timeLeft,
|
|
74
|
-
email: data?.email,
|
|
75
|
-
onRetry: onOtpResend,
|
|
76
|
-
onSubmit: onOtpSubmit
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useState","ConnectionController","ConnectorController","CoreHelperUtil","EventsController","ModalController","RouterController","SnackController","useTimeout","OtpCodeView","EmailVerifyOtpView","timeLeft","startTimer","data","state","loading","setLoading","error","setError","authConnector","getAuthConnector","onOtpResend","email","provider","connectEmail","showSuccess","e","parsedError","parseError","showError","onOtpSubmit","otp","connectOtp","sendEvent","type","event","connectExternal","close","properties","method","name","includes","React","createElement","onRetry","onSubmit"],"sourceRoot":"../../../../src","sources":["views/w3m-email-verify-otp-view/index.tsx"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SACEC,oBAAoB,EACpBC,mBAAmB,EACnBC,cAAc,EACdC,gBAAgB,EAChBC,eAAe,EACfC,gBAAgB,EAChBC,eAAe,QAEV,iCAAiC;AACxC,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,SAASC,WAAW,QAAQ,6BAA6B;AAEzD,OAAO,SAASC,kBAAkBA,CAAA,EAAG;EACnC,MAAM;IAAEC,QAAQ;IAAEC;EAAW,CAAC,GAAGJ,UAAU,CAAC,CAAC,CAAC;EAC9C,MAAM;IAAEK;EAAK,CAAC,GAAGP,gBAAgB,CAACQ,KAAK;EACvC,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGhB,QAAQ,CAAC,KAAK,CAAC;EAC7C,MAAM,CAACiB,KAAK,EAAEC,QAAQ,CAAC,GAAGlB,QAAQ,CAAC,EAAE,CAAC;EACtC,MAAMmB,aAAa,GAAGjB,mBAAmB,CAACkB,gBAAgB,CAAC,CAAC;EAE5D,MAAMC,WAAW,GAAG,MAAAA,CAAA,KAAY;IAC9B,IAAI;MACF,IAAI,CAACR,IAAI,E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AS,CAAC;QAAEC,IAAI,EAAE,OAAO;QAAEC,KAAK,EAAE;MAA+B,CAAC,CAAC;MACpF,MAAMR,WAAW,GAAGxB,cAAc,CAACyB,UAAU,CAACF,CAAC,CAAC;MAChD,IAAIC,WAAW,EAAEc,QAAQ,CAAC,cAAc,CAAC,EAAE;QACzCvB,QAAQ,CAAC,0BAA0B,CAAC;MACtC,CAAC,MAAM;QACLX,eAAe,CAACsB,SAAS,CAACF,WAAW,CAAC;MACxC;IACF;IACAX,UAAU,CAAC,KAAK,CAAC;EACnB,CAAC;EAED,oBACE0B,KAAA,CAAAC,aAAA,CAAClC,WAAW;IACVM,OAAO,EAAEA,OAAQ;IACjBE,KAAK,EAAEA,KAAM;IACbN,QAAQ,EAAEA,QAAS;IACnBW,KAAK,EAAET,IAAI,EAAES,KAAM;IACnBsB,OAAO,EAAEvB,WAAY;IACrBwB,QAAQ,EAAEf;EAAY,CACvB,CAAC;AAEN"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { Linking } from 'react-native';
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import { useSnapshot } from 'valtio';
|
|
4
|
-
import { Button, FlexView, IconLink, Link, Text, Visual } from '@reown/appkit-ui-react-native';
|
|
5
|
-
import { AccountController, ConnectorController, EventsController, ModalController, NetworkController, RouterController, SnackController } from '@reown/appkit-core-react-native';
|
|
6
|
-
import styles from './styles';
|
|
7
|
-
export function UpgradeToSmartAccountView() {
|
|
8
|
-
const {
|
|
9
|
-
address
|
|
10
|
-
} = useSnapshot(AccountController.state);
|
|
11
|
-
const {
|
|
12
|
-
loading
|
|
13
|
-
} = useSnapshot(ModalController.state);
|
|
14
|
-
const [initialAddress] = useState(address);
|
|
15
|
-
const onSwitchAccountType = async () => {
|
|
16
|
-
try {
|
|
17
|
-
ModalController.setLoading(true);
|
|
18
|
-
const accountType = AccountController.state.preferredAccountType === 'eoa' ? 'smartAccount' : 'eoa';
|
|
19
|
-
const provider = ConnectorController.getAuthConnector()?.provider;
|
|
20
|
-
await provider?.setPreferredAccount(accountType);
|
|
21
|
-
EventsController.sendEvent({
|
|
22
|
-
type: 'track',
|
|
23
|
-
event: 'SET_PREFERRED_ACCOUNT_TYPE',
|
|
24
|
-
properties: {
|
|
25
|
-
accountType,
|
|
26
|
-
network: NetworkController.state.caipNetwork?.id || ''
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
} catch (error) {
|
|
30
|
-
ModalController.setLoading(false);
|
|
31
|
-
SnackController.showError('Error switching account type');
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
const onClose = () => {
|
|
35
|
-
ModalController.close();
|
|
36
|
-
ModalController.setLoading(false);
|
|
37
|
-
};
|
|
38
|
-
const onGoBack = () => {
|
|
39
|
-
RouterController.goBack();
|
|
40
|
-
ModalController.setLoading(false);
|
|
41
|
-
};
|
|
42
|
-
const onLearnMorePress = () => {
|
|
43
|
-
Linking.openURL('https://reown.com/faq');
|
|
44
|
-
};
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
// Go back if the address has changed
|
|
47
|
-
if (address && initialAddress !== address) {
|
|
48
|
-
RouterController.goBack();
|
|
49
|
-
}
|
|
50
|
-
}, [initialAddress, address]);
|
|
51
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconLink, {
|
|
52
|
-
icon: "close",
|
|
53
|
-
size: "md",
|
|
54
|
-
onPress: onClose,
|
|
55
|
-
testID: "header-close",
|
|
56
|
-
style: styles.closeButton
|
|
57
|
-
}), /*#__PURE__*/React.createElement(FlexView, {
|
|
58
|
-
style: styles.container,
|
|
59
|
-
padding: ['4xl', 'm', '2xl', 'm']
|
|
60
|
-
}, /*#__PURE__*/React.createElement(FlexView, {
|
|
61
|
-
alignItems: "center",
|
|
62
|
-
justifyContent: "center",
|
|
63
|
-
flexDirection: "row"
|
|
64
|
-
}, /*#__PURE__*/React.createElement(Visual, {
|
|
65
|
-
name: "google"
|
|
66
|
-
}), /*#__PURE__*/React.createElement(Visual, {
|
|
67
|
-
style: styles.middleIcon,
|
|
68
|
-
name: "pencil"
|
|
69
|
-
}), /*#__PURE__*/React.createElement(Visual, {
|
|
70
|
-
name: "lightbulb"
|
|
71
|
-
})), /*#__PURE__*/React.createElement(Text, {
|
|
72
|
-
variant: "medium-600",
|
|
73
|
-
color: "fg-100",
|
|
74
|
-
style: styles.title
|
|
75
|
-
}, "Discover Smart Accounts"), /*#__PURE__*/React.createElement(Text, {
|
|
76
|
-
variant: "paragraph-400",
|
|
77
|
-
color: "fg-100",
|
|
78
|
-
center: true
|
|
79
|
-
}, "Access advanced brand new features as username, improved security and a smoother user experience!"), /*#__PURE__*/React.createElement(FlexView, {
|
|
80
|
-
flexDirection: "row",
|
|
81
|
-
margin: ['m', '4xl', 'm', '4xl']
|
|
82
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
83
|
-
variant: "accent",
|
|
84
|
-
onPress: onGoBack,
|
|
85
|
-
disabled: loading,
|
|
86
|
-
style: [styles.button, styles.cancelButton]
|
|
87
|
-
}, "Do it later"), /*#__PURE__*/React.createElement(Button, {
|
|
88
|
-
onPress: onSwitchAccountType,
|
|
89
|
-
loading: loading,
|
|
90
|
-
style: styles.button
|
|
91
|
-
}, "Continue")), /*#__PURE__*/React.createElement(Link, {
|
|
92
|
-
onPress: onLearnMorePress,
|
|
93
|
-
iconRight: "externalLink"
|
|
94
|
-
}, "Learn more")));
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Linking","useEffect","useState","useSnapshot","Button","FlexView","IconLink","Link","Text","Visual","AccountController","ConnectorController","EventsController","ModalController","NetworkController","RouterController","SnackController","styles","UpgradeToSmartAccountView","address","state","loading","initialAddress","onSwitchAccountType","setLoading","accountType","preferredAccountType","provider","getAuthConnector","setPreferredAccount","sendEvent","type","event","properties","network","caipNetwork","id","error","showError","onClose","close","onGoBack","goBack","onLearnMorePress","openURL","React","createElement","Fragment","icon","size","onPress","testID","style","closeButton","container","padding","alignItems","justifyContent","flexDirection","name","middleIcon","variant","color","title","center","margin","disabled","button","cancelButton","iconRight"],"sourceRoot":"../../../../src","sources":["views/w3m-upgrade-to-smart-account-view/index.tsx"],"mappings":"AAAA,SAASA,OAAO,QAAQ,cAAc;AACtC,SAASC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,WAAW,QAAQ,QAAQ;AACpC,SAASC,MAAM,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,IAAI,EAAEC,MAAM,QAAQ,+BAA+B;AAC9F,SACEC,iBAAiB,EACjBC,mBAAmB,EACnBC,gBAAgB,EAChBC,eAAe,EACfC,iBAAiB,EACjBC,gBAAgB,EAChBC,eAAe,QAEV,iCAAiC;AACxC,OAAOC,MAAM,MAAM,UAAU;AAE7B,OAAO,SAASC,yBAAyBA,CAAA,EAAG;EAC1C,MAAM;IAAEC;EAAQ,CAAC,GAAGhB,WAAW,CAACO,iBAAiB,CAACU,KAAK,CAAC;EACxD,MAAM;IAAEC;EAAQ,CAAC,GAAGlB,WAAW,CAACU,eAAe,CAACO,KAAK,CAAC;EACtD,MAAM,CAACE,cAAc,CAAC,GAAGpB,QAAQ,CAACiB,OAAO,CAAC;EAE1C,MAAMI,mBAAmB,GAAG,MAAAA,CAAA,KAAY;IACtC,IAAI;MACFV,eAAe,CAACW,UAAU,CAAC,IAAI,CAAC;MAChC,MAAMC,WAAW,GACff,iBAAiB,CAACU,KAAK,CAACM,oBAAoB,KAAK,KAAK,GAAG,cAAc,GAAG,KAAK;MACjF,MAAMC,QAAQ,GAAGhB,mBAAmB,CAACiB,gBAAgB,CAAC,CAAC,EAAED,QAA+B;MACxF,MAAMA,QAAQ,EAAEE,mBAAmB,CAACJ,WAAW,CAAC;MAChDb,gBAAgB,CAACkB,SAAS,CAAC;QACzBC,IAAI,EAAE,OAAO;QACbC,KAAK,EAAE,4BAA4B;QAC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KAAA,CAAAC,aAAA,CAACvC,IAAI;IAAC2C,OAAO,EAAEP,gBAAiB;IAAC0B,SAAS,EAAC;EAAc,GAAC,YAEpD,CACE,CACV,CAAC;AAEP"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Spacing } from '@reown/appkit-ui-react-native';
|
|
2
|
-
import { StyleSheet } from 'react-native';
|
|
3
|
-
export default StyleSheet.create({
|
|
4
|
-
container: {
|
|
5
|
-
justifyContent: 'center',
|
|
6
|
-
alignItems: 'center'
|
|
7
|
-
},
|
|
8
|
-
title: {
|
|
9
|
-
marginTop: Spacing.xl,
|
|
10
|
-
marginVertical: Spacing.s
|
|
11
|
-
},
|
|
12
|
-
button: {
|
|
13
|
-
width: 110
|
|
14
|
-
},
|
|
15
|
-
cancelButton: {
|
|
16
|
-
marginRight: Spacing.m
|
|
17
|
-
},
|
|
18
|
-
middleIcon: {
|
|
19
|
-
marginHorizontal: Spacing.s
|
|
20
|
-
},
|
|
21
|
-
closeButton: {
|
|
22
|
-
alignSelf: 'flex-end',
|
|
23
|
-
right: Spacing.xl,
|
|
24
|
-
top: Spacing.l,
|
|
25
|
-
position: 'absolute',
|
|
26
|
-
zIndex: 2
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Spacing","StyleSheet","create","container","justifyContent","alignItems","title","marginTop","xl","marginVertical","s","button","width","cancelButton","marginRight","m","middleIcon","marginHorizontal","closeButton","alignSelf","right","top","l","position","zIndex"],"sourceRoot":"../../../../src","sources":["views/w3m-upgrade-to-smart-account-view/styles.ts"],"mappings":"AAAA,SAASA,OAAO,QAAQ,+BAA+B;AACvD,SAASC,UAAU,QAAQ,cAAc;AAEzC,eAAeA,UAAU,CAACC,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDC,KAAK,EAAE;IACLC,SAAS,EAAEP,OAAO,CAACQ,EAAE;IACrBC,cAAc,EAAET,OAAO,CAACU;EAC1B,CAAC;EACDC,MAAM,EAAE;IACNC,KAAK,EAAE;EACT,CAAC;EACDC,YAAY,EAAE;IACZC,WAAW,EAAEd,OAAO,CAACe;EACvB,CAAC;EACDC,UAAU,EAAE;IACVC,gBAAgB,EAAEjB,OAAO,CAACU;EAC5B,CAAC;EACDQ,WAAW,EAAE;IACXC,SAAS,EAAE,UAAU;IACrBC,KAAK,EAAEpB,OAAO,CAACQ,EAAE;IACjBa,GAAG,EAAErB,OAAO,CAACsB,CAAC;IACdC,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE;EACV;AACF,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-email-verify-device-view/index.tsx"],"names":[],"mappings":"AAeA,wBAAgB,qBAAqB,4CAgEpC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
iconContainer: {
|
|
3
|
-
height: number;
|
|
4
|
-
width: number;
|
|
5
|
-
justifyContent: "center";
|
|
6
|
-
alignItems: "center";
|
|
7
|
-
borderRadius: number;
|
|
8
|
-
marginBottom: number;
|
|
9
|
-
};
|
|
10
|
-
headingText: {
|
|
11
|
-
marginBottom: number;
|
|
12
|
-
};
|
|
13
|
-
expiryText: {
|
|
14
|
-
marginVertical: number;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export default _default;
|
|
18
|
-
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-email-verify-device-view/styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,wBAeG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-email-verify-otp-view/index.tsx"],"names":[],"mappings":"AAcA,wBAAgB,kBAAkB,4CA4DjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-upgrade-to-smart-account-view/index.tsx"],"names":[],"mappings":"AAgBA,wBAAgB,yBAAyB,4CAyFxC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
container: {
|
|
3
|
-
justifyContent: "center";
|
|
4
|
-
alignItems: "center";
|
|
5
|
-
};
|
|
6
|
-
title: {
|
|
7
|
-
marginTop: number;
|
|
8
|
-
marginVertical: number;
|
|
9
|
-
};
|
|
10
|
-
button: {
|
|
11
|
-
width: number;
|
|
12
|
-
};
|
|
13
|
-
cancelButton: {
|
|
14
|
-
marginRight: number;
|
|
15
|
-
};
|
|
16
|
-
middleIcon: {
|
|
17
|
-
marginHorizontal: number;
|
|
18
|
-
};
|
|
19
|
-
closeButton: {
|
|
20
|
-
alignSelf: "flex-end";
|
|
21
|
-
right: number;
|
|
22
|
-
top: number;
|
|
23
|
-
position: "absolute";
|
|
24
|
-
zIndex: number;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export default _default;
|
|
28
|
-
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-upgrade-to-smart-account-view/styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,wBAyBG"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { useSnapshot } from 'valtio';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
import { FlexView, Icon, Link, Text, useTheme } from '@reown/appkit-ui-react-native';
|
|
5
|
-
import {
|
|
6
|
-
ConnectorController,
|
|
7
|
-
CoreHelperUtil,
|
|
8
|
-
EventsController,
|
|
9
|
-
RouterController,
|
|
10
|
-
SnackController,
|
|
11
|
-
type AppKitFrameProvider
|
|
12
|
-
} from '@reown/appkit-core-react-native';
|
|
13
|
-
import useTimeout from '../../hooks/useTimeout';
|
|
14
|
-
import styles from './styles';
|
|
15
|
-
|
|
16
|
-
export function EmailVerifyDeviceView() {
|
|
17
|
-
const Theme = useTheme();
|
|
18
|
-
const { connectors } = useSnapshot(ConnectorController.state);
|
|
19
|
-
const { data } = RouterController.state;
|
|
20
|
-
const { timeLeft, startTimer } = useTimeout(0);
|
|
21
|
-
const [loading, setLoading] = useState(false);
|
|
22
|
-
const authProvider = connectors.find(c => c.type === 'AUTH')?.provider as AppKitFrameProvider;
|
|
23
|
-
|
|
24
|
-
const listenForDeviceApproval = async () => {
|
|
25
|
-
if (authProvider && data?.email) {
|
|
26
|
-
try {
|
|
27
|
-
await authProvider.connectDevice();
|
|
28
|
-
EventsController.sendEvent({ type: 'track', event: 'DEVICE_REGISTERED_FOR_EMAIL' });
|
|
29
|
-
EventsController.sendEvent({ type: 'track', event: 'EMAIL_VERIFICATION_CODE_SENT' });
|
|
30
|
-
RouterController.replace('EmailVerifyOtp', { email: data.email });
|
|
31
|
-
} catch (error: any) {
|
|
32
|
-
RouterController.goBack();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const onResendEmail = async () => {
|
|
38
|
-
try {
|
|
39
|
-
if (!data?.email || !authProvider) return;
|
|
40
|
-
setLoading(true);
|
|
41
|
-
authProvider?.connectEmail({ email: data.email });
|
|
42
|
-
listenForDeviceApproval();
|
|
43
|
-
SnackController.showSuccess('Link resent');
|
|
44
|
-
startTimer(30);
|
|
45
|
-
setLoading(false);
|
|
46
|
-
} catch (e) {
|
|
47
|
-
const parsedError = CoreHelperUtil.parseError(e);
|
|
48
|
-
SnackController.showError(parsedError);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
listenForDeviceApproval();
|
|
54
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
|
-
}, []);
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<FlexView alignItems="center" padding={['0', '4xl', '3xl', '4xl']}>
|
|
59
|
-
<View style={[styles.iconContainer, { backgroundColor: Theme['accent-glass-010'] }]}>
|
|
60
|
-
<Icon name="verify" size="lg" height={28} width={28} color="accent-100" />
|
|
61
|
-
</View>
|
|
62
|
-
<Text center variant="medium-600" style={styles.headingText}>
|
|
63
|
-
Register this device to continue
|
|
64
|
-
</Text>
|
|
65
|
-
<Text center variant="paragraph-400">
|
|
66
|
-
Check the instructions sent to{' '}
|
|
67
|
-
</Text>
|
|
68
|
-
<Text variant="paragraph-500">{data?.email ?? 'your email'}</Text>
|
|
69
|
-
<Text variant="small-400" color="fg-200" style={styles.expiryText}>
|
|
70
|
-
The link expires in 20 minutes
|
|
71
|
-
</Text>
|
|
72
|
-
<FlexView alignItems="center" justifyContent="center" flexDirection="row">
|
|
73
|
-
<Text variant="small-400">Didn't receive it?</Text>
|
|
74
|
-
<Link onPress={onResendEmail} disabled={timeLeft > 0 || loading}>
|
|
75
|
-
{timeLeft > 0 ? `Resend in ${timeLeft}s` : 'Resend link'}
|
|
76
|
-
</Link>
|
|
77
|
-
</FlexView>
|
|
78
|
-
</FlexView>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Spacing } from '@reown/appkit-ui-react-native';
|
|
2
|
-
import { StyleSheet } from 'react-native';
|
|
3
|
-
|
|
4
|
-
export default StyleSheet.create({
|
|
5
|
-
iconContainer: {
|
|
6
|
-
height: 64,
|
|
7
|
-
width: 64,
|
|
8
|
-
justifyContent: 'center',
|
|
9
|
-
alignItems: 'center',
|
|
10
|
-
borderRadius: Spacing.xl,
|
|
11
|
-
marginBottom: Spacing['2xl']
|
|
12
|
-
},
|
|
13
|
-
headingText: {
|
|
14
|
-
marginBottom: Spacing.s
|
|
15
|
-
},
|
|
16
|
-
expiryText: {
|
|
17
|
-
marginVertical: Spacing.l
|
|
18
|
-
}
|
|
19
|
-
});
|