@reown/appkit-react-native 0.0.0-feat-multi-siwe-20250623145640 → 0.0.0-feat-multi-social-20250630195637
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/connectors/WalletConnectConnector.js +5 -2
- package/lib/commonjs/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/commonjs/index.js +9 -58
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-modal/index.js +2 -15
- package/lib/commonjs/modal/w3m-modal/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-router/index.js +1 -7
- package/lib/commonjs/modal/w3m-router/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-header/index.js +3 -12
- package/lib/commonjs/partials/w3m-header/index.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/components/auth-buttons.js +1 -1
- package/lib/commonjs/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-socials-view/index.js +3 -10
- package/lib/commonjs/views/w3m-connect-socials-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/social-login-list.js +3 -7
- package/lib/commonjs/views/w3m-connect-view/components/social-login-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/index.js +9 -32
- package/lib/commonjs/views/w3m-connect-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-siwe-view/index.js +2 -0
- package/lib/commonjs/views/w3m-connecting-siwe-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-social-view/index.js +39 -61
- package/lib/commonjs/views/w3m-connecting-social-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-view/index.js +6 -7
- package/lib/commonjs/views/w3m-connecting-view/index.js.map +1 -1
- package/lib/module/connectors/WalletConnectConnector.js +5 -2
- package/lib/module/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/module/index.js +11 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/modal/w3m-modal/index.js +3 -16
- package/lib/module/modal/w3m-modal/index.js.map +1 -1
- package/lib/module/modal/w3m-router/index.js +1 -7
- package/lib/module/modal/w3m-router/index.js.map +1 -1
- package/lib/module/partials/w3m-header/index.js +4 -13
- package/lib/module/partials/w3m-header/index.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/components/auth-buttons.js +1 -1
- package/lib/module/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
- package/lib/module/views/w3m-connect-socials-view/index.js +4 -11
- package/lib/module/views/w3m-connect-socials-view/index.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/social-login-list.js +4 -8
- package/lib/module/views/w3m-connect-view/components/social-login-list.js.map +1 -1
- package/lib/module/views/w3m-connect-view/index.js +11 -34
- package/lib/module/views/w3m-connect-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-siwe-view/index.js +2 -0
- package/lib/module/views/w3m-connecting-siwe-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-social-view/index.js +41 -63
- package/lib/module/views/w3m-connecting-social-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-view/index.js +7 -8
- package/lib/module/views/w3m-connecting-view/index.js.map +1 -1
- package/lib/typescript/connectors/WalletConnectConnector.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +7 -6
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/modal/w3m-modal/index.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-socials-view/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-connect-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connecting-siwe-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connecting-social-view/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/connectors/WalletConnectConnector.ts +5 -2
- package/src/index.ts +10 -10
- package/src/modal/w3m-modal/index.tsx +1 -12
- package/src/modal/w3m-router/index.tsx +1 -7
- package/src/partials/w3m-header/index.tsx +5 -22
- package/src/views/w3m-account-default-view/components/auth-buttons.tsx +1 -1
- package/src/views/w3m-connect-socials-view/index.tsx +3 -14
- package/src/views/w3m-connect-view/components/social-login-list.tsx +2 -14
- package/src/views/w3m-connect-view/index.tsx +9 -25
- package/src/views/w3m-connecting-siwe-view/index.tsx +1 -0
- package/src/views/w3m-connecting-social-view/index.tsx +44 -96
- package/src/views/w3m-connecting-view/index.tsx +8 -8
- package/lib/commonjs/views/w3m-connect-view/components/connect-email-input.js +0 -73
- package/lib/commonjs/views/w3m-connect-view/components/connect-email-input.js.map +0 -1
- package/lib/commonjs/views/w3m-connect-view/components/wallet-guide.js +0 -55
- package/lib/commonjs/views/w3m-connect-view/components/wallet-guide.js.map +0 -1
- package/lib/commonjs/views/w3m-connecting-farcaster-view/index.js +0 -124
- package/lib/commonjs/views/w3m-connecting-farcaster-view/index.js.map +0 -1
- package/lib/commonjs/views/w3m-connecting-farcaster-view/styles.js +0 -24
- package/lib/commonjs/views/w3m-connecting-farcaster-view/styles.js.map +0 -1
- package/lib/commonjs/views/w3m-create-view/index.js +0 -57
- package/lib/commonjs/views/w3m-create-view/index.js.map +0 -1
- package/lib/module/views/w3m-connect-view/components/connect-email-input.js +0 -67
- package/lib/module/views/w3m-connect-view/components/connect-email-input.js.map +0 -1
- package/lib/module/views/w3m-connect-view/components/wallet-guide.js +0 -49
- package/lib/module/views/w3m-connect-view/components/wallet-guide.js.map +0 -1
- package/lib/module/views/w3m-connecting-farcaster-view/index.js +0 -117
- package/lib/module/views/w3m-connecting-farcaster-view/index.js.map +0 -1
- package/lib/module/views/w3m-connecting-farcaster-view/styles.js +0 -18
- package/lib/module/views/w3m-connecting-farcaster-view/styles.js.map +0 -1
- package/lib/module/views/w3m-create-view/index.js +0 -51
- package/lib/module/views/w3m-create-view/index.js.map +0 -1
- package/lib/typescript/views/w3m-connect-view/components/connect-email-input.d.ts +0 -6
- package/lib/typescript/views/w3m-connect-view/components/connect-email-input.d.ts.map +0 -1
- package/lib/typescript/views/w3m-connect-view/components/wallet-guide.d.ts +0 -5
- package/lib/typescript/views/w3m-connect-view/components/wallet-guide.d.ts.map +0 -1
- package/lib/typescript/views/w3m-connecting-farcaster-view/index.d.ts +0 -2
- package/lib/typescript/views/w3m-connecting-farcaster-view/index.d.ts.map +0 -1
- package/lib/typescript/views/w3m-connecting-farcaster-view/styles.d.ts +0 -17
- package/lib/typescript/views/w3m-connecting-farcaster-view/styles.d.ts.map +0 -1
- package/lib/typescript/views/w3m-create-view/index.d.ts +0 -2
- package/lib/typescript/views/w3m-create-view/index.d.ts.map +0 -1
- package/src/views/w3m-connect-view/components/connect-email-input.tsx +0 -69
- package/src/views/w3m-connect-view/components/wallet-guide.tsx +0 -50
- package/src/views/w3m-connecting-farcaster-view/index.tsx +0 -140
- package/src/views/w3m-connecting-farcaster-view/styles.ts +0 -18
- package/src/views/w3m-create-view/index.tsx +0 -35
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { Linking } from 'react-native';
|
|
2
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
ConnectionController,
|
|
5
|
-
ConnectorController,
|
|
6
|
-
EventsController,
|
|
7
|
-
ModalController,
|
|
8
|
-
OptionsController,
|
|
9
|
-
SnackController,
|
|
10
|
-
type AppKitFrameProvider
|
|
11
|
-
} from '@reown/appkit-core-react-native';
|
|
12
|
-
import {
|
|
13
|
-
FlexView,
|
|
14
|
-
LoadingThumbnail,
|
|
15
|
-
IconBox,
|
|
16
|
-
Logo,
|
|
17
|
-
Text,
|
|
18
|
-
Link
|
|
19
|
-
} from '@reown/appkit-ui-react-native';
|
|
20
|
-
|
|
21
|
-
import { useCustomDimensions } from '../../hooks/useCustomDimensions';
|
|
22
|
-
import styles from './styles';
|
|
23
|
-
|
|
24
|
-
export function ConnectingFarcasterView() {
|
|
25
|
-
const { maxWidth: width } = useCustomDimensions();
|
|
26
|
-
const authConnector = ConnectorController.getAuthConnector();
|
|
27
|
-
const [error, setError] = useState(false);
|
|
28
|
-
const [processing, setProcessing] = useState(false);
|
|
29
|
-
const [url, setUrl] = useState<string | undefined>();
|
|
30
|
-
const showCopy = OptionsController.isClipboardAvailable();
|
|
31
|
-
const provider = authConnector?.provider as AppKitFrameProvider;
|
|
32
|
-
|
|
33
|
-
const onConnect = useCallback(async () => {
|
|
34
|
-
try {
|
|
35
|
-
if (provider && authConnector) {
|
|
36
|
-
setError(false);
|
|
37
|
-
const { url: farcasterUrl } = await provider.getFarcasterUri();
|
|
38
|
-
setUrl(farcasterUrl);
|
|
39
|
-
Linking.openURL(farcasterUrl);
|
|
40
|
-
|
|
41
|
-
await provider.connectFarcaster();
|
|
42
|
-
EventsController.sendEvent({
|
|
43
|
-
type: 'track',
|
|
44
|
-
event: 'SOCIAL_LOGIN_REQUEST_USER_DATA',
|
|
45
|
-
properties: { provider: 'farcaster' }
|
|
46
|
-
});
|
|
47
|
-
setProcessing(true);
|
|
48
|
-
await ConnectionController.connectExternal(authConnector);
|
|
49
|
-
ConnectionController.setConnectedSocialProvider('farcaster');
|
|
50
|
-
EventsController.sendEvent({
|
|
51
|
-
type: 'track',
|
|
52
|
-
event: 'SOCIAL_LOGIN_SUCCESS',
|
|
53
|
-
properties: { provider: 'farcaster' }
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
setProcessing(false);
|
|
57
|
-
ModalController.close();
|
|
58
|
-
}
|
|
59
|
-
} catch (e) {
|
|
60
|
-
EventsController.sendEvent({
|
|
61
|
-
type: 'track',
|
|
62
|
-
event: 'SOCIAL_LOGIN_ERROR',
|
|
63
|
-
properties: { provider: 'farcaster' }
|
|
64
|
-
});
|
|
65
|
-
// TODO: remove this once Farcaster session refresh is implemented
|
|
66
|
-
// @ts-expect-error
|
|
67
|
-
provider?.webviewRef?.current?.reload();
|
|
68
|
-
SnackController.showError('Something went wrong');
|
|
69
|
-
setError(true);
|
|
70
|
-
setProcessing(false);
|
|
71
|
-
}
|
|
72
|
-
}, [provider, authConnector]);
|
|
73
|
-
|
|
74
|
-
const onCopyUrl = () => {
|
|
75
|
-
if (url) {
|
|
76
|
-
OptionsController.copyToClipboard(url);
|
|
77
|
-
SnackController.showSuccess('Link copied');
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
return () => {
|
|
83
|
-
// TODO: remove this once Farcaster session refresh is implemented
|
|
84
|
-
if (!ModalController.state.open) {
|
|
85
|
-
// @ts-expect-error
|
|
86
|
-
provider.webviewRef?.current?.reload();
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
// @ts-expect-error
|
|
90
|
-
}, [provider.webviewRef]);
|
|
91
|
-
|
|
92
|
-
useEffect(() => {
|
|
93
|
-
onConnect();
|
|
94
|
-
}, [onConnect]);
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<FlexView
|
|
98
|
-
alignItems="center"
|
|
99
|
-
alignSelf="center"
|
|
100
|
-
padding={['2xl', 'l', '3xl', 'l']}
|
|
101
|
-
style={{ width }}
|
|
102
|
-
>
|
|
103
|
-
<>
|
|
104
|
-
<LoadingThumbnail paused={!!error}>
|
|
105
|
-
<Logo logo="farcasterSquare" height={72} width={72} />
|
|
106
|
-
{error && (
|
|
107
|
-
<IconBox
|
|
108
|
-
icon={'close'}
|
|
109
|
-
border
|
|
110
|
-
background
|
|
111
|
-
backgroundColor="icon-box-bg-error-100"
|
|
112
|
-
size="sm"
|
|
113
|
-
iconColor="error-100"
|
|
114
|
-
style={styles.errorIcon}
|
|
115
|
-
/>
|
|
116
|
-
)}
|
|
117
|
-
</LoadingThumbnail>
|
|
118
|
-
<Text style={styles.continueText} variant="paragraph-500">
|
|
119
|
-
{processing ? 'Loading user data' : 'Continue in Farcaster'}
|
|
120
|
-
</Text>
|
|
121
|
-
<Text variant="small-400" color="fg-200">
|
|
122
|
-
{processing
|
|
123
|
-
? 'Please wait a moment while we load your data'
|
|
124
|
-
: 'Connect in the Farcaster app'}
|
|
125
|
-
</Text>
|
|
126
|
-
{showCopy && (
|
|
127
|
-
<Link
|
|
128
|
-
iconLeft="copySmall"
|
|
129
|
-
color="fg-200"
|
|
130
|
-
style={styles.copyButton}
|
|
131
|
-
onPress={onCopyUrl}
|
|
132
|
-
testID="copy-link"
|
|
133
|
-
>
|
|
134
|
-
Copy link
|
|
135
|
-
</Link>
|
|
136
|
-
)}
|
|
137
|
-
</>
|
|
138
|
-
</FlexView>
|
|
139
|
-
);
|
|
140
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { StyleSheet } from 'react-native';
|
|
2
|
-
import { Spacing } from '@reown/appkit-ui-react-native';
|
|
3
|
-
|
|
4
|
-
export default StyleSheet.create({
|
|
5
|
-
errorIcon: {
|
|
6
|
-
position: 'absolute',
|
|
7
|
-
bottom: 8,
|
|
8
|
-
right: 8,
|
|
9
|
-
zIndex: 2
|
|
10
|
-
},
|
|
11
|
-
continueText: {
|
|
12
|
-
marginTop: Spacing.m,
|
|
13
|
-
marginBottom: Spacing.xs
|
|
14
|
-
},
|
|
15
|
-
copyButton: {
|
|
16
|
-
marginTop: Spacing.m
|
|
17
|
-
}
|
|
18
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Platform, ScrollView } from 'react-native';
|
|
2
|
-
import { useSnapshot } from 'valtio';
|
|
3
|
-
import { FlexView, Spacing } from '@reown/appkit-ui-react-native';
|
|
4
|
-
import { ConnectEmailInput } from '../w3m-connect-view/components/connect-email-input';
|
|
5
|
-
import { SocialLoginList } from '../w3m-connect-view/components/social-login-list';
|
|
6
|
-
import { WalletGuide } from '../w3m-connect-view/components/wallet-guide';
|
|
7
|
-
import { useCustomDimensions } from '../../hooks/useCustomDimensions';
|
|
8
|
-
import { ConnectorController, OptionsController } from '@reown/appkit-core-react-native';
|
|
9
|
-
import { useKeyboard } from '../../hooks/useKeyboard';
|
|
10
|
-
|
|
11
|
-
export function CreateView() {
|
|
12
|
-
const connectors = ConnectorController.state.connectors;
|
|
13
|
-
const { authLoading } = useSnapshot(ConnectorController.state);
|
|
14
|
-
const { features } = useSnapshot(OptionsController.state);
|
|
15
|
-
const { padding } = useCustomDimensions();
|
|
16
|
-
const { keyboardShown, keyboardHeight } = useKeyboard();
|
|
17
|
-
const isAuthEnabled = connectors.some(c => c.type === 'AUTH');
|
|
18
|
-
const isEmailEnabled = isAuthEnabled && features?.email;
|
|
19
|
-
const isSocialEnabled = isAuthEnabled && features?.socials && features?.socials.length > 0;
|
|
20
|
-
|
|
21
|
-
const paddingBottom = Platform.select({
|
|
22
|
-
android: keyboardShown ? keyboardHeight + Spacing.xl : Spacing.xl,
|
|
23
|
-
default: Spacing.xl
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<ScrollView style={{ paddingHorizontal: padding }} bounces={false}>
|
|
28
|
-
<FlexView padding={['xs', '0', '0', '0']} style={{ paddingBottom }}>
|
|
29
|
-
{isEmailEnabled && <ConnectEmailInput loading={authLoading} />}
|
|
30
|
-
{isSocialEnabled && <SocialLoginList options={features?.socials} disabled={authLoading} />}
|
|
31
|
-
{isAuthEnabled && <WalletGuide guide="explore" />}
|
|
32
|
-
</FlexView>
|
|
33
|
-
</ScrollView>
|
|
34
|
-
);
|
|
35
|
-
}
|