@reown/appkit-react-native 0.0.0-fix-height-calc-20250815195135 → 0.0.0-fix-ui-changes-20250828183750
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 +7 -5
- package/lib/commonjs/AppKit.js.map +1 -1
- package/lib/commonjs/connectors/WalletConnectConnector.js +1 -2
- package/lib/commonjs/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/commonjs/modal/w3m-modal/index.js +1 -6
- package/lib/commonjs/modal/w3m-modal/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-router/index.js +7 -1
- package/lib/commonjs/modal/w3m-router/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/components/Loading.js +7 -97
- package/lib/commonjs/partials/w3m-all-wallets-list/components/Loading.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletItem.js +5 -4
- package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletItem.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletList.js +85 -0
- package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletList.js.map +1 -0
- package/lib/commonjs/partials/w3m-all-wallets-list/index.js +7 -41
- package/lib/commonjs/partials/w3m-all-wallets-list/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/styles.js +8 -4
- package/lib/commonjs/partials/w3m-all-wallets-list/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-search/index.js +7 -38
- package/lib/commonjs/partials/w3m-all-wallets-search/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-search/styles.js +2 -2
- package/lib/commonjs/partials/w3m-all-wallets-search/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-selector-modal/styles.js +1 -1
- package/lib/commonjs/partials/w3m-selector-modal/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-all-wallets-view/index.js +2 -19
- package/lib/commonjs/views/w3m-all-wallets-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/index.js +1 -1
- package/lib/commonjs/views/w3m-connect-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-checkout-view/index.js +160 -152
- package/lib/commonjs/views/w3m-onramp-checkout-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/SelectPaymentModal.js +1 -1
- package/lib/commonjs/views/w3m-onramp-view/components/SelectPaymentModal.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-view/components/select-token-modal/index.js +155 -0
- package/lib/commonjs/views/w3m-swap-view/components/select-token-modal/index.js.map +1 -0
- package/lib/commonjs/views/w3m-swap-view/components/{select-token-view → select-token-modal}/styles.js +4 -2
- package/lib/commonjs/views/w3m-swap-view/components/select-token-modal/styles.js.map +1 -0
- package/lib/commonjs/views/w3m-swap-view/components/select-token-modal/utils.js.map +1 -0
- package/lib/commonjs/views/w3m-swap-view/index.js +4 -10
- package/lib/commonjs/views/w3m-swap-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-view/styles.js +0 -5
- package/lib/commonjs/views/w3m-swap-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js +1 -2
- package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-view/styles.js +1 -1
- package/lib/module/AppKit.js +7 -5
- package/lib/module/AppKit.js.map +1 -1
- package/lib/module/connectors/WalletConnectConnector.js +1 -2
- package/lib/module/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/module/modal/w3m-modal/index.js +2 -7
- package/lib/module/modal/w3m-modal/index.js.map +1 -1
- package/lib/module/modal/w3m-router/index.js +7 -1
- package/lib/module/modal/w3m-router/index.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/components/Loading.js +8 -98
- package/lib/module/partials/w3m-all-wallets-list/components/Loading.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/components/WalletItem.js +5 -4
- package/lib/module/partials/w3m-all-wallets-list/components/WalletItem.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/components/WalletList.js +81 -0
- package/lib/module/partials/w3m-all-wallets-list/components/WalletList.js.map +1 -0
- package/lib/module/partials/w3m-all-wallets-list/index.js +7 -41
- package/lib/module/partials/w3m-all-wallets-list/index.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/styles.js +8 -4
- package/lib/module/partials/w3m-all-wallets-list/styles.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-search/index.js +8 -39
- package/lib/module/partials/w3m-all-wallets-search/index.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-search/styles.js +2 -2
- package/lib/module/partials/w3m-all-wallets-search/styles.js.map +1 -1
- package/lib/module/partials/w3m-selector-modal/styles.js +1 -1
- package/lib/module/partials/w3m-selector-modal/styles.js.map +1 -1
- package/lib/module/views/w3m-all-wallets-view/index.js +3 -20
- package/lib/module/views/w3m-all-wallets-view/index.js.map +1 -1
- package/lib/module/views/w3m-connect-view/index.js +1 -1
- package/lib/module/views/w3m-connect-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-checkout-view/index.js +162 -154
- package/lib/module/views/w3m-onramp-checkout-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/components/SelectPaymentModal.js +1 -1
- package/lib/module/views/w3m-onramp-view/components/SelectPaymentModal.js.map +1 -1
- package/lib/module/views/w3m-swap-view/components/select-token-modal/index.js +150 -0
- package/lib/module/views/w3m-swap-view/components/select-token-modal/index.js.map +1 -0
- package/lib/module/views/w3m-swap-view/components/{select-token-view → select-token-modal}/styles.js +4 -2
- package/lib/module/views/w3m-swap-view/components/select-token-modal/styles.js.map +1 -0
- package/lib/module/views/w3m-swap-view/components/select-token-modal/utils.js.map +1 -0
- package/lib/module/views/w3m-swap-view/index.js +5 -11
- package/lib/module/views/w3m-swap-view/index.js.map +1 -1
- package/lib/module/views/w3m-swap-view/styles.js +0 -5
- package/lib/module/views/w3m-swap-view/styles.js.map +1 -1
- package/lib/module/views/w3m-wallet-compatible-networks-view/index.js +1 -2
- package/lib/module/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-view/styles.js +1 -1
- package/lib/typescript/AppKit.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-all-wallets-list/components/Loading.d.ts +2 -4
- package/lib/typescript/partials/w3m-all-wallets-list/components/Loading.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-list/components/WalletItem.d.ts +2 -1
- package/lib/typescript/partials/w3m-all-wallets-list/components/WalletItem.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-list/components/WalletList.d.ts +12 -0
- package/lib/typescript/partials/w3m-all-wallets-list/components/WalletList.d.ts.map +1 -0
- package/lib/typescript/partials/w3m-all-wallets-list/index.d.ts +1 -3
- package/lib/typescript/partials/w3m-all-wallets-list/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-list/styles.d.ts +7 -3
- package/lib/typescript/partials/w3m-all-wallets-list/styles.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-search/index.d.ts +1 -4
- package/lib/typescript/partials/w3m-all-wallets-search/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-search/styles.d.ts +1 -1
- package/lib/typescript/partials/w3m-selector-modal/styles.d.ts +1 -1
- package/lib/typescript/views/w3m-all-wallets-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-checkout-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-view/components/{select-token-view → select-token-modal}/index.d.ts +2 -1
- package/lib/typescript/views/w3m-swap-view/components/select-token-modal/index.d.ts.map +1 -0
- package/lib/typescript/views/w3m-swap-view/components/{select-token-view → select-token-modal}/styles.d.ts +4 -2
- package/lib/typescript/views/w3m-swap-view/components/{select-token-view → select-token-modal}/styles.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-view/components/select-token-modal/utils.d.ts.map +1 -0
- package/lib/typescript/views/w3m-swap-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-view/styles.d.ts +0 -5
- package/lib/typescript/views/w3m-swap-view/styles.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-send-view/styles.d.ts +1 -1
- package/package.json +5 -5
- package/src/AppKit.ts +13 -5
- package/src/connectors/WalletConnectConnector.ts +2 -2
- package/src/modal/w3m-modal/index.tsx +2 -3
- package/src/modal/w3m-router/index.tsx +3 -1
- package/src/partials/w3m-all-wallets-list/components/Loading.tsx +4 -35
- package/src/partials/w3m-all-wallets-list/components/WalletItem.tsx +5 -3
- package/src/partials/w3m-all-wallets-list/components/WalletList.tsx +92 -0
- package/src/partials/w3m-all-wallets-list/index.tsx +7 -38
- package/src/partials/w3m-all-wallets-list/styles.ts +8 -4
- package/src/partials/w3m-all-wallets-search/index.tsx +6 -43
- package/src/partials/w3m-all-wallets-search/styles.ts +2 -2
- package/src/partials/w3m-selector-modal/styles.ts +1 -1
- package/src/views/w3m-all-wallets-view/index.tsx +2 -29
- package/src/views/w3m-connect-view/index.tsx +1 -1
- package/src/views/w3m-onramp-checkout-view/index.tsx +147 -143
- package/src/views/w3m-onramp-view/components/SelectPaymentModal.tsx +1 -1
- package/src/views/w3m-swap-view/components/select-token-modal/index.tsx +182 -0
- package/src/views/w3m-swap-view/components/{select-token-view → select-token-modal}/styles.ts +4 -2
- package/src/views/w3m-swap-view/index.tsx +3 -5
- package/src/views/w3m-swap-view/styles.ts +1 -5
- package/src/views/w3m-wallet-compatible-networks-view/index.tsx +1 -1
- package/src/views/w3m-wallet-send-view/styles.ts +1 -1
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/index.js +0 -145
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/index.js.map +0 -1
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/styles.js.map +0 -1
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/utils.js.map +0 -1
- package/lib/module/views/w3m-swap-view/components/select-token-view/index.js +0 -140
- package/lib/module/views/w3m-swap-view/components/select-token-view/index.js.map +0 -1
- package/lib/module/views/w3m-swap-view/components/select-token-view/styles.js.map +0 -1
- package/lib/module/views/w3m-swap-view/components/select-token-view/utils.js.map +0 -1
- package/lib/typescript/views/w3m-swap-view/components/select-token-view/index.d.ts.map +0 -1
- package/lib/typescript/views/w3m-swap-view/components/select-token-view/utils.d.ts.map +0 -1
- package/src/views/w3m-swap-view/components/select-token-view/index.tsx +0 -176
- /package/lib/commonjs/views/w3m-swap-view/components/{select-token-view → select-token-modal}/utils.js +0 -0
- /package/lib/module/views/w3m-swap-view/components/{select-token-view → select-token-modal}/utils.js +0 -0
- /package/lib/typescript/views/w3m-swap-view/components/{select-token-view → select-token-modal}/utils.d.ts +0 -0
- /package/src/views/w3m-swap-view/components/{select-token-view → select-token-modal}/utils.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reown/appkit-react-native",
|
|
3
|
-
"version": "0.0.0-fix-
|
|
3
|
+
"version": "0.0.0-fix-ui-changes-20250828183750",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"types": "lib/typescript/index.d.ts",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@reown/appkit-common-react-native": "0.0.0-fix-
|
|
42
|
-
"@reown/appkit-core-react-native": "0.0.0-fix-
|
|
43
|
-
"@reown/appkit-siwe-react-native": "0.0.0-fix-
|
|
44
|
-
"@reown/appkit-ui-react-native": "0.0.0-fix-
|
|
41
|
+
"@reown/appkit-common-react-native": "0.0.0-fix-ui-changes-20250828183750",
|
|
42
|
+
"@reown/appkit-core-react-native": "0.0.0-fix-ui-changes-20250828183750",
|
|
43
|
+
"@reown/appkit-siwe-react-native": "0.0.0-fix-ui-changes-20250828183750",
|
|
44
|
+
"@reown/appkit-ui-react-native": "0.0.0-fix-ui-changes-20250828183750",
|
|
45
45
|
"@walletconnect/universal-provider": "2.21.5",
|
|
46
46
|
"valtio": "2.1.5"
|
|
47
47
|
},
|
package/src/AppKit.ts
CHANGED
|
@@ -663,6 +663,7 @@ export class AppKit {
|
|
|
663
663
|
OptionsController.setEnableAnalytics(options.enableAnalytics);
|
|
664
664
|
OptionsController.setDebug(options.debug);
|
|
665
665
|
OptionsController.setFeatures(options.features);
|
|
666
|
+
OptionsController.setRequestedNetworks(this.networks);
|
|
666
667
|
|
|
667
668
|
if (options.defaultNetwork) {
|
|
668
669
|
const network = NetworkUtil.formatNetwork(options.defaultNetwork, this.projectId);
|
|
@@ -709,14 +710,17 @@ export class AppKit {
|
|
|
709
710
|
const wallets = await StorageUtil.getRecentWallets();
|
|
710
711
|
const filteredWallets = wallets.filter(wallet => {
|
|
711
712
|
const { includeWalletIds, excludeWalletIds } = options;
|
|
712
|
-
|
|
713
|
+
|
|
714
|
+
if (includeWalletIds?.length) {
|
|
713
715
|
return includeWalletIds.includes(wallet.id);
|
|
714
716
|
}
|
|
715
|
-
if (excludeWalletIds) {
|
|
717
|
+
if (excludeWalletIds?.length) {
|
|
716
718
|
return !excludeWalletIds.includes(wallet.id);
|
|
717
719
|
}
|
|
718
720
|
|
|
719
|
-
return
|
|
721
|
+
return this.networks.some(
|
|
722
|
+
network => wallet.chains?.some(chain => network.caipNetworkId === chain)
|
|
723
|
+
);
|
|
720
724
|
});
|
|
721
725
|
|
|
722
726
|
WcController.setRecentWallets(filteredWallets);
|
|
@@ -740,8 +744,12 @@ export class AppKit {
|
|
|
740
744
|
|
|
741
745
|
const customList = [...(customWallets ?? [])];
|
|
742
746
|
|
|
743
|
-
const
|
|
747
|
+
const isSolanaEnabled =
|
|
744
748
|
adapters.some(adapter => adapter.getSupportedNamespace() === 'solana') &&
|
|
749
|
+
this.networks.some(network => network.chainNamespace === 'solana');
|
|
750
|
+
|
|
751
|
+
const addPhantom =
|
|
752
|
+
isSolanaEnabled &&
|
|
745
753
|
extraConnectors?.some(connector => connector.type.toLowerCase() === 'phantom') &&
|
|
746
754
|
!customList.some(wallet => wallet.id === ConstantsUtil.PHANTOM_CUSTOM_WALLET.id);
|
|
747
755
|
|
|
@@ -750,7 +758,7 @@ export class AppKit {
|
|
|
750
758
|
}
|
|
751
759
|
|
|
752
760
|
const addSolflare =
|
|
753
|
-
|
|
761
|
+
isSolanaEnabled &&
|
|
754
762
|
extraConnectors?.some(connector => connector.type.toLowerCase() === 'solflare') &&
|
|
755
763
|
!customList.some(wallet => wallet.id === ConstantsUtil.SOLFLARE_CUSTOM_WALLET.id);
|
|
756
764
|
|
|
@@ -210,12 +210,12 @@ export class WalletConnectConnector extends WalletConnector {
|
|
|
210
210
|
const provider = this.provider as IUniversalProvider;
|
|
211
211
|
|
|
212
212
|
if (namespace) {
|
|
213
|
-
const _chainId = this.getChainId(namespace);
|
|
214
|
-
|
|
215
213
|
// @ts-ignore
|
|
216
214
|
return {
|
|
217
215
|
...provider,
|
|
218
216
|
request: (args: RequestArguments, chainId?: CaipNetworkId) => {
|
|
217
|
+
const _chainId = this.getChainId(namespace);
|
|
218
|
+
|
|
219
219
|
return provider.request(args, chainId || _chainId);
|
|
220
220
|
}
|
|
221
221
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useSnapshot } from 'valtio';
|
|
2
2
|
import { useCallback, useEffect } from 'react';
|
|
3
|
-
import { Card, Modal, ThemeProvider
|
|
3
|
+
import { Card, Modal, ThemeProvider } from '@reown/appkit-ui-react-native';
|
|
4
4
|
import {
|
|
5
5
|
ApiController,
|
|
6
6
|
EventsController,
|
|
@@ -21,7 +21,6 @@ export function AppKit() {
|
|
|
21
21
|
const { open } = useSnapshot(ModalController.state);
|
|
22
22
|
const { themeMode, themeVariables } = useSnapshot(ThemeController.state);
|
|
23
23
|
const { projectId } = useSnapshot(OptionsController.state);
|
|
24
|
-
const { maxHeight } = useCustomDimensions();
|
|
25
24
|
|
|
26
25
|
const handleBackPress = () => {
|
|
27
26
|
if (RouterController.state.history.length > 1) {
|
|
@@ -54,7 +53,7 @@ export function AppKit() {
|
|
|
54
53
|
onBackdropPress={handleModalClose}
|
|
55
54
|
testID="w3m-modal"
|
|
56
55
|
>
|
|
57
|
-
<Card style={
|
|
56
|
+
<Card style={styles.card}>
|
|
58
57
|
<Header />
|
|
59
58
|
<AppKitRouter />
|
|
60
59
|
<Snackbar />
|
|
@@ -35,9 +35,11 @@ import { UiUtil } from '../../utils/UiUtil';
|
|
|
35
35
|
import { useRouteTransition } from '../../hooks/useRouteTransition';
|
|
36
36
|
|
|
37
37
|
import { Animated } from 'react-native';
|
|
38
|
+
import { useCustomDimensions } from '@reown/appkit-ui-react-native';
|
|
38
39
|
|
|
39
40
|
export function AppKitRouter() {
|
|
40
41
|
const { view } = useSnapshot(RouterController.state);
|
|
42
|
+
const { maxHeight } = useCustomDimensions();
|
|
41
43
|
const { animateTransition, getAnimatedStyle } = useRouteTransition({
|
|
42
44
|
duration: 300,
|
|
43
45
|
useNativeDriver: true
|
|
@@ -117,7 +119,7 @@ export function AppKitRouter() {
|
|
|
117
119
|
}, [view]);
|
|
118
120
|
|
|
119
121
|
return (
|
|
120
|
-
<Animated.View style={[getAnimatedStyle()]}>
|
|
122
|
+
<Animated.View style={[getAnimatedStyle(), { maxHeight }]}>
|
|
121
123
|
<ViewComponent />
|
|
122
124
|
</Animated.View>
|
|
123
125
|
);
|
|
@@ -1,44 +1,13 @@
|
|
|
1
|
-
import { CardSelectLoader, FlexView, useCustomDimensions } from '@reown/appkit-ui-react-native';
|
|
2
1
|
import { memo } from 'react';
|
|
3
|
-
import {
|
|
2
|
+
import { WalletList } from './WalletList';
|
|
4
3
|
|
|
5
4
|
interface LoadingProps {
|
|
6
|
-
|
|
7
|
-
containerStyle?: StyleProp<ViewStyle>;
|
|
5
|
+
loadingItems?: number;
|
|
8
6
|
}
|
|
9
7
|
|
|
10
|
-
function _Loading({
|
|
11
|
-
const { maxWidth, maxHeight } = useCustomDimensions();
|
|
12
|
-
|
|
8
|
+
function _Loading({ loadingItems = 20 }: LoadingProps) {
|
|
13
9
|
return (
|
|
14
|
-
<
|
|
15
|
-
flexDirection="row"
|
|
16
|
-
flexWrap="wrap"
|
|
17
|
-
alignSelf="center"
|
|
18
|
-
padding={['0', '0', 's', 'xs']}
|
|
19
|
-
style={{ maxWidth, maxHeight }}
|
|
20
|
-
>
|
|
21
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
22
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
23
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
24
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
25
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
26
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
27
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
28
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
29
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
30
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
31
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
32
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
33
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
34
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
35
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
36
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
37
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
38
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
39
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
40
|
-
<CardSelectLoader style={[containerStyle, { width: itemWidth }]} />
|
|
41
|
-
</FlexView>
|
|
10
|
+
<WalletList data={[]} onItemPress={() => {}} isLoading={true} loadingItems={loadingItems} />
|
|
42
11
|
);
|
|
43
12
|
}
|
|
44
13
|
|
|
@@ -11,6 +11,7 @@ interface WalletItemProps {
|
|
|
11
11
|
itemWidth?: number;
|
|
12
12
|
imageHeaders?: Record<string, string>;
|
|
13
13
|
onItemPress: (wallet: WcWallet) => void;
|
|
14
|
+
style?: StyleProp<ViewStyle>;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export function WalletItem({
|
|
@@ -18,20 +19,21 @@ export function WalletItem({
|
|
|
18
19
|
item,
|
|
19
20
|
itemWidth,
|
|
20
21
|
imageHeaders,
|
|
21
|
-
onItemPress
|
|
22
|
+
onItemPress,
|
|
23
|
+
style
|
|
22
24
|
}: WalletItemProps) {
|
|
23
25
|
const { walletImages } = useSnapshot(AssetController.state);
|
|
24
26
|
const isInstalled = ApiController.state.installed.find(wallet => wallet?.id === item?.id);
|
|
25
27
|
const imageSrc = AssetUtil.getWalletImage(item, walletImages);
|
|
26
28
|
|
|
27
29
|
if (!item?.id) {
|
|
28
|
-
return <CardSelectLoader style={[containerStyle, { width: itemWidth }]} />;
|
|
30
|
+
return <CardSelectLoader style={[containerStyle, { width: itemWidth }, style]} />;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
return (
|
|
32
34
|
<CardSelect
|
|
33
35
|
imageSrc={imageSrc}
|
|
34
|
-
style={[containerStyle, { width: itemWidth }]}
|
|
36
|
+
style={[containerStyle, itemWidth ? { width: itemWidth } : undefined, style]}
|
|
35
37
|
imageHeaders={imageHeaders}
|
|
36
38
|
name={item?.name ?? 'Unknown'}
|
|
37
39
|
onPress={() => onItemPress(item)}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { FlatList, StyleSheet } from 'react-native';
|
|
2
|
+
import { WalletItem } from './WalletItem';
|
|
3
|
+
import {
|
|
4
|
+
CardSelectHeight,
|
|
5
|
+
Spacing,
|
|
6
|
+
useCustomDimensions,
|
|
7
|
+
CardSelectLoader
|
|
8
|
+
} from '@reown/appkit-ui-react-native';
|
|
9
|
+
import { ApiController } from '@reown/appkit-core-react-native';
|
|
10
|
+
import type { WcWallet } from '@reown/appkit-common-react-native';
|
|
11
|
+
|
|
12
|
+
const imageHeaders = ApiController._getApiHeaders();
|
|
13
|
+
|
|
14
|
+
const ITEM_HEIGHT = CardSelectHeight;
|
|
15
|
+
const ITEM_HEIGHT_WITH_GAP = ITEM_HEIGHT + Spacing['3xs'];
|
|
16
|
+
|
|
17
|
+
interface Props {
|
|
18
|
+
data: WcWallet[];
|
|
19
|
+
onItemPress: (wallet: WcWallet) => void;
|
|
20
|
+
onEndReached?: () => void;
|
|
21
|
+
onEndReachedThreshold?: number;
|
|
22
|
+
isLoading?: boolean;
|
|
23
|
+
loadingItems?: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function WalletList({
|
|
27
|
+
data,
|
|
28
|
+
onItemPress,
|
|
29
|
+
onEndReached,
|
|
30
|
+
onEndReachedThreshold,
|
|
31
|
+
isLoading = false,
|
|
32
|
+
loadingItems = 20
|
|
33
|
+
}: Props) {
|
|
34
|
+
const { padding } = useCustomDimensions();
|
|
35
|
+
|
|
36
|
+
// Create loading data if isLoading is true
|
|
37
|
+
const displayData = isLoading
|
|
38
|
+
? Array.from({ length: loadingItems }, (_, index) => ({ id: `loading-${index}` }) as WcWallet)
|
|
39
|
+
: data;
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<FlatList
|
|
43
|
+
fadingEdgeLength={20}
|
|
44
|
+
bounces={false}
|
|
45
|
+
numColumns={4}
|
|
46
|
+
data={displayData}
|
|
47
|
+
style={styles.list}
|
|
48
|
+
columnWrapperStyle={styles.columnWrapperStyle}
|
|
49
|
+
renderItem={({ item }) => {
|
|
50
|
+
if (isLoading) {
|
|
51
|
+
return <CardSelectLoader style={styles.itemContainer} />;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<WalletItem
|
|
56
|
+
item={item}
|
|
57
|
+
imageHeaders={imageHeaders}
|
|
58
|
+
onItemPress={onItemPress}
|
|
59
|
+
style={styles.itemContainer}
|
|
60
|
+
/>
|
|
61
|
+
);
|
|
62
|
+
}}
|
|
63
|
+
contentContainerStyle={[styles.contentContainer, { paddingHorizontal: padding }]}
|
|
64
|
+
onEndReached={onEndReached}
|
|
65
|
+
onEndReachedThreshold={onEndReachedThreshold}
|
|
66
|
+
keyExtractor={item => item?.id}
|
|
67
|
+
getItemLayout={(_, index) => ({
|
|
68
|
+
length: ITEM_HEIGHT_WITH_GAP,
|
|
69
|
+
offset: ITEM_HEIGHT_WITH_GAP * index,
|
|
70
|
+
index
|
|
71
|
+
})}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const styles = StyleSheet.create({
|
|
77
|
+
list: {
|
|
78
|
+
height: '100%'
|
|
79
|
+
},
|
|
80
|
+
contentContainer: {
|
|
81
|
+
paddingBottom: Spacing['4xl'],
|
|
82
|
+
paddingTop: Spacing['3xs'],
|
|
83
|
+
gap: Spacing['3xs'],
|
|
84
|
+
alignItems: 'center'
|
|
85
|
+
},
|
|
86
|
+
columnWrapperStyle: {
|
|
87
|
+
justifyContent: 'space-around'
|
|
88
|
+
},
|
|
89
|
+
itemContainer: {
|
|
90
|
+
width: '23%'
|
|
91
|
+
}
|
|
92
|
+
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import { useSnapshot } from 'valtio';
|
|
3
|
-
import { FlatList } from 'react-native';
|
|
4
3
|
import {
|
|
5
4
|
ApiController,
|
|
6
5
|
OptionsController,
|
|
@@ -8,36 +7,25 @@ import {
|
|
|
8
7
|
type OptionsControllerState
|
|
9
8
|
} from '@reown/appkit-core-react-native';
|
|
10
9
|
import { type WcWallet } from '@reown/appkit-common-react-native';
|
|
11
|
-
import { CardSelectHeight, Spacing, useCustomDimensions } from '@reown/appkit-ui-react-native';
|
|
12
10
|
import styles from './styles';
|
|
13
11
|
import { Placeholder } from '../w3m-placeholder';
|
|
14
12
|
import { Loading } from './components/Loading';
|
|
15
|
-
|
|
13
|
+
|
|
14
|
+
import { WalletList } from './components/WalletList';
|
|
16
15
|
|
|
17
16
|
interface AllWalletsListProps {
|
|
18
|
-
columns: number;
|
|
19
17
|
onItemPress: (wallet: WcWallet) => void;
|
|
20
|
-
itemWidth?: number;
|
|
21
18
|
headerHeight?: number;
|
|
22
19
|
}
|
|
23
20
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export function AllWalletsList({
|
|
27
|
-
columns,
|
|
28
|
-
itemWidth,
|
|
29
|
-
onItemPress,
|
|
30
|
-
headerHeight = 0
|
|
31
|
-
}: AllWalletsListProps) {
|
|
21
|
+
export function AllWalletsList({ onItemPress }: AllWalletsListProps) {
|
|
32
22
|
const [loading, setLoading] = useState<boolean>(ApiController.state.wallets.length === 0);
|
|
33
23
|
const [loadingError, setLoadingError] = useState<boolean>(false);
|
|
34
24
|
const [pageLoading, setPageLoading] = useState<boolean>(false);
|
|
35
|
-
const { maxHeight, padding } = useCustomDimensions();
|
|
36
25
|
const { installed, featured, recommended, wallets } = useSnapshot(ApiController.state);
|
|
37
26
|
const { customWallets } = useSnapshot(OptionsController.state) as OptionsControllerState;
|
|
38
|
-
const imageHeaders = ApiController._getApiHeaders();
|
|
39
27
|
const preloadedWallets = installed.length + featured.length + recommended.length;
|
|
40
|
-
const loadingItems =
|
|
28
|
+
const loadingItems = 4 - ((100 + preloadedWallets) % 4);
|
|
41
29
|
|
|
42
30
|
const combinedWallets = [
|
|
43
31
|
...(customWallets ?? []),
|
|
@@ -95,7 +83,7 @@ export function AllWalletsList({
|
|
|
95
83
|
}, []);
|
|
96
84
|
|
|
97
85
|
if (loading) {
|
|
98
|
-
return <Loading
|
|
86
|
+
return <Loading loadingItems={20} />;
|
|
99
87
|
}
|
|
100
88
|
|
|
101
89
|
if (loadingError) {
|
|
@@ -114,30 +102,11 @@ export function AllWalletsList({
|
|
|
114
102
|
}
|
|
115
103
|
|
|
116
104
|
return (
|
|
117
|
-
<
|
|
118
|
-
key={columns}
|
|
119
|
-
fadingEdgeLength={20}
|
|
120
|
-
bounces={false}
|
|
121
|
-
numColumns={columns}
|
|
105
|
+
<WalletList
|
|
122
106
|
data={walletList}
|
|
123
|
-
renderItem={({ item }) => (
|
|
124
|
-
<WalletItem
|
|
125
|
-
item={item}
|
|
126
|
-
itemWidth={itemWidth}
|
|
127
|
-
imageHeaders={imageHeaders}
|
|
128
|
-
onItemPress={onItemPress}
|
|
129
|
-
/>
|
|
130
|
-
)}
|
|
131
|
-
style={{ maxHeight: maxHeight - headerHeight - Spacing['4xl'] }}
|
|
132
|
-
contentContainerStyle={[styles.contentContainer, { paddingHorizontal: padding + Spacing.xs }]}
|
|
133
107
|
onEndReached={fetchNextPage}
|
|
134
108
|
onEndReachedThreshold={2}
|
|
135
|
-
|
|
136
|
-
getItemLayout={(_, index) => ({
|
|
137
|
-
length: ITEM_HEIGHT,
|
|
138
|
-
offset: ITEM_HEIGHT * index,
|
|
139
|
-
index
|
|
140
|
-
})}
|
|
109
|
+
onItemPress={onItemPress}
|
|
141
110
|
/>
|
|
142
111
|
);
|
|
143
112
|
}
|
|
@@ -3,12 +3,16 @@ import { StyleSheet } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
export default StyleSheet.create({
|
|
5
5
|
contentContainer: {
|
|
6
|
-
paddingBottom: Spacing['
|
|
6
|
+
paddingBottom: Spacing['4xl'],
|
|
7
|
+
paddingTop: Spacing['3xs'],
|
|
8
|
+
gap: Spacing['3xs'],
|
|
9
|
+
alignItems: 'center'
|
|
10
|
+
},
|
|
11
|
+
columnWrapperStyle: {
|
|
12
|
+
justifyContent: 'space-around'
|
|
7
13
|
},
|
|
8
14
|
itemContainer: {
|
|
9
|
-
|
|
10
|
-
justifyContent: 'center',
|
|
11
|
-
marginVertical: Spacing.xs
|
|
15
|
+
width: '23%'
|
|
12
16
|
},
|
|
13
17
|
pageLoader: {
|
|
14
18
|
marginTop: Spacing.xl
|
|
@@ -1,36 +1,23 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { FlatList } from 'react-native';
|
|
3
2
|
import { ApiController, SnackController } from '@reown/appkit-core-react-native';
|
|
4
3
|
import { type WcWallet } from '@reown/appkit-common-react-native';
|
|
5
|
-
import {
|
|
4
|
+
import { useCustomDimensions } from '@reown/appkit-ui-react-native';
|
|
6
5
|
import { Placeholder } from '../w3m-placeholder';
|
|
7
6
|
import styles from './styles';
|
|
8
7
|
|
|
9
8
|
import { Loading } from '../w3m-all-wallets-list/components/Loading';
|
|
10
|
-
import {
|
|
9
|
+
import { WalletList } from '../w3m-all-wallets-list/components/WalletList';
|
|
11
10
|
|
|
12
11
|
export interface AllWalletsSearchProps {
|
|
13
|
-
columns: number;
|
|
14
12
|
onItemPress: (wallet: WcWallet) => void;
|
|
15
|
-
itemWidth?: number;
|
|
16
13
|
searchQuery?: string;
|
|
17
|
-
headerHeight?: number;
|
|
18
14
|
}
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export function AllWalletsSearch({
|
|
23
|
-
searchQuery,
|
|
24
|
-
columns,
|
|
25
|
-
itemWidth,
|
|
26
|
-
onItemPress,
|
|
27
|
-
headerHeight = 0
|
|
28
|
-
}: AllWalletsSearchProps) {
|
|
16
|
+
export function AllWalletsSearch({ searchQuery, onItemPress }: AllWalletsSearchProps) {
|
|
29
17
|
const [loading, setLoading] = useState<boolean>(false);
|
|
30
18
|
const [loadingError, setLoadingError] = useState<boolean>(false);
|
|
31
19
|
const [prevSearchQuery, setPrevSearchQuery] = useState<string>('');
|
|
32
|
-
const
|
|
33
|
-
const { maxHeight, padding, isLandscape } = useCustomDimensions();
|
|
20
|
+
const { isLandscape } = useCustomDimensions();
|
|
34
21
|
|
|
35
22
|
const emptyTemplate = () => {
|
|
36
23
|
return (
|
|
@@ -63,7 +50,7 @@ export function AllWalletsSearch({
|
|
|
63
50
|
}, [searchQuery, prevSearchQuery, searchFetch]);
|
|
64
51
|
|
|
65
52
|
if (loading) {
|
|
66
|
-
return <Loading
|
|
53
|
+
return <Loading loadingItems={20} />;
|
|
67
54
|
}
|
|
68
55
|
|
|
69
56
|
if (loadingError) {
|
|
@@ -85,29 +72,5 @@ export function AllWalletsSearch({
|
|
|
85
72
|
return emptyTemplate();
|
|
86
73
|
}
|
|
87
74
|
|
|
88
|
-
return
|
|
89
|
-
<FlatList
|
|
90
|
-
key={columns}
|
|
91
|
-
fadingEdgeLength={20}
|
|
92
|
-
bounces={false}
|
|
93
|
-
numColumns={columns}
|
|
94
|
-
data={ApiController.state.search}
|
|
95
|
-
renderItem={({ item }) => (
|
|
96
|
-
<WalletItem
|
|
97
|
-
item={item}
|
|
98
|
-
itemWidth={itemWidth}
|
|
99
|
-
imageHeaders={imageHeaders}
|
|
100
|
-
onItemPress={onItemPress}
|
|
101
|
-
/>
|
|
102
|
-
)}
|
|
103
|
-
style={{ maxHeight: maxHeight - headerHeight - Spacing['2xl'] }}
|
|
104
|
-
contentContainerStyle={[styles.contentContainer, { paddingHorizontal: padding + Spacing.xs }]}
|
|
105
|
-
keyExtractor={item => item.id}
|
|
106
|
-
getItemLayout={(_, index) => ({
|
|
107
|
-
length: ITEM_HEIGHT,
|
|
108
|
-
offset: ITEM_HEIGHT * index,
|
|
109
|
-
index
|
|
110
|
-
})}
|
|
111
|
-
/>
|
|
112
|
-
);
|
|
75
|
+
return <WalletList onItemPress={onItemPress} data={ApiController.state.search} />;
|
|
113
76
|
}
|
|
@@ -3,7 +3,7 @@ import { StyleSheet } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
export default StyleSheet.create({
|
|
5
5
|
contentContainer: {
|
|
6
|
-
paddingBottom: Spacing['
|
|
6
|
+
paddingBottom: Spacing['4xl']
|
|
7
7
|
},
|
|
8
8
|
placeholderContainer: {
|
|
9
9
|
flex: 0,
|
|
@@ -19,7 +19,7 @@ export default StyleSheet.create({
|
|
|
19
19
|
itemContainer: {
|
|
20
20
|
alignItems: 'center',
|
|
21
21
|
justifyContent: 'center',
|
|
22
|
-
|
|
22
|
+
margin: Spacing['4xs']
|
|
23
23
|
},
|
|
24
24
|
text: {
|
|
25
25
|
marginTop: Spacing.xs
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
FlexView,
|
|
6
6
|
IconLink,
|
|
7
7
|
SearchBar,
|
|
8
|
-
Spacing,
|
|
9
8
|
useTheme,
|
|
10
9
|
useCustomDimensions
|
|
11
10
|
} from '@reown/appkit-ui-react-native';
|
|
@@ -15,24 +14,14 @@ import { useDebounceCallback } from '../../hooks/useDebounceCallback';
|
|
|
15
14
|
import { AllWalletsList } from '../../partials/w3m-all-wallets-list';
|
|
16
15
|
import { AllWalletsSearch } from '../../partials/w3m-all-wallets-search';
|
|
17
16
|
import { WcHelpersUtil } from '../../utils/HelpersUtil';
|
|
18
|
-
import type { LayoutChangeEvent } from 'react-native';
|
|
19
17
|
|
|
20
18
|
export function AllWalletsView() {
|
|
21
19
|
const Theme = useTheme();
|
|
22
20
|
const [searchQuery, setSearchQuery] = useState<string>('');
|
|
23
21
|
const { maxWidth } = useCustomDimensions();
|
|
24
|
-
const [headerHeight, setHeaderHeight] = useState<number>(0);
|
|
25
|
-
const numColumns = 4;
|
|
26
|
-
const usableWidth = maxWidth - Spacing.xs * 2;
|
|
27
|
-
const itemWidth = Math.abs(Math.trunc(usableWidth / numColumns));
|
|
28
22
|
|
|
29
23
|
const { debouncedCallback: onInputChange } = useDebounceCallback({ callback: setSearchQuery });
|
|
30
24
|
|
|
31
|
-
const onHeaderLayout = (event: LayoutChangeEvent) => {
|
|
32
|
-
const { height } = event.nativeEvent.layout;
|
|
33
|
-
setHeaderHeight(height);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
25
|
const onWalletPress = (wallet: WcWallet) => {
|
|
37
26
|
const isExternal = WcHelpersUtil.isExternalWallet(wallet);
|
|
38
27
|
if (isExternal) {
|
|
@@ -65,7 +54,6 @@ export function AllWalletsView() {
|
|
|
65
54
|
<FlexView
|
|
66
55
|
padding={['s', 'l', 'xs', 'l']}
|
|
67
56
|
flexDirection="row"
|
|
68
|
-
onLayout={onHeaderLayout}
|
|
69
57
|
alignItems="center"
|
|
70
58
|
style={[
|
|
71
59
|
styles.header,
|
|
@@ -93,25 +81,10 @@ export function AllWalletsView() {
|
|
|
93
81
|
|
|
94
82
|
const listTemplate = () => {
|
|
95
83
|
if (searchQuery) {
|
|
96
|
-
return
|
|
97
|
-
<AllWalletsSearch
|
|
98
|
-
columns={numColumns}
|
|
99
|
-
itemWidth={itemWidth}
|
|
100
|
-
searchQuery={searchQuery}
|
|
101
|
-
onItemPress={onWalletPress}
|
|
102
|
-
headerHeight={headerHeight}
|
|
103
|
-
/>
|
|
104
|
-
);
|
|
84
|
+
return <AllWalletsSearch searchQuery={searchQuery} onItemPress={onWalletPress} />;
|
|
105
85
|
}
|
|
106
86
|
|
|
107
|
-
return
|
|
108
|
-
<AllWalletsList
|
|
109
|
-
columns={numColumns}
|
|
110
|
-
itemWidth={itemWidth}
|
|
111
|
-
onItemPress={onWalletPress}
|
|
112
|
-
headerHeight={headerHeight}
|
|
113
|
-
/>
|
|
114
|
-
);
|
|
87
|
+
return <AllWalletsList onItemPress={onWalletPress} />;
|
|
115
88
|
};
|
|
116
89
|
|
|
117
90
|
return (
|
|
@@ -62,7 +62,7 @@ export function ConnectView() {
|
|
|
62
62
|
|
|
63
63
|
return (
|
|
64
64
|
<ScrollView style={{ paddingHorizontal: padding }} bounces={false}>
|
|
65
|
-
<FlexView padding={['xs', '0', '
|
|
65
|
+
<FlexView padding={['xs', '0', 's', '0']}>
|
|
66
66
|
{isSocialEnabled ? (
|
|
67
67
|
<>
|
|
68
68
|
<SocialLoginList options={features?.socials} />
|