@reown/appkit-react-native 0.0.0-feat-multi-social-20250630195637 → 0.0.0-feat-multi-social-20250701185040
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 +14 -6
- package/lib/commonjs/AppKit.js.map +1 -1
- package/lib/commonjs/connectors/WalletConnectConnector.js +6 -0
- package/lib/commonjs/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/commonjs/modal/w3m-router/index.js +0 -6
- package/lib/commonjs/modal/w3m-router/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-header/index.js +0 -2
- package/lib/commonjs/partials/w3m-header/index.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-view/index.js +0 -13
- package/lib/commonjs/views/w3m-connecting-view/index.js.map +1 -1
- package/lib/module/AppKit.js +14 -6
- package/lib/module/AppKit.js.map +1 -1
- package/lib/module/connectors/WalletConnectConnector.js +6 -0
- package/lib/module/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/module/modal/w3m-router/index.js +0 -6
- package/lib/module/modal/w3m-router/index.js.map +1 -1
- package/lib/module/partials/w3m-header/index.js +0 -2
- package/lib/module/partials/w3m-header/index.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-view/index.js +1 -14
- package/lib/module/views/w3m-connecting-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 -1
- 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-header/index.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-view/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/AppKit.ts +23 -9
- package/src/connectors/WalletConnectConnector.ts +11 -2
- package/src/modal/w3m-router/index.tsx +0 -6
- package/src/partials/w3m-header/index.tsx +0 -2
- package/src/views/w3m-connect-view/components/social-login-list.tsx +13 -5
- package/src/views/w3m-connecting-view/index.tsx +1 -19
- 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/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/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/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
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
ConnectionController,
|
|
4
|
-
ConnectorController,
|
|
5
|
-
CoreHelperUtil,
|
|
6
|
-
EventsController,
|
|
7
|
-
ModalController,
|
|
8
|
-
RouterController,
|
|
9
|
-
SnackController,
|
|
10
|
-
type AppKitFrameProvider
|
|
11
|
-
} from '@reown/appkit-core-react-native';
|
|
12
|
-
import useTimeout from '../../hooks/useTimeout';
|
|
13
|
-
import { OtpCodeView } from '../../partials/w3m-otp-code';
|
|
14
|
-
|
|
15
|
-
export function EmailVerifyOtpView() {
|
|
16
|
-
const { timeLeft, startTimer } = useTimeout(0);
|
|
17
|
-
const { data } = RouterController.state;
|
|
18
|
-
const [loading, setLoading] = useState(false);
|
|
19
|
-
const [error, setError] = useState('');
|
|
20
|
-
const authConnector = ConnectorController.getAuthConnector();
|
|
21
|
-
|
|
22
|
-
const onOtpResend = async () => {
|
|
23
|
-
try {
|
|
24
|
-
if (!data?.email || !authConnector) return;
|
|
25
|
-
setLoading(true);
|
|
26
|
-
const provider = authConnector?.provider as AppKitFrameProvider;
|
|
27
|
-
await provider.connectEmail({ email: data.email });
|
|
28
|
-
SnackController.showSuccess('Code resent');
|
|
29
|
-
startTimer(30);
|
|
30
|
-
setLoading(false);
|
|
31
|
-
} catch (e) {
|
|
32
|
-
const parsedError = CoreHelperUtil.parseError(e);
|
|
33
|
-
SnackController.showError(parsedError);
|
|
34
|
-
setLoading(false);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const onOtpSubmit = async (otp: string) => {
|
|
39
|
-
if (!authConnector) return;
|
|
40
|
-
setLoading(true);
|
|
41
|
-
setError('');
|
|
42
|
-
try {
|
|
43
|
-
const provider = authConnector?.provider as AppKitFrameProvider;
|
|
44
|
-
await provider.connectOtp({ otp });
|
|
45
|
-
EventsController.sendEvent({ type: 'track', event: 'EMAIL_VERIFICATION_CODE_PASS' });
|
|
46
|
-
await ConnectionController.connectExternal(authConnector);
|
|
47
|
-
ModalController.close();
|
|
48
|
-
EventsController.sendEvent({
|
|
49
|
-
type: 'track',
|
|
50
|
-
event: 'CONNECT_SUCCESS',
|
|
51
|
-
properties: { method: 'email', name: authConnector.name || 'Unknown' }
|
|
52
|
-
});
|
|
53
|
-
} catch (e) {
|
|
54
|
-
EventsController.sendEvent({ type: 'track', event: 'EMAIL_VERIFICATION_CODE_FAIL' });
|
|
55
|
-
const parsedError = CoreHelperUtil.parseError(e);
|
|
56
|
-
if (parsedError?.includes('Invalid code')) {
|
|
57
|
-
setError('Invalid code. Try again.');
|
|
58
|
-
} else {
|
|
59
|
-
SnackController.showError(parsedError);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
setLoading(false);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<OtpCodeView
|
|
67
|
-
loading={loading}
|
|
68
|
-
error={error}
|
|
69
|
-
timeLeft={timeLeft}
|
|
70
|
-
email={data?.email}
|
|
71
|
-
onRetry={onOtpResend}
|
|
72
|
-
onSubmit={onOtpSubmit}
|
|
73
|
-
/>
|
|
74
|
-
);
|
|
75
|
-
}
|