@reown/appkit-react-native 0.0.0-chore-bump-builder-20250728195048 → 0.0.0-chore-solflare-20250730210452

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.
Files changed (203) hide show
  1. package/lib/commonjs/AppKit.js +22 -2
  2. package/lib/commonjs/AppKit.js.map +1 -1
  3. package/lib/commonjs/AppKitContext.js +1 -0
  4. package/lib/commonjs/AppKitContext.js.map +1 -1
  5. package/lib/commonjs/hooks/useRouteTransition.js +83 -0
  6. package/lib/commonjs/hooks/useRouteTransition.js.map +1 -0
  7. package/lib/commonjs/modal/w3m-modal/index.js +10 -31
  8. package/lib/commonjs/modal/w3m-modal/index.js.map +1 -1
  9. package/lib/commonjs/modal/w3m-modal/styles.js +0 -4
  10. package/lib/commonjs/modal/w3m-modal/styles.js.map +1 -1
  11. package/lib/commonjs/modal/w3m-router/index.js +16 -1
  12. package/lib/commonjs/modal/w3m-router/index.js.map +1 -1
  13. package/lib/commonjs/partials/w3m-header/index.js +7 -15
  14. package/lib/commonjs/partials/w3m-header/index.js.map +1 -1
  15. package/lib/commonjs/partials/w3m-information-modal/index.js +34 -32
  16. package/lib/commonjs/partials/w3m-information-modal/index.js.map +1 -1
  17. package/lib/commonjs/partials/w3m-information-modal/styles.js +6 -4
  18. package/lib/commonjs/partials/w3m-information-modal/styles.js.map +1 -1
  19. package/lib/commonjs/partials/w3m-selector-modal/index.js +64 -66
  20. package/lib/commonjs/partials/w3m-selector-modal/index.js.map +1 -1
  21. package/lib/commonjs/partials/w3m-selector-modal/styles.js +1 -0
  22. package/lib/commonjs/partials/w3m-selector-modal/styles.js.map +1 -1
  23. package/lib/commonjs/utils/RouterUtil.js +52 -0
  24. package/lib/commonjs/utils/RouterUtil.js.map +1 -0
  25. package/lib/commonjs/utils/UiUtil.js +11 -6
  26. package/lib/commonjs/utils/UiUtil.js.map +1 -1
  27. package/lib/commonjs/views/w3m-all-wallets-view/index.js +1 -1
  28. package/lib/commonjs/views/w3m-all-wallets-view/index.js.map +1 -1
  29. package/lib/commonjs/views/w3m-connect-view/index.js +1 -1
  30. package/lib/commonjs/views/w3m-connect-view/index.js.map +1 -1
  31. package/lib/commonjs/views/w3m-connecting-external-view/index.js +3 -1
  32. package/lib/commonjs/views/w3m-connecting-external-view/index.js.map +1 -1
  33. package/lib/commonjs/views/w3m-connecting-siwe-view/index.js +0 -1
  34. package/lib/commonjs/views/w3m-connecting-siwe-view/index.js.map +1 -1
  35. package/lib/commonjs/views/w3m-networks-view/index.js +3 -6
  36. package/lib/commonjs/views/w3m-networks-view/index.js.map +1 -1
  37. package/lib/commonjs/views/w3m-onramp-view/components/Header.js +5 -6
  38. package/lib/commonjs/views/w3m-onramp-view/components/Header.js.map +1 -1
  39. package/lib/commonjs/views/w3m-onramp-view/components/SelectPaymentModal.js +68 -70
  40. package/lib/commonjs/views/w3m-onramp-view/components/SelectPaymentModal.js.map +1 -1
  41. package/lib/commonjs/views/w3m-swap-preview-view/index.js +1 -14
  42. package/lib/commonjs/views/w3m-swap-preview-view/index.js.map +1 -1
  43. package/lib/commonjs/views/w3m-swap-preview-view/styles.js +3 -0
  44. package/lib/commonjs/views/w3m-swap-preview-view/styles.js.map +1 -1
  45. package/lib/commonjs/views/w3m-swap-view/components/select-token-view/index.js +3 -2
  46. package/lib/commonjs/views/w3m-swap-view/components/select-token-view/index.js.map +1 -1
  47. package/lib/commonjs/views/w3m-swap-view/components/select-token-view/styles.js +1 -2
  48. package/lib/commonjs/views/w3m-swap-view/components/select-token-view/styles.js.map +1 -1
  49. package/lib/commonjs/views/w3m-swap-view/index.js +10 -20
  50. package/lib/commonjs/views/w3m-swap-view/index.js.map +1 -1
  51. package/lib/commonjs/views/w3m-swap-view/styles.js +5 -1
  52. package/lib/commonjs/views/w3m-swap-view/styles.js.map +1 -1
  53. package/lib/commonjs/views/w3m-wallet-send-view/index.js +4 -12
  54. package/lib/commonjs/views/w3m-wallet-send-view/index.js.map +1 -1
  55. package/lib/commonjs/views/w3m-wallet-send-view/styles.js +3 -0
  56. package/lib/commonjs/views/w3m-wallet-send-view/styles.js.map +1 -1
  57. package/lib/module/AppKit.js +22 -2
  58. package/lib/module/AppKit.js.map +1 -1
  59. package/lib/module/AppKitContext.js +1 -0
  60. package/lib/module/AppKitContext.js.map +1 -1
  61. package/lib/module/hooks/useRouteTransition.js +79 -0
  62. package/lib/module/hooks/useRouteTransition.js.map +1 -0
  63. package/lib/module/modal/w3m-modal/index.js +11 -32
  64. package/lib/module/modal/w3m-modal/index.js.map +1 -1
  65. package/lib/module/modal/w3m-modal/styles.js +0 -4
  66. package/lib/module/modal/w3m-modal/styles.js.map +1 -1
  67. package/lib/module/modal/w3m-router/index.js +17 -2
  68. package/lib/module/modal/w3m-router/index.js.map +1 -1
  69. package/lib/module/partials/w3m-header/index.js +8 -16
  70. package/lib/module/partials/w3m-header/index.js.map +1 -1
  71. package/lib/module/partials/w3m-information-modal/index.js +33 -31
  72. package/lib/module/partials/w3m-information-modal/index.js.map +1 -1
  73. package/lib/module/partials/w3m-information-modal/styles.js +7 -5
  74. package/lib/module/partials/w3m-information-modal/styles.js.map +1 -1
  75. package/lib/module/partials/w3m-selector-modal/index.js +64 -66
  76. package/lib/module/partials/w3m-selector-modal/index.js.map +1 -1
  77. package/lib/module/partials/w3m-selector-modal/styles.js +1 -0
  78. package/lib/module/partials/w3m-selector-modal/styles.js.map +1 -1
  79. package/lib/module/utils/RouterUtil.js +48 -0
  80. package/lib/module/utils/RouterUtil.js.map +1 -0
  81. package/lib/module/utils/UiUtil.js +12 -7
  82. package/lib/module/utils/UiUtil.js.map +1 -1
  83. package/lib/module/views/w3m-all-wallets-view/index.js +1 -1
  84. package/lib/module/views/w3m-all-wallets-view/index.js.map +1 -1
  85. package/lib/module/views/w3m-connect-view/index.js +1 -1
  86. package/lib/module/views/w3m-connect-view/index.js.map +1 -1
  87. package/lib/module/views/w3m-connecting-external-view/index.js +3 -1
  88. package/lib/module/views/w3m-connecting-external-view/index.js.map +1 -1
  89. package/lib/module/views/w3m-connecting-siwe-view/index.js +1 -2
  90. package/lib/module/views/w3m-connecting-siwe-view/index.js.map +1 -1
  91. package/lib/module/views/w3m-networks-view/index.js +4 -7
  92. package/lib/module/views/w3m-networks-view/index.js.map +1 -1
  93. package/lib/module/views/w3m-onramp-view/components/Header.js +5 -6
  94. package/lib/module/views/w3m-onramp-view/components/Header.js.map +1 -1
  95. package/lib/module/views/w3m-onramp-view/components/SelectPaymentModal.js +68 -69
  96. package/lib/module/views/w3m-onramp-view/components/SelectPaymentModal.js.map +1 -1
  97. package/lib/module/views/w3m-swap-preview-view/index.js +3 -16
  98. package/lib/module/views/w3m-swap-preview-view/index.js.map +1 -1
  99. package/lib/module/views/w3m-swap-preview-view/styles.js +3 -0
  100. package/lib/module/views/w3m-swap-preview-view/styles.js.map +1 -1
  101. package/lib/module/views/w3m-swap-view/components/select-token-view/index.js +3 -2
  102. package/lib/module/views/w3m-swap-view/components/select-token-view/index.js.map +1 -1
  103. package/lib/module/views/w3m-swap-view/components/select-token-view/styles.js +1 -2
  104. package/lib/module/views/w3m-swap-view/components/select-token-view/styles.js.map +1 -1
  105. package/lib/module/views/w3m-swap-view/index.js +11 -21
  106. package/lib/module/views/w3m-swap-view/index.js.map +1 -1
  107. package/lib/module/views/w3m-swap-view/styles.js +5 -1
  108. package/lib/module/views/w3m-swap-view/styles.js.map +1 -1
  109. package/lib/module/views/w3m-wallet-send-view/index.js +6 -14
  110. package/lib/module/views/w3m-wallet-send-view/index.js.map +1 -1
  111. package/lib/module/views/w3m-wallet-send-view/styles.js +3 -0
  112. package/lib/module/views/w3m-wallet-send-view/styles.js.map +1 -1
  113. package/lib/typescript/AppKit.d.ts +2 -1
  114. package/lib/typescript/AppKit.d.ts.map +1 -1
  115. package/lib/typescript/AppKitContext.d.ts +2 -1
  116. package/lib/typescript/AppKitContext.d.ts.map +1 -1
  117. package/lib/typescript/hooks/useRouteTransition.d.ts +16 -0
  118. package/lib/typescript/hooks/useRouteTransition.d.ts.map +1 -0
  119. package/lib/typescript/modal/w3m-modal/index.d.ts.map +1 -1
  120. package/lib/typescript/modal/w3m-modal/styles.d.ts +0 -4
  121. package/lib/typescript/modal/w3m-modal/styles.d.ts.map +1 -1
  122. package/lib/typescript/modal/w3m-router/index.d.ts.map +1 -1
  123. package/lib/typescript/partials/w3m-header/index.d.ts.map +1 -1
  124. package/lib/typescript/partials/w3m-information-modal/index.d.ts.map +1 -1
  125. package/lib/typescript/partials/w3m-information-modal/styles.d.ts +2 -0
  126. package/lib/typescript/partials/w3m-information-modal/styles.d.ts.map +1 -1
  127. package/lib/typescript/partials/w3m-selector-modal/index.d.ts.map +1 -1
  128. package/lib/typescript/partials/w3m-selector-modal/styles.d.ts +1 -0
  129. package/lib/typescript/partials/w3m-selector-modal/styles.d.ts.map +1 -1
  130. package/lib/typescript/utils/RouterUtil.d.ts +9 -0
  131. package/lib/typescript/utils/RouterUtil.d.ts.map +1 -0
  132. package/lib/typescript/utils/UiUtil.d.ts +2 -2
  133. package/lib/typescript/utils/UiUtil.d.ts.map +1 -1
  134. package/lib/typescript/views/w3m-all-wallets-view/index.d.ts.map +1 -1
  135. package/lib/typescript/views/w3m-connect-view/index.d.ts.map +1 -1
  136. package/lib/typescript/views/w3m-connecting-external-view/index.d.ts.map +1 -1
  137. package/lib/typescript/views/w3m-connecting-siwe-view/index.d.ts.map +1 -1
  138. package/lib/typescript/views/w3m-networks-view/index.d.ts.map +1 -1
  139. package/lib/typescript/views/w3m-onramp-view/components/Header.d.ts.map +1 -1
  140. package/lib/typescript/views/w3m-onramp-view/components/SelectPaymentModal.d.ts.map +1 -1
  141. package/lib/typescript/views/w3m-swap-preview-view/index.d.ts.map +1 -1
  142. package/lib/typescript/views/w3m-swap-preview-view/styles.d.ts +3 -0
  143. package/lib/typescript/views/w3m-swap-preview-view/styles.d.ts.map +1 -1
  144. package/lib/typescript/views/w3m-swap-view/components/select-token-view/index.d.ts +3 -1
  145. package/lib/typescript/views/w3m-swap-view/components/select-token-view/index.d.ts.map +1 -1
  146. package/lib/typescript/views/w3m-swap-view/components/select-token-view/styles.d.ts +0 -1
  147. package/lib/typescript/views/w3m-swap-view/components/select-token-view/styles.d.ts.map +1 -1
  148. package/lib/typescript/views/w3m-swap-view/index.d.ts.map +1 -1
  149. package/lib/typescript/views/w3m-swap-view/styles.d.ts +5 -1
  150. package/lib/typescript/views/w3m-swap-view/styles.d.ts.map +1 -1
  151. package/lib/typescript/views/w3m-wallet-send-view/index.d.ts.map +1 -1
  152. package/lib/typescript/views/w3m-wallet-send-view/styles.d.ts +3 -0
  153. package/lib/typescript/views/w3m-wallet-send-view/styles.d.ts.map +1 -1
  154. package/package.json +5 -6
  155. package/src/AppKit.ts +37 -2
  156. package/src/AppKitContext.tsx +1 -0
  157. package/src/hooks/useRouteTransition.ts +95 -0
  158. package/src/modal/w3m-modal/index.tsx +12 -39
  159. package/src/modal/w3m-modal/styles.ts +0 -4
  160. package/src/modal/w3m-router/index.tsx +17 -2
  161. package/src/partials/w3m-header/index.tsx +4 -15
  162. package/src/partials/w3m-information-modal/index.tsx +28 -32
  163. package/src/partials/w3m-information-modal/styles.ts +7 -5
  164. package/src/partials/w3m-selector-modal/index.tsx +61 -65
  165. package/src/partials/w3m-selector-modal/styles.ts +1 -0
  166. package/src/utils/RouterUtil.ts +50 -0
  167. package/src/utils/UiUtil.ts +14 -6
  168. package/src/views/w3m-all-wallets-view/index.tsx +2 -1
  169. package/src/views/w3m-connect-view/index.tsx +3 -2
  170. package/src/views/w3m-connecting-external-view/index.tsx +3 -1
  171. package/src/views/w3m-connecting-siwe-view/index.tsx +0 -2
  172. package/src/views/w3m-networks-view/index.tsx +2 -8
  173. package/src/views/w3m-onramp-view/components/Header.tsx +4 -6
  174. package/src/views/w3m-onramp-view/components/SelectPaymentModal.tsx +49 -56
  175. package/src/views/w3m-swap-preview-view/index.tsx +4 -23
  176. package/src/views/w3m-swap-preview-view/styles.ts +3 -0
  177. package/src/views/w3m-swap-view/components/select-token-view/index.tsx +12 -3
  178. package/src/views/w3m-swap-view/components/select-token-view/styles.ts +1 -2
  179. package/src/views/w3m-swap-view/index.tsx +7 -20
  180. package/src/views/w3m-swap-view/styles.ts +5 -1
  181. package/src/views/w3m-wallet-send-view/index.tsx +5 -10
  182. package/src/views/w3m-wallet-send-view/styles.ts +3 -0
  183. package/lib/commonjs/config/animations.js +0 -9
  184. package/lib/commonjs/config/animations.js.map +0 -1
  185. package/lib/commonjs/partials/w3m-otp-code/index.js +0 -89
  186. package/lib/commonjs/partials/w3m-otp-code/index.js.map +0 -1
  187. package/lib/commonjs/partials/w3m-otp-code/styles.js +0 -21
  188. package/lib/commonjs/partials/w3m-otp-code/styles.js.map +0 -1
  189. package/lib/module/config/animations.js +0 -9
  190. package/lib/module/config/animations.js.map +0 -1
  191. package/lib/module/partials/w3m-otp-code/index.js +0 -84
  192. package/lib/module/partials/w3m-otp-code/index.js.map +0 -1
  193. package/lib/module/partials/w3m-otp-code/styles.js +0 -17
  194. package/lib/module/partials/w3m-otp-code/styles.js.map +0 -1
  195. package/lib/typescript/config/animations.d.ts +0 -2
  196. package/lib/typescript/config/animations.d.ts.map +0 -1
  197. package/lib/typescript/partials/w3m-otp-code/index.d.ts +0 -16
  198. package/lib/typescript/partials/w3m-otp-code/index.d.ts.map +0 -1
  199. package/lib/typescript/partials/w3m-otp-code/styles.d.ts +0 -14
  200. package/lib/typescript/partials/w3m-otp-code/styles.d.ts.map +0 -1
  201. package/src/config/animations.ts +0 -7
  202. package/src/partials/w3m-otp-code/index.tsx +0 -81
  203. package/src/partials/w3m-otp-code/styles.ts +0 -15
@@ -1,6 +1,5 @@
1
1
  import { useSnapshot } from 'valtio';
2
- import Modal from 'react-native-modal';
3
- import { FlatList, View } from 'react-native';
2
+ import { FlatList, View, Modal } from 'react-native';
4
3
  import {
5
4
  FlexView,
6
5
  IconBox,
@@ -54,72 +53,69 @@ export function SelectorModal({
54
53
  };
55
54
 
56
55
  return (
57
- <Modal
58
- isVisible={visible}
59
- useNativeDriver
60
- useNativeDriverForBackdrop
61
- statusBarTranslucent
62
- hideModalContentWhileAnimating
63
- onBackdropPress={onClose}
64
- onDismiss={onClose}
65
- style={styles.modal}
66
- >
67
- <FlexView style={[styles.container, { backgroundColor: Theme['bg-100'] }]}>
68
- <FlexView
69
- alignItems="center"
70
- justifyContent="space-between"
71
- flexDirection="row"
72
- style={styles.header}
73
- >
74
- <IconLink icon="chevronLeft" onPress={onClose} testID="selector-modal-button-back" />
75
- {!!title && <Text variant="paragraph-600">{title}</Text>}
76
- {showNetwork ? (
77
- networkImage ? (
78
- <FlexView alignItems="center" justifyContent="center" style={styles.iconPlaceholder}>
79
- <Image source={networkImage} style={styles.networkImage} />
80
- </FlexView>
56
+ <Modal visible={visible} transparent animationType="slide" onRequestClose={onClose}>
57
+ <View style={styles.modal}>
58
+ <FlexView style={[styles.container, { backgroundColor: Theme['bg-100'] }]}>
59
+ <FlexView
60
+ alignItems="center"
61
+ justifyContent="space-between"
62
+ flexDirection="row"
63
+ style={styles.header}
64
+ >
65
+ <IconLink icon="chevronLeft" onPress={onClose} testID="selector-modal-button-back" />
66
+ {!!title && <Text variant="paragraph-600">{title}</Text>}
67
+ {showNetwork ? (
68
+ networkImage ? (
69
+ <FlexView
70
+ alignItems="center"
71
+ justifyContent="center"
72
+ style={styles.iconPlaceholder}
73
+ >
74
+ <Image source={networkImage} style={styles.networkImage} />
75
+ </FlexView>
76
+ ) : (
77
+ <IconBox
78
+ style={styles.iconPlaceholder}
79
+ icon="networkPlaceholder"
80
+ background
81
+ iconColor="fg-200"
82
+ size="sm"
83
+ />
84
+ )
81
85
  ) : (
82
- <IconBox
83
- style={styles.iconPlaceholder}
84
- icon="networkPlaceholder"
85
- background
86
- iconColor="fg-200"
87
- size="sm"
88
- />
89
- )
90
- ) : (
91
- <View style={styles.iconPlaceholder} />
86
+ <View style={styles.iconPlaceholder} />
87
+ )}
88
+ </FlexView>
89
+ <SearchBar
90
+ onChangeText={onSearch}
91
+ style={styles.searchBar}
92
+ placeholder={searchPlaceholder}
93
+ />
94
+ {selectedItem && (
95
+ <FlexView style={styles.selectedContainer}>
96
+ {renderItem({ item: selectedItem })}
97
+ <Separator style={styles.separator} color="gray-glass-020" />
98
+ </FlexView>
92
99
  )}
100
+ <FlatList
101
+ data={items}
102
+ renderItem={renderItem}
103
+ fadingEdgeLength={20}
104
+ contentContainerStyle={styles.listContent}
105
+ ItemSeparatorComponent={renderSeparator}
106
+ keyExtractor={keyExtractor}
107
+ getItemLayout={
108
+ itemHeight
109
+ ? (_, index) => ({
110
+ length: itemHeight + SEPARATOR_HEIGHT,
111
+ offset: (itemHeight + SEPARATOR_HEIGHT) * index,
112
+ index
113
+ })
114
+ : undefined
115
+ }
116
+ />
93
117
  </FlexView>
94
- <SearchBar
95
- onChangeText={onSearch}
96
- style={styles.searchBar}
97
- placeholder={searchPlaceholder}
98
- />
99
- {selectedItem && (
100
- <FlexView style={styles.selectedContainer}>
101
- {renderItem({ item: selectedItem })}
102
- <Separator style={styles.separator} color="gray-glass-020" />
103
- </FlexView>
104
- )}
105
- <FlatList
106
- data={items}
107
- renderItem={renderItem}
108
- fadingEdgeLength={20}
109
- contentContainerStyle={styles.listContent}
110
- ItemSeparatorComponent={renderSeparator}
111
- keyExtractor={keyExtractor}
112
- getItemLayout={
113
- itemHeight
114
- ? (_, index) => ({
115
- length: itemHeight + SEPARATOR_HEIGHT,
116
- offset: (itemHeight + SEPARATOR_HEIGHT) * index,
117
- index
118
- })
119
- : undefined
120
- }
121
- />
122
- </FlexView>
118
+ </View>
123
119
  </Modal>
124
120
  );
125
121
  }
@@ -3,6 +3,7 @@ import { StyleSheet } from 'react-native';
3
3
 
4
4
  export default StyleSheet.create({
5
5
  modal: {
6
+ flex: 1,
6
7
  margin: 0,
7
8
  justifyContent: 'flex-end'
8
9
  },
@@ -0,0 +1,50 @@
1
+ import {
2
+ EventsController,
3
+ OnRampController,
4
+ RouterController,
5
+ SendController,
6
+ SwapController
7
+ } from '@reown/appkit-core-react-native';
8
+
9
+ export const RouterUtil = {
10
+ checkBack() {
11
+ this.checkSwapBack();
12
+ this.checkSendBack();
13
+ this.checkOnRampBack();
14
+ this.checkSocialLoginBack();
15
+ this.checkOnRampBackLoading();
16
+ },
17
+ checkOnRampBackLoading() {
18
+ if (
19
+ RouterController.state.view === 'OnRampLoading' &&
20
+ EventsController.state.data.event === 'BUY_SUBMITTED'
21
+ ) {
22
+ // Send event only if the onramp url was already created
23
+ EventsController.sendEvent({ type: 'track', event: 'BUY_CANCEL' });
24
+ }
25
+ },
26
+ checkSocialLoginBack() {
27
+ if (RouterController.state.view === 'ConnectingSocial') {
28
+ EventsController.sendEvent({
29
+ type: 'track',
30
+ event: 'SOCIAL_LOGIN_CANCELED',
31
+ properties: { provider: RouterController.state.data?.socialProvider! }
32
+ });
33
+ }
34
+ },
35
+ checkSwapBack() {
36
+ if (RouterController.state.view === 'Swap') {
37
+ SwapController.clearTokens();
38
+ }
39
+ },
40
+ checkSendBack() {
41
+ if (RouterController.state.view === 'WalletSend') {
42
+ SendController.resetState();
43
+ }
44
+ },
45
+ checkOnRampBack() {
46
+ if (RouterController.state.view === 'OnRamp') {
47
+ OnRampController.resetState();
48
+ }
49
+ }
50
+ };
@@ -1,22 +1,30 @@
1
1
  import {
2
2
  AssetUtil,
3
3
  ConnectionController,
4
+ RouterController,
4
5
  StorageUtil,
5
6
  type WcWallet
6
7
  } from '@reown/appkit-core-react-native';
7
8
  import type { WalletDeepLink } from '@reown/appkit-common-react-native';
8
9
 
10
+ // Global animation instance to coordinate transitions
11
+ let currentRouteTransition: ((direction: 'forward' | 'backward' | 'none') => Promise<void>) | null =
12
+ null;
13
+
9
14
  export const UiUtil = {
10
15
  TOTAL_VISIBLE_WALLETS: 4,
11
16
 
12
- createViewTransition: () => {
13
- //TODO: replace this with reanimated
14
- // LayoutAnimation.configureNext(LayoutAnimation.create(200, 'easeInEaseOut', 'opacity'));
17
+ setRouteTransition: (
18
+ transitionFn: (direction: 'forward' | 'backward' | 'none') => Promise<void>
19
+ ) => {
20
+ currentRouteTransition = transitionFn;
15
21
  },
16
22
 
17
- animateChange: () => {
18
- //TODO: replace this with reanimated
19
- // LayoutAnimation.configureNext(LayoutAnimation.create(150, type, creationProp));
23
+ createViewTransition: async () => {
24
+ if (currentRouteTransition) {
25
+ const { navigationDirection } = RouterController.state;
26
+ await currentRouteTransition(navigationDirection);
27
+ }
20
28
  },
21
29
 
22
30
  storeConnectedWallet: async (wcLinking: WalletDeepLink, pressedWallet?: WcWallet) => {
@@ -26,7 +26,8 @@ export function AllWalletsView() {
26
26
 
27
27
  const onWalletPress = (wallet: WcWallet) => {
28
28
  const isExternal =
29
- wallet.id === ConstantsUtil.PHANTOM_EXPLORER_ID ||
29
+ wallet.id === ConstantsUtil.PHANTOM_CUSTOM_WALLET.id ||
30
+ wallet.id === ConstantsUtil.SOLFLARE_CUSTOM_WALLET.id ||
30
31
  wallet.id === ConstantsUtil.COINBASE_EXPLORER_ID;
31
32
  if (isExternal) {
32
33
  RouterController.push('ConnectingExternal', { wallet });
@@ -31,8 +31,9 @@ export function ConnectView() {
31
31
 
32
32
  const onWalletPress = (wallet: WcWallet, isInstalled?: boolean) => {
33
33
  const isExternal =
34
- wallet.id === ConstantsUtil.PHANTOM_EXPLORER_ID ||
35
- wallet.id === ConstantsUtil.COINBASE_EXPLORER_ID;
34
+ wallet.id === ConstantsUtil.PHANTOM_CUSTOM_WALLET.id ||
35
+ wallet.id === ConstantsUtil.COINBASE_EXPLORER_ID ||
36
+ wallet.id === ConstantsUtil.SOLFLARE_CUSTOM_WALLET.id;
36
37
  if (isExternal) {
37
38
  RouterController.push('ConnectingExternal', { wallet });
38
39
  } else {
@@ -39,8 +39,10 @@ export function ConnectingExternalView() {
39
39
  try {
40
40
  const wallet = RouterController.state.data?.wallet;
41
41
  if (wallet) {
42
- if (wallet.id === ConstantsUtil.PHANTOM_EXPLORER_ID) {
42
+ if (wallet.id === ConstantsUtil.PHANTOM_CUSTOM_WALLET.id) {
43
43
  await connect('phantom');
44
+ } else if (wallet.id === ConstantsUtil.SOLFLARE_CUSTOM_WALLET.id) {
45
+ await connect('solflare');
44
46
  } else if (wallet.id === ConstantsUtil.COINBASE_EXPLORER_ID) {
45
47
  await connect('coinbase');
46
48
  } else {
@@ -13,7 +13,6 @@ import {
13
13
  ConnectionController,
14
14
  ConnectionsController,
15
15
  EventsController,
16
- ModalController,
17
16
  OptionsController,
18
17
  RouterController,
19
18
  SnackController
@@ -73,7 +72,6 @@ export function ConnectingSiweView() {
73
72
  if (ConnectionsController.state.activeAddress) {
74
73
  setIsDisconnecting(true);
75
74
  await disconnect();
76
- ModalController.close();
77
75
  setIsDisconnecting(false);
78
76
  } else {
79
77
  RouterController.push('Connect');
@@ -13,7 +13,6 @@ import {
13
13
  RouterController,
14
14
  EventsController,
15
15
  ConnectionsController,
16
- ModalController,
17
16
  OptionsController,
18
17
  AssetController
19
18
  } from '@reown/appkit-core-react-native';
@@ -34,7 +33,7 @@ export function NetworksView() {
34
33
  const itemGap = Math.abs(
35
34
  Math.trunc((usableWidth - numColumns * CardSelectWidth) / numColumns) / 2
36
35
  );
37
- const { switchNetwork } = useAppKit();
36
+ const { switchNetwork, back } = useAppKit();
38
37
 
39
38
  const networkList = isConnected ? ConnectionsController.getConnectedNetworks() : networks;
40
39
 
@@ -46,12 +45,7 @@ export function NetworksView() {
46
45
  const networksTemplate = () => {
47
46
  const onNetworkPress = async (network: AppKitNetwork) => {
48
47
  await switchNetwork(network);
49
-
50
- if (RouterController.state.history.length > 1) {
51
- RouterController.goBack();
52
- } else {
53
- ModalController.close();
54
- }
48
+ back();
55
49
  };
56
50
 
57
51
  return networkList.map(network => {
@@ -1,18 +1,16 @@
1
1
  import { StyleSheet } from 'react-native';
2
- import { ModalController, RouterController } from '@reown/appkit-core-react-native';
3
2
  import { IconLink, Text, FlexView } from '@reown/appkit-ui-react-native';
3
+ import { useAppKit } from '../../../AppKitContext';
4
4
 
5
5
  interface HeaderProps {
6
6
  onSettingsPress: () => void;
7
7
  }
8
8
 
9
9
  export function Header({ onSettingsPress }: HeaderProps) {
10
+ const { back } = useAppKit();
11
+
10
12
  const handleGoBack = () => {
11
- if (RouterController.state.history.length > 1) {
12
- RouterController.goBack();
13
- } else {
14
- ModalController.close();
15
- }
13
+ back();
16
14
  };
17
15
 
18
16
  return (
@@ -1,8 +1,7 @@
1
1
  /* eslint-disable valtio/state-snapshot-rule */
2
2
  import { useSnapshot } from 'valtio';
3
3
  import { useRef, useState, useMemo, useEffect } from 'react';
4
- import Modal from 'react-native-modal';
5
- import { FlatList, StyleSheet, View } from 'react-native';
4
+ import { FlatList, StyleSheet, View, Modal } from 'react-native';
6
5
  import {
7
6
  FlexView,
8
7
  IconLink,
@@ -135,69 +134,63 @@ export function SelectPaymentModal({ title, visible, onClose }: SelectPaymentMod
135
134
  }, [visible]);
136
135
 
137
136
  return (
138
- <Modal
139
- isVisible={visible}
140
- useNativeDriver
141
- useNativeDriverForBackdrop
142
- statusBarTranslucent
143
- hideModalContentWhileAnimating
144
- onBackdropPress={onClose}
145
- onDismiss={onClose}
146
- style={styles.modal}
147
- >
148
- <FlexView style={[styles.container, { backgroundColor: Theme['bg-100'] }]}>
149
- <FlexView
150
- alignItems="center"
151
- justifyContent="space-between"
152
- flexDirection="row"
153
- style={styles.header}
154
- >
155
- <IconLink icon="arrowLeft" onPress={onClose} testID="payment-modal-button-back" />
156
- {!!title && <Text variant="paragraph-600">{title}</Text>}
157
- <View style={styles.iconPlaceholder} />
158
- </FlexView>
159
- <Text variant="small-500" color="fg-150" style={styles.subtitle}>
160
- Pay with
161
- </Text>
162
- <FlexView>
137
+ <Modal visible={visible} transparent animationType="slide" onRequestClose={onClose}>
138
+ <View style={styles.modalContent}>
139
+ <FlexView style={[styles.container, { backgroundColor: Theme['bg-100'] }]}>
140
+ <FlexView
141
+ alignItems="center"
142
+ justifyContent="space-between"
143
+ flexDirection="row"
144
+ style={styles.header}
145
+ >
146
+ <IconLink icon="arrowLeft" onPress={onClose} testID="payment-modal-button-back" />
147
+ {!!title && <Text variant="paragraph-600">{title}</Text>}
148
+ <View style={styles.iconPlaceholder} />
149
+ </FlexView>
150
+ <Text variant="small-500" color="fg-150" style={styles.subtitle}>
151
+ Pay with
152
+ </Text>
153
+ <FlexView>
154
+ <FlatList
155
+ data={availablePaymentMethods}
156
+ renderItem={renderPaymentMethod}
157
+ ref={paymentMethodsRef}
158
+ style={styles.paymentMethodsContainer}
159
+ contentContainerStyle={styles.paymentMethodsContent}
160
+ fadingEdgeLength={20}
161
+ keyExtractor={item => item.paymentMethod}
162
+ horizontal
163
+ showsHorizontalScrollIndicator={false}
164
+ />
165
+ </FlexView>
166
+ <Separator style={styles.separator} color="gray-glass-010" />
167
+ <Text variant="small-500" color="fg-150" style={styles.subtitle}>
168
+ Providers
169
+ </Text>
163
170
  <FlatList
164
- data={availablePaymentMethods}
165
- renderItem={renderPaymentMethod}
166
- ref={paymentMethodsRef}
167
- style={styles.paymentMethodsContainer}
168
- contentContainerStyle={styles.paymentMethodsContent}
171
+ data={sortedQuotes}
172
+ bounces={false}
173
+ renderItem={renderQuote}
174
+ extraData={selectedPaymentMethod}
175
+ contentContainerStyle={styles.listContent}
176
+ ItemSeparatorComponent={renderSeparator}
169
177
  fadingEdgeLength={20}
170
- keyExtractor={item => item.paymentMethod}
171
- horizontal
172
- showsHorizontalScrollIndicator={false}
178
+ keyExtractor={item => `${item.serviceProvider}-${item.paymentMethodType}`}
179
+ getItemLayout={(_, index) => ({
180
+ length: QUOTE_ITEM_HEIGHT + SEPARATOR_HEIGHT,
181
+ offset: (QUOTE_ITEM_HEIGHT + SEPARATOR_HEIGHT) * index,
182
+ index
183
+ })}
173
184
  />
174
185
  </FlexView>
175
- <Separator style={styles.separator} color="gray-glass-010" />
176
- <Text variant="small-500" color="fg-150" style={styles.subtitle}>
177
- Providers
178
- </Text>
179
- <FlatList
180
- data={sortedQuotes}
181
- bounces={false}
182
- renderItem={renderQuote}
183
- extraData={selectedPaymentMethod}
184
- contentContainerStyle={styles.listContent}
185
- ItemSeparatorComponent={renderSeparator}
186
- fadingEdgeLength={20}
187
- keyExtractor={item => `${item.serviceProvider}-${item.paymentMethodType}`}
188
- getItemLayout={(_, index) => ({
189
- length: QUOTE_ITEM_HEIGHT + SEPARATOR_HEIGHT,
190
- offset: (QUOTE_ITEM_HEIGHT + SEPARATOR_HEIGHT) * index,
191
- index
192
- })}
193
- />
194
- </FlexView>
186
+ </View>
195
187
  </Modal>
196
188
  );
197
189
  }
198
190
  const styles = StyleSheet.create({
199
- modal: {
191
+ modalContent: {
200
192
  margin: 0,
193
+ flex: 1,
201
194
  justifyContent: 'flex-end'
202
195
  },
203
196
  header: {
@@ -1,25 +1,15 @@
1
1
  import { useSnapshot } from 'valtio';
2
2
  import { useEffect } from 'react';
3
- import { Platform, ScrollView } from 'react-native';
3
+ import { ScrollView } from 'react-native';
4
4
  import { NumberUtil } from '@reown/appkit-common-react-native';
5
5
  import { RouterController, SwapController } from '@reown/appkit-core-react-native';
6
- import {
7
- Button,
8
- FlexView,
9
- Icon,
10
- Spacing,
11
- Text,
12
- TokenButton,
13
- UiUtil
14
- } from '@reown/appkit-ui-react-native';
6
+ import { Button, FlexView, Icon, Text, TokenButton, UiUtil } from '@reown/appkit-ui-react-native';
15
7
  import { SwapDetails } from '../../partials/w3m-swap-details';
16
8
  import { useCustomDimensions } from '../../hooks/useCustomDimensions';
17
- import { useKeyboard } from '../../hooks/useKeyboard';
18
9
  import styles from './styles';
19
10
 
20
11
  export function SwapPreviewView() {
21
12
  const { padding } = useCustomDimensions();
22
- const { keyboardShown, keyboardHeight } = useKeyboard();
23
13
  const {
24
14
  sourceToken,
25
15
  sourceTokenAmount,
@@ -37,11 +27,6 @@ export function SwapPreviewView() {
37
27
  NumberUtil.parseLocalStringToNumber(sourceTokenAmount) * sourceTokenPriceInUSD;
38
28
  const toTokenMarketValue = NumberUtil.parseLocalStringToNumber(toTokenAmount) * toTokenPriceInUSD;
39
29
 
40
- const paddingBottom = Platform.select({
41
- android: keyboardShown ? keyboardHeight + Spacing['2xl'] : Spacing['2xl'],
42
- default: Spacing['2xl']
43
- });
44
-
45
30
  const loading =
46
31
  loadingQuote || loadingBuildTransaction || loadingTransaction || loadingApprovalTransaction;
47
32
 
@@ -75,12 +60,8 @@ export function SwapPreviewView() {
75
60
  }, []);
76
61
 
77
62
  return (
78
- <ScrollView
79
- style={{ paddingHorizontal: padding }}
80
- bounces={false}
81
- keyboardShouldPersistTaps="always"
82
- >
83
- <FlexView padding="l" justifyContent="center" style={{ paddingBottom }}>
63
+ <ScrollView style={{ paddingHorizontal: padding }} bounces={false}>
64
+ <FlexView padding={['l', 'l', '2xl', 'l']} justifyContent="center">
84
65
  <FlexView flexDirection="row" justifyContent="space-between">
85
66
  <FlexView>
86
67
  <Text variant="small-400" color="fg-150">
@@ -14,5 +14,8 @@ export default StyleSheet.create({
14
14
  sendButton: {
15
15
  marginLeft: Spacing.s,
16
16
  flex: 3
17
+ },
18
+ withKeyboard: {
19
+ height: '100%'
17
20
  }
18
21
  });
@@ -1,6 +1,13 @@
1
1
  import { useState } from 'react';
2
2
  import { useSnapshot } from 'valtio';
3
- import { ScrollView, SectionList, View, type SectionListData } from 'react-native';
3
+ import {
4
+ ScrollView,
5
+ SectionList,
6
+ View,
7
+ type SectionListData,
8
+ type StyleProp,
9
+ type ViewStyle
10
+ } from 'react-native';
4
11
  import {
5
12
  FlexView,
6
13
  IconLink,
@@ -30,9 +37,10 @@ import { createSections } from './utils';
30
37
  interface Props {
31
38
  onClose: () => void;
32
39
  type?: SwapInputTarget;
40
+ style?: StyleProp<ViewStyle>;
33
41
  }
34
42
 
35
- export function SwapSelectTokenView({ onClose, type }: Props) {
43
+ export function SwapSelectTokenView({ onClose, type, style }: Props) {
36
44
  const { padding } = useCustomDimensions();
37
45
  const Theme = useTheme();
38
46
  const { activeNetwork } = useSnapshot(ConnectionsController.state);
@@ -77,7 +85,8 @@ export function SwapSelectTokenView({ onClose, type }: Props) {
77
85
  {
78
86
  paddingHorizontal: padding,
79
87
  backgroundColor: Theme['bg-100']
80
- }
88
+ },
89
+ style
81
90
  ]}
82
91
  >
83
92
  <FlexView
@@ -8,8 +8,7 @@ export default StyleSheet.create({
8
8
  borderBottomLeftRadius: 0,
9
9
  borderBottomRightRadius: 0,
10
10
  overflow: 'hidden',
11
- marginTop: 80,
12
- flex: 1
11
+ marginTop: 80
13
12
  },
14
13
  title: {
15
14
  paddingTop: Spacing['2xs']
@@ -1,7 +1,6 @@
1
1
  import { useSnapshot } from 'valtio';
2
2
  import { useEffect, useState } from 'react';
3
- import { Platform, ScrollView } from 'react-native';
4
- import Modal from 'react-native-modal';
3
+ import { ScrollView, Modal } from 'react-native';
5
4
  import {
6
5
  ConnectionsController,
7
6
  ConstantsUtil,
@@ -10,7 +9,7 @@ import {
10
9
  SwapController,
11
10
  type SwapInputTarget
12
11
  } from '@reown/appkit-core-react-native';
13
- import { Button, FlexView, IconLink, Spacing, useTheme } from '@reown/appkit-ui-react-native';
12
+ import { Button, FlexView, IconLink, useTheme } from '@reown/appkit-ui-react-native';
14
13
  import { NumberUtil } from '@reown/appkit-common-react-native';
15
14
 
16
15
  import { useKeyboard } from '../../hooks/useKeyboard';
@@ -37,7 +36,7 @@ export function SwapView() {
37
36
  } = useSnapshot(SwapController.state);
38
37
  const Theme = useTheme();
39
38
  const { padding } = useCustomDimensions();
40
- const { keyboardShown, keyboardHeight } = useKeyboard();
39
+ const { keyboardShown } = useKeyboard();
41
40
  const [showModal, setShowModal] = useState<SwapInputTarget | undefined>();
42
41
  const showDetails = !!sourceToken && !!toToken && !inputError;
43
42
 
@@ -51,11 +50,6 @@ export function SwapView() {
51
50
  token => token.address === SwapController.state.toToken?.address
52
51
  ) >= 0;
53
52
 
54
- const paddingBottom = Platform.select({
55
- android: keyboardShown ? keyboardHeight + Spacing['2xl'] : Spacing['2xl'],
56
- default: Spacing['2xl']
57
- });
58
-
59
53
  const getActionButtonState = () => {
60
54
  if (!SwapController.state.sourceToken || !SwapController.state.toToken) {
61
55
  return { text: 'Select token', disabled: true };
@@ -159,11 +153,11 @@ export function SwapView() {
159
153
  return (
160
154
  <>
161
155
  <ScrollView
162
- style={{ paddingHorizontal: padding }}
156
+ style={[{ paddingHorizontal: padding }, keyboardShown && styles.withKeyboard]}
163
157
  bounces={false}
164
158
  keyboardShouldPersistTaps="always"
165
159
  >
166
- <FlexView padding="l" alignItems="center" justifyContent="center" style={{ paddingBottom }}>
160
+ <FlexView padding={['l', 'l', '2xl', 'l']} alignItems="center" justifyContent="center">
167
161
  <SwapInput
168
162
  token={sourceToken}
169
163
  value={sourceTokenAmount}
@@ -210,15 +204,8 @@ export function SwapView() {
210
204
  </Button>
211
205
  </FlexView>
212
206
  </ScrollView>
213
- <Modal
214
- isVisible={!!showModal}
215
- useNativeDriver
216
- useNativeDriverForBackdrop
217
- onBackdropPress={onModalClose}
218
- onDismiss={onModalClose}
219
- style={styles.modal}
220
- >
221
- <SwapSelectTokenView onClose={onModalClose} type={showModal} />
207
+ <Modal visible={!!showModal} transparent animationType="slide" onRequestClose={onModalClose}>
208
+ <SwapSelectTokenView style={styles.modalContent} onClose={onModalClose} type={showModal} />
222
209
  </Modal>
223
210
  </>
224
211
  );