@reown/appkit-react-native 2.0.0-alpha.3 → 2.0.0-alpha.4
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 +89 -21
- package/lib/commonjs/AppKit.js.map +1 -1
- package/lib/commonjs/connectors/WalletConnectConnector.js +4 -5
- package/lib/commonjs/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/commonjs/hooks/useRouteTransition.js +10 -4
- package/lib/commonjs/hooks/useRouteTransition.js.map +1 -1
- package/lib/commonjs/modal/w3m-modal/index.js +15 -24
- package/lib/commonjs/modal/w3m-modal/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-modal/styles.js +1 -2
- package/lib/commonjs/modal/w3m-modal/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-wallet-features/index.js +2 -5
- package/lib/commonjs/partials/w3m-account-wallet-features/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/components/Loading.js +113 -0
- package/lib/commonjs/partials/w3m-all-wallets-list/components/Loading.js.map +1 -0
- package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletItem.js +47 -0
- package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletItem.js.map +1 -0
- package/lib/commonjs/partials/w3m-all-wallets-list/index.js +24 -55
- package/lib/commonjs/partials/w3m-all-wallets-list/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/styles.js +3 -5
- package/lib/commonjs/partials/w3m-all-wallets-list/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-search/index.js +24 -46
- package/lib/commonjs/partials/w3m-all-wallets-search/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-search/styles.js +2 -5
- package/lib/commonjs/partials/w3m-all-wallets-search/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-mobile/index.js +5 -3
- package/lib/commonjs/partials/w3m-connecting-mobile/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-qrcode/components/ReownButton.js +36 -0
- package/lib/commonjs/partials/w3m-connecting-qrcode/components/ReownButton.js.map +1 -0
- package/lib/commonjs/partials/w3m-connecting-qrcode/index.js +7 -25
- package/lib/commonjs/partials/w3m-connecting-qrcode/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-qrcode/styles.js +3 -0
- package/lib/commonjs/partials/w3m-connecting-qrcode/styles.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-web/index.js +4 -1
- package/lib/commonjs/partials/w3m-connecting-web/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-header/index.js +1 -1
- package/lib/commonjs/partials/w3m-header/index.js.map +1 -1
- package/lib/commonjs/utils/HelpersUtil.js +20 -0
- package/lib/commonjs/utils/HelpersUtil.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +2 -2
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/utils/UiUtil.js +4 -0
- package/lib/commonjs/utils/UiUtil.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/index.js +1 -2
- package/lib/commonjs/views/w3m-account-default-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-account-view/index.js +2 -18
- package/lib/commonjs/views/w3m-account-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-all-wallets-view/index.js +16 -7
- package/lib/commonjs/views/w3m-all-wallets-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-socials-view/index.js +1 -2
- package/lib/commonjs/views/w3m-connect-socials-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/all-wallet-list.js +4 -1
- package/lib/commonjs/views/w3m-connect-view/components/all-wallet-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/custom-wallet-list.js +8 -2
- package/lib/commonjs/views/w3m-connect-view/components/custom-wallet-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/recent-wallet-list.js +4 -1
- package/lib/commonjs/views/w3m-connect-view/components/recent-wallet-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/index.js +3 -4
- package/lib/commonjs/views/w3m-connect-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-external-view/index.js +27 -11
- package/lib/commonjs/views/w3m-connecting-external-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-social-view/index.js +2 -3
- package/lib/commonjs/views/w3m-connecting-social-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-view/index.js +2 -4
- package/lib/commonjs/views/w3m-connecting-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-get-wallet-view/index.js +6 -3
- package/lib/commonjs/views/w3m-get-wallet-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-networks-view/index.js +4 -4
- package/lib/commonjs/views/w3m-networks-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-loading-view/index.js +1 -2
- package/lib/commonjs/views/w3m-onramp-loading-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-preview-view/index.js +1 -2
- package/lib/commonjs/views/w3m-swap-preview-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/index.js +1 -2
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-view/index.js +1 -2
- package/lib/commonjs/views/w3m-swap-view/index.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-receive-view/index.js +1 -2
- package/lib/commonjs/views/w3m-wallet-receive-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-preview-view/index.js +1 -2
- package/lib/commonjs/views/w3m-wallet-send-preview-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-select-token-view/index.js +1 -2
- package/lib/commonjs/views/w3m-wallet-send-select-token-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-view/index.js +1 -2
- package/lib/commonjs/views/w3m-wallet-send-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-what-is-a-network-view/index.js +1 -2
- package/lib/commonjs/views/w3m-what-is-a-network-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-what-is-a-wallet-view/index.js +1 -2
- package/lib/commonjs/views/w3m-what-is-a-wallet-view/index.js.map +1 -1
- package/lib/module/AppKit.js +90 -22
- package/lib/module/AppKit.js.map +1 -1
- package/lib/module/connectors/WalletConnectConnector.js +4 -5
- package/lib/module/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/module/hooks/useRouteTransition.js +10 -4
- package/lib/module/hooks/useRouteTransition.js.map +1 -1
- package/lib/module/modal/w3m-modal/index.js +16 -25
- package/lib/module/modal/w3m-modal/index.js.map +1 -1
- package/lib/module/modal/w3m-modal/styles.js +1 -2
- package/lib/module/modal/w3m-modal/styles.js.map +1 -1
- package/lib/module/partials/w3m-account-wallet-features/index.js +2 -5
- package/lib/module/partials/w3m-account-wallet-features/index.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/components/Loading.js +109 -0
- package/lib/module/partials/w3m-all-wallets-list/components/Loading.js.map +1 -0
- package/lib/module/partials/w3m-all-wallets-list/components/WalletItem.js +42 -0
- package/lib/module/partials/w3m-all-wallets-list/components/WalletItem.js.map +1 -0
- package/lib/module/partials/w3m-all-wallets-list/index.js +26 -57
- package/lib/module/partials/w3m-all-wallets-list/index.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/styles.js +3 -5
- package/lib/module/partials/w3m-all-wallets-list/styles.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-search/index.js +26 -48
- package/lib/module/partials/w3m-all-wallets-search/index.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-search/styles.js +2 -5
- package/lib/module/partials/w3m-all-wallets-search/styles.js.map +1 -1
- package/lib/module/partials/w3m-connecting-mobile/index.js +6 -4
- package/lib/module/partials/w3m-connecting-mobile/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-qrcode/components/ReownButton.js +32 -0
- package/lib/module/partials/w3m-connecting-qrcode/components/ReownButton.js.map +1 -0
- package/lib/module/partials/w3m-connecting-qrcode/index.js +7 -25
- package/lib/module/partials/w3m-connecting-qrcode/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-qrcode/styles.js +3 -0
- package/lib/module/partials/w3m-connecting-qrcode/styles.js.map +1 -1
- package/lib/module/partials/w3m-connecting-web/index.js +5 -2
- package/lib/module/partials/w3m-connecting-web/index.js.map +1 -1
- package/lib/module/partials/w3m-header/index.js +1 -1
- package/lib/module/partials/w3m-header/index.js.map +1 -1
- package/lib/module/utils/HelpersUtil.js +21 -1
- package/lib/module/utils/HelpersUtil.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js +2 -2
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/module/utils/UiUtil.js +4 -0
- package/lib/module/utils/UiUtil.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/index.js +1 -2
- package/lib/module/views/w3m-account-default-view/index.js.map +1 -1
- package/lib/module/views/w3m-account-view/index.js +3 -19
- package/lib/module/views/w3m-account-view/index.js.map +1 -1
- package/lib/module/views/w3m-all-wallets-view/index.js +16 -7
- package/lib/module/views/w3m-all-wallets-view/index.js.map +1 -1
- package/lib/module/views/w3m-connect-socials-view/index.js +1 -2
- package/lib/module/views/w3m-connect-socials-view/index.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/all-wallet-list.js +5 -2
- package/lib/module/views/w3m-connect-view/components/all-wallet-list.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/custom-wallet-list.js +9 -3
- package/lib/module/views/w3m-connect-view/components/custom-wallet-list.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/recent-wallet-list.js +5 -2
- package/lib/module/views/w3m-connect-view/components/recent-wallet-list.js.map +1 -1
- package/lib/module/views/w3m-connect-view/index.js +3 -4
- package/lib/module/views/w3m-connect-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-external-view/index.js +29 -13
- package/lib/module/views/w3m-connecting-external-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-social-view/index.js +2 -3
- package/lib/module/views/w3m-connecting-social-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-view/index.js +2 -4
- package/lib/module/views/w3m-connecting-view/index.js.map +1 -1
- package/lib/module/views/w3m-get-wallet-view/index.js +7 -4
- package/lib/module/views/w3m-get-wallet-view/index.js.map +1 -1
- package/lib/module/views/w3m-networks-view/index.js +4 -4
- package/lib/module/views/w3m-networks-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-loading-view/index.js +1 -2
- package/lib/module/views/w3m-onramp-loading-view/index.js.map +1 -1
- package/lib/module/views/w3m-swap-preview-view/index.js +1 -2
- package/lib/module/views/w3m-swap-preview-view/index.js.map +1 -1
- package/lib/module/views/w3m-swap-view/components/select-token-view/index.js +1 -2
- package/lib/module/views/w3m-swap-view/components/select-token-view/index.js.map +1 -1
- package/lib/module/views/w3m-swap-view/index.js +1 -2
- package/lib/module/views/w3m-swap-view/index.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-receive-view/index.js +1 -2
- package/lib/module/views/w3m-wallet-receive-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-preview-view/index.js +1 -2
- package/lib/module/views/w3m-wallet-send-preview-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-select-token-view/index.js +1 -2
- package/lib/module/views/w3m-wallet-send-select-token-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-view/index.js +1 -2
- package/lib/module/views/w3m-wallet-send-view/index.js.map +1 -1
- package/lib/module/views/w3m-what-is-a-network-view/index.js +1 -2
- package/lib/module/views/w3m-what-is-a-network-view/index.js.map +1 -1
- package/lib/module/views/w3m-what-is-a-wallet-view/index.js +1 -2
- package/lib/module/views/w3m-what-is-a-wallet-view/index.js.map +1 -1
- package/lib/typescript/AppKit.d.ts +8 -3
- package/lib/typescript/AppKit.d.ts.map +1 -1
- package/lib/typescript/AppKitContext.d.ts +1 -1
- package/lib/typescript/hooks/useRouteTransition.d.ts.map +1 -1
- package/lib/typescript/modal/w3m-modal/index.d.ts.map +1 -1
- package/lib/typescript/modal/w3m-modal/styles.d.ts +0 -1
- package/lib/typescript/modal/w3m-modal/styles.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-account-wallet-features/index.d.ts +1 -4
- package/lib/typescript/partials/w3m-account-wallet-features/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-list/components/Loading.d.ts +10 -0
- package/lib/typescript/partials/w3m-all-wallets-list/components/Loading.d.ts.map +1 -0
- package/lib/typescript/partials/w3m-all-wallets-list/components/WalletItem.d.ts +15 -0
- package/lib/typescript/partials/w3m-all-wallets-list/components/WalletItem.d.ts.map +1 -0
- package/lib/typescript/partials/w3m-all-wallets-list/index.d.ts +2 -1
- 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 +2 -4
- 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 +2 -1
- 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 -4
- package/lib/typescript/partials/w3m-all-wallets-search/styles.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-connecting-mobile/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-connecting-qrcode/components/ReownButton.d.ts +7 -0
- package/lib/typescript/partials/w3m-connecting-qrcode/components/ReownButton.d.ts.map +1 -0
- package/lib/typescript/partials/w3m-connecting-qrcode/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-connecting-qrcode/styles.d.ts +3 -0
- package/lib/typescript/partials/w3m-connecting-qrcode/styles.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-connecting-web/index.d.ts.map +1 -1
- package/lib/typescript/utils/HelpersUtil.d.ts +3 -1
- package/lib/typescript/utils/HelpersUtil.d.ts.map +1 -1
- package/lib/typescript/utils/NetworkUtil.d.ts +1 -1
- package/lib/typescript/utils/UiUtil.d.ts.map +1 -1
- package/lib/typescript/views/w3m-account-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-all-wallets-view/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/all-wallet-list.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-view/components/custom-wallet-list.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-view/components/recent-wallet-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-external-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connecting-social-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connecting-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-get-wallet-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-networks-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-loading-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-preview-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-view/components/select-token-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-compatible-networks-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-send-preview-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-send-select-token-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-send-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-what-is-a-network-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-what-is-a-wallet-view/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/AppKit.ts +119 -23
- package/src/connectors/WalletConnectConnector.ts +5 -5
- package/src/hooks/useRouteTransition.ts +11 -4
- package/src/modal/w3m-modal/index.tsx +16 -25
- package/src/modal/w3m-modal/styles.ts +1 -2
- package/src/partials/w3m-account-wallet-features/index.tsx +2 -8
- package/src/partials/w3m-all-wallets-list/components/Loading.tsx +47 -0
- package/src/partials/w3m-all-wallets-list/components/WalletItem.tsx +47 -0
- package/src/partials/w3m-all-wallets-list/index.tsx +29 -61
- package/src/partials/w3m-all-wallets-list/styles.ts +3 -5
- package/src/partials/w3m-all-wallets-search/index.tsx +27 -53
- package/src/partials/w3m-all-wallets-search/styles.ts +2 -5
- package/src/partials/w3m-connecting-mobile/index.tsx +6 -4
- package/src/partials/w3m-connecting-qrcode/components/ReownButton.tsx +20 -0
- package/src/partials/w3m-connecting-qrcode/index.tsx +12 -14
- package/src/partials/w3m-connecting-qrcode/styles.ts +3 -0
- package/src/partials/w3m-connecting-web/index.tsx +4 -2
- package/src/partials/w3m-header/index.tsx +1 -1
- package/src/utils/HelpersUtil.ts +30 -0
- package/src/utils/NetworkUtil.ts +3 -3
- package/src/utils/UiUtil.ts +4 -0
- package/src/views/w3m-account-default-view/index.tsx +2 -2
- package/src/views/w3m-account-view/index.tsx +4 -20
- package/src/views/w3m-all-wallets-view/index.tsx +27 -8
- package/src/views/w3m-connect-socials-view/index.tsx +1 -2
- package/src/views/w3m-connect-view/components/all-wallet-list.tsx +3 -1
- package/src/views/w3m-connect-view/components/custom-wallet-list.tsx +11 -3
- package/src/views/w3m-connect-view/components/recent-wallet-list.tsx +8 -2
- package/src/views/w3m-connect-view/index.tsx +11 -6
- package/src/views/w3m-connecting-external-view/index.tsx +24 -10
- package/src/views/w3m-connecting-social-view/index.tsx +9 -3
- package/src/views/w3m-connecting-view/index.tsx +2 -4
- package/src/views/w3m-get-wallet-view/index.tsx +5 -4
- package/src/views/w3m-networks-view/index.tsx +8 -4
- package/src/views/w3m-onramp-loading-view/index.tsx +8 -2
- package/src/views/w3m-swap-preview-view/index.tsx +9 -2
- package/src/views/w3m-swap-view/components/select-token-view/index.tsx +2 -2
- package/src/views/w3m-swap-view/index.tsx +7 -2
- package/src/views/w3m-wallet-compatible-networks-view/index.tsx +7 -2
- package/src/views/w3m-wallet-receive-view/index.tsx +2 -2
- package/src/views/w3m-wallet-send-preview-view/index.tsx +10 -2
- package/src/views/w3m-wallet-send-select-token-view/index.tsx +7 -2
- package/src/views/w3m-wallet-send-view/index.tsx +1 -2
- package/src/views/w3m-what-is-a-network-view/index.tsx +1 -2
- package/src/views/w3m-what-is-a-wallet-view/index.tsx +1 -2
- package/lib/commonjs/hooks/useCustomDimensions.js +0 -33
- package/lib/commonjs/hooks/useCustomDimensions.js.map +0 -1
- package/lib/module/hooks/useCustomDimensions.js +0 -30
- package/lib/module/hooks/useCustomDimensions.js.map +0 -1
- package/lib/typescript/hooks/useCustomDimensions.d.ts +0 -11
- package/lib/typescript/hooks/useCustomDimensions.d.ts.map +0 -1
- package/src/hooks/useCustomDimensions.ts +0 -21
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useSnapshot } from 'valtio';
|
|
2
2
|
import { useCallback, useEffect } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { Card, Modal, ThemeProvider } from '@reown/appkit-ui-react-native';
|
|
3
|
+
import { Card, Modal, ThemeProvider, useCustomDimensions } from '@reown/appkit-ui-react-native';
|
|
5
4
|
import {
|
|
6
5
|
ApiController,
|
|
7
6
|
EventsController,
|
|
@@ -14,7 +13,6 @@ import {
|
|
|
14
13
|
import { AppKitRouter } from '../w3m-router';
|
|
15
14
|
import { Header } from '../../partials/w3m-header';
|
|
16
15
|
import { Snackbar } from '../../partials/w3m-snackbar';
|
|
17
|
-
import { useCustomDimensions } from '../../hooks/useCustomDimensions';
|
|
18
16
|
import { useInternalAppKit } from '../../AppKitContext';
|
|
19
17
|
import styles from './styles';
|
|
20
18
|
|
|
@@ -23,10 +21,7 @@ export function AppKit() {
|
|
|
23
21
|
const { open } = useSnapshot(ModalController.state);
|
|
24
22
|
const { themeMode, themeVariables } = useSnapshot(ThemeController.state);
|
|
25
23
|
const { projectId } = useSnapshot(OptionsController.state);
|
|
26
|
-
const {
|
|
27
|
-
const { isLandscape } = useCustomDimensions();
|
|
28
|
-
const portraitHeight = height - 80;
|
|
29
|
-
const landScapeHeight = height * 0.95 - (StatusBar.currentHeight ?? 0);
|
|
24
|
+
const { maxHeight } = useCustomDimensions();
|
|
30
25
|
|
|
31
26
|
const handleBackPress = () => {
|
|
32
27
|
if (RouterController.state.history.length > 1) {
|
|
@@ -52,23 +47,19 @@ export function AppKit() {
|
|
|
52
47
|
}, [projectId, prefetch]);
|
|
53
48
|
|
|
54
49
|
return (
|
|
55
|
-
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
>
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
</Card>
|
|
70
|
-
</Modal>
|
|
71
|
-
</ThemeProvider>
|
|
72
|
-
</>
|
|
50
|
+
<ThemeProvider themeMode={themeMode} themeVariables={themeVariables}>
|
|
51
|
+
<Modal
|
|
52
|
+
visible={open}
|
|
53
|
+
onRequestClose={handleBackPress}
|
|
54
|
+
onBackdropPress={handleModalClose}
|
|
55
|
+
testID="w3m-modal"
|
|
56
|
+
>
|
|
57
|
+
<Card style={[styles.card, { maxHeight }]}>
|
|
58
|
+
<Header />
|
|
59
|
+
<AppKitRouter />
|
|
60
|
+
<Snackbar />
|
|
61
|
+
</Card>
|
|
62
|
+
</Modal>
|
|
63
|
+
</ThemeProvider>
|
|
73
64
|
);
|
|
74
65
|
}
|
|
@@ -16,11 +16,7 @@ import { AccountActivity } from '../w3m-account-activity';
|
|
|
16
16
|
import { AccountTokens } from '../w3m-account-tokens';
|
|
17
17
|
import styles from './styles';
|
|
18
18
|
|
|
19
|
-
export
|
|
20
|
-
isBalanceLoading: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function AccountWalletFeatures({ isBalanceLoading }: AccountWalletFeaturesProps) {
|
|
19
|
+
export function AccountWalletFeatures() {
|
|
24
20
|
const [activeTab, setActiveTab] = useState(0);
|
|
25
21
|
const { features, isOnRampEnabled } = useSnapshot(OptionsController.state);
|
|
26
22
|
const { activeNetwork, balances, activeNamespace } = useSnapshot(ConnectionsController.state);
|
|
@@ -141,9 +137,7 @@ export function AccountWalletFeatures({ isBalanceLoading }: AccountWalletFeature
|
|
|
141
137
|
<Tabs tabs={['Tokens', 'Activity']} onTabChange={onTabChange} />
|
|
142
138
|
</FlexView>
|
|
143
139
|
<FlexView padding={['m', '0', '0', '0']} style={styles.tabContainer}>
|
|
144
|
-
{activeTab === 0 &&
|
|
145
|
-
<AccountTokens style={styles.tabContent} isLoading={isBalanceLoading} />
|
|
146
|
-
)}
|
|
140
|
+
{activeTab === 0 && <AccountTokens style={styles.tabContent} />}
|
|
147
141
|
{activeTab === 1 && <AccountActivity style={styles.tabContent} />}
|
|
148
142
|
</FlexView>
|
|
149
143
|
</FlexView>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CardSelectLoader, FlexView, useCustomDimensions } from '@reown/appkit-ui-react-native';
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
4
|
+
|
|
5
|
+
interface LoadingProps {
|
|
6
|
+
itemWidth?: number;
|
|
7
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function _Loading({ itemWidth, containerStyle }: LoadingProps) {
|
|
11
|
+
const { maxWidth, maxHeight } = useCustomDimensions();
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<FlexView
|
|
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>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const Loading = memo(_Loading, () => {
|
|
46
|
+
return true;
|
|
47
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useSnapshot } from 'valtio';
|
|
2
|
+
import { ApiController, AssetController, AssetUtil } from '@reown/appkit-core-react-native';
|
|
3
|
+
import { CardSelect, CardSelectLoader } from '@reown/appkit-ui-react-native';
|
|
4
|
+
import type { WcWallet } from '@reown/appkit-common-react-native';
|
|
5
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
6
|
+
import { memo } from 'react';
|
|
7
|
+
|
|
8
|
+
interface WalletItemProps {
|
|
9
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
10
|
+
item: WcWallet;
|
|
11
|
+
itemWidth?: number;
|
|
12
|
+
imageHeaders?: Record<string, string>;
|
|
13
|
+
onItemPress: (wallet: WcWallet) => void;
|
|
14
|
+
style?: StyleProp<ViewStyle>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function WalletItem({
|
|
18
|
+
containerStyle,
|
|
19
|
+
item,
|
|
20
|
+
itemWidth,
|
|
21
|
+
imageHeaders,
|
|
22
|
+
onItemPress,
|
|
23
|
+
style
|
|
24
|
+
}: WalletItemProps) {
|
|
25
|
+
const { walletImages } = useSnapshot(AssetController.state);
|
|
26
|
+
const isInstalled = ApiController.state.installed.find(wallet => wallet?.id === item?.id);
|
|
27
|
+
const imageSrc = AssetUtil.getWalletImage(item, walletImages);
|
|
28
|
+
|
|
29
|
+
if (!item?.id) {
|
|
30
|
+
return <CardSelectLoader style={[containerStyle, { width: itemWidth }, style]} />;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<CardSelect
|
|
35
|
+
imageSrc={imageSrc}
|
|
36
|
+
style={[containerStyle, { width: itemWidth }, style]}
|
|
37
|
+
imageHeaders={imageHeaders}
|
|
38
|
+
name={item?.name ?? 'Unknown'}
|
|
39
|
+
onPress={() => onItemPress(item)}
|
|
40
|
+
installed={!!isInstalled}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const MemoizedWalletItem = memo(WalletItem, (prevProps, nextProps) => {
|
|
46
|
+
return prevProps.item.id === nextProps.item.id;
|
|
47
|
+
});
|
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import { useSnapshot } from 'valtio';
|
|
3
|
-
import { FlatList
|
|
3
|
+
import { FlatList } from 'react-native';
|
|
4
4
|
import {
|
|
5
5
|
ApiController,
|
|
6
|
-
AssetUtil,
|
|
7
6
|
OptionsController,
|
|
8
7
|
SnackController,
|
|
9
8
|
type OptionsControllerState
|
|
10
9
|
} from '@reown/appkit-core-react-native';
|
|
11
10
|
import { type WcWallet } from '@reown/appkit-common-react-native';
|
|
12
|
-
import {
|
|
13
|
-
CardSelect,
|
|
14
|
-
CardSelectLoader,
|
|
15
|
-
CardSelectHeight,
|
|
16
|
-
FlexView,
|
|
17
|
-
Spacing
|
|
18
|
-
} from '@reown/appkit-ui-react-native';
|
|
11
|
+
import { CardSelectHeight, Spacing, useCustomDimensions } from '@reown/appkit-ui-react-native';
|
|
19
12
|
import styles from './styles';
|
|
20
|
-
import { UiUtil } from '../../utils/UiUtil';
|
|
21
|
-
import { useCustomDimensions } from '../../hooks/useCustomDimensions';
|
|
22
13
|
import { Placeholder } from '../w3m-placeholder';
|
|
14
|
+
import { Loading } from './components/Loading';
|
|
15
|
+
import { WalletItem } from './components/WalletItem';
|
|
23
16
|
|
|
24
17
|
interface AllWalletsListProps {
|
|
25
18
|
columns: number;
|
|
26
19
|
onItemPress: (wallet: WcWallet) => void;
|
|
27
20
|
itemWidth?: number;
|
|
21
|
+
headerHeight?: number;
|
|
28
22
|
}
|
|
29
23
|
|
|
30
|
-
|
|
24
|
+
const ITEM_HEIGHT = CardSelectHeight + Spacing.xs * 2;
|
|
25
|
+
|
|
26
|
+
export function AllWalletsList({
|
|
27
|
+
columns,
|
|
28
|
+
itemWidth,
|
|
29
|
+
onItemPress,
|
|
30
|
+
headerHeight = 0
|
|
31
|
+
}: AllWalletsListProps) {
|
|
31
32
|
const [loading, setLoading] = useState<boolean>(ApiController.state.wallets.length === 0);
|
|
32
33
|
const [loadingError, setLoadingError] = useState<boolean>(false);
|
|
33
34
|
const [pageLoading, setPageLoading] = useState<boolean>(false);
|
|
34
|
-
const {
|
|
35
|
+
const { maxHeight, padding } = useCustomDimensions();
|
|
35
36
|
const { installed, featured, recommended, wallets } = useSnapshot(ApiController.state);
|
|
36
37
|
const { customWallets } = useSnapshot(OptionsController.state) as OptionsControllerState;
|
|
37
38
|
const imageHeaders = ApiController._getApiHeaders();
|
|
@@ -56,55 +57,11 @@ export function AllWalletsList({ columns, itemWidth, onItemPress }: AllWalletsLi
|
|
|
56
57
|
...(pageLoading ? (Array.from({ length: loadingItems }) as WcWallet[]) : [])
|
|
57
58
|
];
|
|
58
59
|
|
|
59
|
-
const ITEM_HEIGHT = CardSelectHeight + Spacing.xs * 2;
|
|
60
|
-
|
|
61
|
-
const loadingTemplate = (items: number) => {
|
|
62
|
-
return (
|
|
63
|
-
<FlexView
|
|
64
|
-
flexDirection="row"
|
|
65
|
-
flexWrap="wrap"
|
|
66
|
-
alignSelf="center"
|
|
67
|
-
padding={['0', '0', 's', 'xs']}
|
|
68
|
-
style={[styles.container, { maxWidth }]}
|
|
69
|
-
>
|
|
70
|
-
{Array.from({ length: items }).map((_, index) => (
|
|
71
|
-
<View key={index} style={[styles.itemContainer, { width: itemWidth }]}>
|
|
72
|
-
<CardSelectLoader />
|
|
73
|
-
</View>
|
|
74
|
-
))}
|
|
75
|
-
</FlexView>
|
|
76
|
-
);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const walletTemplate = ({ item }: { item: WcWallet; index: number }) => {
|
|
80
|
-
const isInstalled = ApiController.state.installed.find(wallet => wallet?.id === item?.id);
|
|
81
|
-
if (!item?.id) {
|
|
82
|
-
return (
|
|
83
|
-
<View style={[styles.itemContainer, { width: itemWidth }]}>
|
|
84
|
-
<CardSelectLoader />
|
|
85
|
-
</View>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return (
|
|
90
|
-
<View style={[styles.itemContainer, { width: itemWidth }]}>
|
|
91
|
-
<CardSelect
|
|
92
|
-
imageSrc={AssetUtil.getWalletImage(item)}
|
|
93
|
-
imageHeaders={imageHeaders}
|
|
94
|
-
name={item?.name ?? 'Unknown'}
|
|
95
|
-
onPress={() => onItemPress(item)}
|
|
96
|
-
installed={!!isInstalled}
|
|
97
|
-
/>
|
|
98
|
-
</View>
|
|
99
|
-
);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
60
|
const initialFetch = async () => {
|
|
103
61
|
try {
|
|
104
62
|
setLoading(true);
|
|
105
63
|
setLoadingError(false);
|
|
106
64
|
await ApiController.fetchWallets({ page: 1 });
|
|
107
|
-
UiUtil.createViewTransition();
|
|
108
65
|
setLoading(false);
|
|
109
66
|
} catch (error) {
|
|
110
67
|
SnackController.showError('Failed to load wallets');
|
|
@@ -138,7 +95,7 @@ export function AllWalletsList({ columns, itemWidth, onItemPress }: AllWalletsLi
|
|
|
138
95
|
}, []);
|
|
139
96
|
|
|
140
97
|
if (loading) {
|
|
141
|
-
return
|
|
98
|
+
return <Loading itemWidth={itemWidth} containerStyle={styles.itemContainer} />;
|
|
142
99
|
}
|
|
143
100
|
|
|
144
101
|
if (loadingError) {
|
|
@@ -163,9 +120,20 @@ export function AllWalletsList({ columns, itemWidth, onItemPress }: AllWalletsLi
|
|
|
163
120
|
bounces={false}
|
|
164
121
|
numColumns={columns}
|
|
165
122
|
data={walletList}
|
|
166
|
-
renderItem={
|
|
167
|
-
|
|
168
|
-
|
|
123
|
+
renderItem={({ item }) => (
|
|
124
|
+
<WalletItem
|
|
125
|
+
item={item}
|
|
126
|
+
itemWidth={itemWidth}
|
|
127
|
+
imageHeaders={imageHeaders}
|
|
128
|
+
onItemPress={onItemPress}
|
|
129
|
+
style={styles.itemContainer}
|
|
130
|
+
/>
|
|
131
|
+
)}
|
|
132
|
+
style={{ maxHeight: maxHeight - headerHeight - Spacing['4xl'] }}
|
|
133
|
+
contentContainerStyle={[
|
|
134
|
+
styles.contentContainer,
|
|
135
|
+
{ paddingHorizontal: padding + Spacing['2xs'] }
|
|
136
|
+
]}
|
|
169
137
|
onEndReached={fetchNextPage}
|
|
170
138
|
onEndReachedThreshold={2}
|
|
171
139
|
keyExtractor={(item, index) => item?.id ?? index}
|
|
@@ -2,16 +2,14 @@ import { Spacing } from '@reown/appkit-ui-react-native';
|
|
|
2
2
|
import { StyleSheet } from 'react-native';
|
|
3
3
|
|
|
4
4
|
export default StyleSheet.create({
|
|
5
|
-
container: {
|
|
6
|
-
height: '100%'
|
|
7
|
-
},
|
|
8
5
|
contentContainer: {
|
|
9
|
-
paddingBottom: Spacing['
|
|
6
|
+
paddingBottom: Spacing['4xl'],
|
|
7
|
+
paddingTop: Spacing['3xs']
|
|
10
8
|
},
|
|
11
9
|
itemContainer: {
|
|
12
10
|
alignItems: 'center',
|
|
13
11
|
justifyContent: 'center',
|
|
14
|
-
|
|
12
|
+
margin: Spacing['4xs']
|
|
15
13
|
},
|
|
16
14
|
pageLoader: {
|
|
17
15
|
marginTop: Spacing.xl
|
|
@@ -1,73 +1,36 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { FlatList
|
|
3
|
-
import { ApiController,
|
|
2
|
+
import { FlatList } from 'react-native';
|
|
3
|
+
import { ApiController, SnackController } from '@reown/appkit-core-react-native';
|
|
4
4
|
import { type WcWallet } from '@reown/appkit-common-react-native';
|
|
5
|
-
import {
|
|
6
|
-
CardSelect,
|
|
7
|
-
CardSelectHeight,
|
|
8
|
-
CardSelectLoader,
|
|
9
|
-
FlexView,
|
|
10
|
-
Spacing
|
|
11
|
-
} from '@reown/appkit-ui-react-native';
|
|
12
|
-
import { useCustomDimensions } from '../../hooks/useCustomDimensions';
|
|
5
|
+
import { CardSelectHeight, Spacing, useCustomDimensions } from '@reown/appkit-ui-react-native';
|
|
13
6
|
import { Placeholder } from '../w3m-placeholder';
|
|
14
7
|
import styles from './styles';
|
|
15
8
|
|
|
9
|
+
import { Loading } from '../w3m-all-wallets-list/components/Loading';
|
|
10
|
+
import { WalletItem } from '../w3m-all-wallets-list/components/WalletItem';
|
|
11
|
+
|
|
16
12
|
export interface AllWalletsSearchProps {
|
|
17
13
|
columns: number;
|
|
18
14
|
onItemPress: (wallet: WcWallet) => void;
|
|
19
15
|
itemWidth?: number;
|
|
20
16
|
searchQuery?: string;
|
|
17
|
+
headerHeight?: number;
|
|
21
18
|
}
|
|
22
19
|
|
|
20
|
+
const ITEM_HEIGHT = CardSelectHeight + Spacing.xs * 2;
|
|
21
|
+
|
|
23
22
|
export function AllWalletsSearch({
|
|
24
23
|
searchQuery,
|
|
25
24
|
columns,
|
|
26
25
|
itemWidth,
|
|
27
|
-
onItemPress
|
|
26
|
+
onItemPress,
|
|
27
|
+
headerHeight = 0
|
|
28
28
|
}: AllWalletsSearchProps) {
|
|
29
29
|
const [loading, setLoading] = useState<boolean>(false);
|
|
30
30
|
const [loadingError, setLoadingError] = useState<boolean>(false);
|
|
31
31
|
const [prevSearchQuery, setPrevSearchQuery] = useState<string>('');
|
|
32
32
|
const imageHeaders = ApiController._getApiHeaders();
|
|
33
|
-
const {
|
|
34
|
-
|
|
35
|
-
const ITEM_HEIGHT = CardSelectHeight + Spacing.xs * 2;
|
|
36
|
-
|
|
37
|
-
const walletTemplate = ({ item }: { item: WcWallet }) => {
|
|
38
|
-
const isInstalled = ApiController.state.installed.find(wallet => wallet?.id === item?.id);
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<View key={item?.id} style={[styles.itemContainer, { width: itemWidth }]}>
|
|
42
|
-
<CardSelect
|
|
43
|
-
imageSrc={AssetUtil.getWalletImage(item)}
|
|
44
|
-
imageHeaders={imageHeaders}
|
|
45
|
-
name={item?.name ?? 'Unknown'}
|
|
46
|
-
onPress={() => onItemPress(item)}
|
|
47
|
-
installed={!!isInstalled}
|
|
48
|
-
testID={`wallet-search-item-${item?.id}`}
|
|
49
|
-
/>
|
|
50
|
-
</View>
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const loadingTemplate = (items: number) => {
|
|
55
|
-
return (
|
|
56
|
-
<FlexView
|
|
57
|
-
flexDirection="row"
|
|
58
|
-
flexWrap="wrap"
|
|
59
|
-
alignSelf="center"
|
|
60
|
-
padding={['0', '0', 's', 'xs']}
|
|
61
|
-
style={[styles.container, { maxWidth }]}
|
|
62
|
-
>
|
|
63
|
-
{Array.from({ length: items }).map((_, index) => (
|
|
64
|
-
<View key={index} style={[styles.itemContainer, { width: itemWidth }]}>
|
|
65
|
-
<CardSelectLoader />
|
|
66
|
-
</View>
|
|
67
|
-
))}
|
|
68
|
-
</FlexView>
|
|
69
|
-
);
|
|
70
|
-
};
|
|
33
|
+
const { maxHeight, padding, isLandscape } = useCustomDimensions();
|
|
71
34
|
|
|
72
35
|
const emptyTemplate = () => {
|
|
73
36
|
return (
|
|
@@ -100,7 +63,7 @@ export function AllWalletsSearch({
|
|
|
100
63
|
}, [searchQuery, prevSearchQuery, searchFetch]);
|
|
101
64
|
|
|
102
65
|
if (loading) {
|
|
103
|
-
return
|
|
66
|
+
return <Loading itemWidth={itemWidth} containerStyle={styles.itemContainer} />;
|
|
104
67
|
}
|
|
105
68
|
|
|
106
69
|
if (loadingError) {
|
|
@@ -129,9 +92,20 @@ export function AllWalletsSearch({
|
|
|
129
92
|
bounces={false}
|
|
130
93
|
numColumns={columns}
|
|
131
94
|
data={ApiController.state.search}
|
|
132
|
-
renderItem={
|
|
133
|
-
|
|
134
|
-
|
|
95
|
+
renderItem={({ item }) => (
|
|
96
|
+
<WalletItem
|
|
97
|
+
item={item}
|
|
98
|
+
itemWidth={itemWidth}
|
|
99
|
+
imageHeaders={imageHeaders}
|
|
100
|
+
onItemPress={onItemPress}
|
|
101
|
+
style={styles.itemContainer}
|
|
102
|
+
/>
|
|
103
|
+
)}
|
|
104
|
+
style={{ maxHeight: maxHeight - headerHeight - Spacing['2xl'] }}
|
|
105
|
+
contentContainerStyle={[
|
|
106
|
+
styles.contentContainer,
|
|
107
|
+
{ paddingHorizontal: padding + Spacing['2xs'] }
|
|
108
|
+
]}
|
|
135
109
|
keyExtractor={item => item.id}
|
|
136
110
|
getItemLayout={(_, index) => ({
|
|
137
111
|
length: ITEM_HEIGHT,
|
|
@@ -2,11 +2,8 @@ import { Spacing } from '@reown/appkit-ui-react-native';
|
|
|
2
2
|
import { StyleSheet } from 'react-native';
|
|
3
3
|
|
|
4
4
|
export default StyleSheet.create({
|
|
5
|
-
container: {
|
|
6
|
-
height: '100%'
|
|
7
|
-
},
|
|
8
5
|
contentContainer: {
|
|
9
|
-
paddingBottom: Spacing['
|
|
6
|
+
paddingBottom: Spacing['4xl']
|
|
10
7
|
},
|
|
11
8
|
placeholderContainer: {
|
|
12
9
|
flex: 0,
|
|
@@ -22,7 +19,7 @@ export default StyleSheet.create({
|
|
|
22
19
|
itemContainer: {
|
|
23
20
|
alignItems: 'center',
|
|
24
21
|
justifyContent: 'center',
|
|
25
|
-
|
|
22
|
+
margin: Spacing['4xs']
|
|
26
23
|
},
|
|
27
24
|
text: {
|
|
28
25
|
marginTop: Spacing.xs
|
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
CoreHelperUtil,
|
|
10
10
|
OptionsController,
|
|
11
11
|
EventsController,
|
|
12
|
-
ConstantsUtil
|
|
12
|
+
ConstantsUtil,
|
|
13
|
+
AssetController
|
|
13
14
|
} from '@reown/appkit-core-react-native';
|
|
14
15
|
import {
|
|
15
16
|
Button,
|
|
@@ -17,10 +18,10 @@ import {
|
|
|
17
18
|
LoadingThumbnail,
|
|
18
19
|
WalletImage,
|
|
19
20
|
Link,
|
|
20
|
-
IconBox
|
|
21
|
+
IconBox,
|
|
22
|
+
useCustomDimensions
|
|
21
23
|
} from '@reown/appkit-ui-react-native';
|
|
22
24
|
|
|
23
|
-
import { useCustomDimensions } from '../../hooks/useCustomDimensions';
|
|
24
25
|
import { StoreLink } from './components/StoreLink';
|
|
25
26
|
import { ConnectingBody, getMessage, type BodyErrorType } from '../w3m-connecting-body';
|
|
26
27
|
import styles from './styles';
|
|
@@ -35,6 +36,7 @@ export function ConnectingMobile({ onRetry, onCopyUri, isInstalled }: Props) {
|
|
|
35
36
|
const { data } = RouterController.state;
|
|
36
37
|
const { maxWidth: width } = useCustomDimensions();
|
|
37
38
|
const { wcUri, wcError } = useSnapshot(WcController.state);
|
|
39
|
+
const { walletImages } = useSnapshot(AssetController.state);
|
|
38
40
|
const [errorType, setErrorType] = useState<BodyErrorType>();
|
|
39
41
|
const showCopy =
|
|
40
42
|
OptionsController.isClipboardAvailable() &&
|
|
@@ -108,7 +110,7 @@ export function ConnectingMobile({ onRetry, onCopyUri, isInstalled }: Props) {
|
|
|
108
110
|
<LoadingThumbnail paused={!!errorType || wcError}>
|
|
109
111
|
<WalletImage
|
|
110
112
|
size="xl"
|
|
111
|
-
imageSrc={AssetUtil.getWalletImage(RouterController.state.data?.wallet)}
|
|
113
|
+
imageSrc={AssetUtil.getWalletImage(RouterController.state.data?.wallet, walletImages)}
|
|
112
114
|
imageHeaders={ApiController._getApiHeaders()}
|
|
113
115
|
/>
|
|
114
116
|
{wcError ? (
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Linking, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
import { ConstantsUtil } from '@reown/appkit-common-react-native';
|
|
3
|
+
import { FlexView, Icon, Pressable, Text } from '@reown/appkit-ui-react-native';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
style?: StyleProp<ViewStyle>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function ReownButton({ style }: Props) {
|
|
10
|
+
return (
|
|
11
|
+
<Pressable transparent onPress={() => Linking.openURL(ConstantsUtil.REOWN_URL)} style={style}>
|
|
12
|
+
<FlexView alignItems="center" justifyContent="center" flexDirection="row" columnGap="2xs">
|
|
13
|
+
<Text variant="small-500" color="fg-100">
|
|
14
|
+
UX by
|
|
15
|
+
</Text>
|
|
16
|
+
<Icon name="reown" color="fg-150" width={100} height={30} />
|
|
17
|
+
</FlexView>
|
|
18
|
+
</Pressable>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -6,11 +6,16 @@ import {
|
|
|
6
6
|
OptionsController,
|
|
7
7
|
SnackController
|
|
8
8
|
} from '@reown/appkit-core-react-native';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
import {
|
|
10
|
+
FlexView,
|
|
11
|
+
Link,
|
|
12
|
+
QrCode,
|
|
13
|
+
Text,
|
|
14
|
+
Spacing,
|
|
15
|
+
useCustomDimensions
|
|
16
|
+
} from '@reown/appkit-ui-react-native';
|
|
12
17
|
import styles from './styles';
|
|
13
|
-
import {
|
|
18
|
+
import { ReownButton } from './components/ReownButton';
|
|
14
19
|
|
|
15
20
|
export function ConnectingQrCode() {
|
|
16
21
|
const { wcUri } = useSnapshot(WcController.state);
|
|
@@ -49,10 +54,10 @@ export function ConnectingQrCode() {
|
|
|
49
54
|
alignItems="center"
|
|
50
55
|
justifyContent="center"
|
|
51
56
|
flexDirection={isPortrait ? 'column' : 'row'}
|
|
52
|
-
padding=
|
|
57
|
+
padding="xl"
|
|
53
58
|
>
|
|
54
59
|
<QrCode size={qrSize} uri={wcUri} testID="qr-code" />
|
|
55
|
-
<FlexView alignItems="center" margin=
|
|
60
|
+
<FlexView alignItems="center" margin="m">
|
|
56
61
|
<Text variant="paragraph-500">Scan this QR code with your phone</Text>
|
|
57
62
|
{showCopy ? (
|
|
58
63
|
<Link
|
|
@@ -65,15 +70,8 @@ export function ConnectingQrCode() {
|
|
|
65
70
|
Copy link
|
|
66
71
|
</Link>
|
|
67
72
|
) : null}
|
|
73
|
+
<ReownButton style={styles.reownButton} />
|
|
68
74
|
</FlexView>
|
|
69
|
-
<Pressable onPress={() => Linking.openURL(ConstantsUtil.REOWN_URL)}>
|
|
70
|
-
<FlexView alignItems="center" justifyContent="center" flexDirection="row" columnGap="2xs">
|
|
71
|
-
<Text variant="small-500" color="fg-100">
|
|
72
|
-
UX by
|
|
73
|
-
</Text>
|
|
74
|
-
<Icon name="reown" color="fg-150" width={100} height={30} />
|
|
75
|
-
</FlexView>
|
|
76
|
-
</Pressable>
|
|
77
75
|
</FlexView>
|
|
78
76
|
);
|
|
79
77
|
}
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
WcController,
|
|
9
9
|
CoreHelperUtil,
|
|
10
10
|
OptionsController,
|
|
11
|
-
EventsController
|
|
11
|
+
EventsController,
|
|
12
|
+
AssetController
|
|
12
13
|
} from '@reown/appkit-core-react-native';
|
|
13
14
|
import {
|
|
14
15
|
Button,
|
|
@@ -29,6 +30,7 @@ interface ConnectingWebProps {
|
|
|
29
30
|
export function ConnectingWeb({ onCopyUri }: ConnectingWebProps) {
|
|
30
31
|
const { data } = RouterController.state;
|
|
31
32
|
const { wcUri, wcError } = useSnapshot(WcController.state);
|
|
33
|
+
const { walletImages } = useSnapshot(AssetController.state);
|
|
32
34
|
const showCopy = OptionsController.isClipboardAvailable();
|
|
33
35
|
const bodyMessage = getMessage({
|
|
34
36
|
walletName: data?.wallet?.name,
|
|
@@ -68,7 +70,7 @@ export function ConnectingWeb({ onCopyUri }: ConnectingWebProps) {
|
|
|
68
70
|
<LoadingThumbnail paused={wcError}>
|
|
69
71
|
<WalletImage
|
|
70
72
|
size="xl"
|
|
71
|
-
imageSrc={AssetUtil.getWalletImage(data?.wallet)}
|
|
73
|
+
imageSrc={AssetUtil.getWalletImage(data?.wallet, walletImages)}
|
|
72
74
|
imageHeaders={ApiController._getApiHeaders()}
|
|
73
75
|
/>
|
|
74
76
|
{wcError ? (
|
|
@@ -14,7 +14,7 @@ export function Header() {
|
|
|
14
14
|
const { close, back } = useInternalAppKit();
|
|
15
15
|
const { data, view } = useSnapshot(RouterController.state);
|
|
16
16
|
const onHelpPress = () => {
|
|
17
|
-
RouterController.push('WhatIsAWallet');
|
|
17
|
+
RouterController.push('WhatIsAWallet', undefined, 'backward');
|
|
18
18
|
EventsController.sendEvent({ type: 'track', event: 'CLICK_WALLET_HELP' });
|
|
19
19
|
};
|
|
20
20
|
|