Skip to content

Commit aa7da67

Browse files
feat: refactor PaymentOptionsModal with reducer pattern and improved UI (#323)
* feat: refactor PaymentOptionsModal with reducer pattern and improved UI - Implement reducer-based state management for cleaner payment flow logic - Decompose PaymentOptionsModal into separate views (IntroView, CollectDataView, ConfirmPaymentView, ResultView, ViewWrapper) - Add new WalletConnectLoading animated component with reanimated - Add new icon assets (ArrowLeft, CaretUpDown, CheckCircle, Close, SealCheck) - Replace base.webp with base.png for better compatibility - Update session modals with consistent styling - Improve theme utilities and helper functions * fix: address PR review feedback for PaymentOptionsModal - Remove unnecessary key prop from View in ConfirmPaymentView - Add null check for merchant iconUrl in MerchantInfo - Replace hardcoded #9A9A9A with Theme['text-secondary'] in IntroView - Fix toggle condition to only expand when options.length > 1 - Add try-catch error handling in signature loop - Add warning/error for unsupported RPC methods Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 265af93 commit aa7da67

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2459
-1011
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
{
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4+
"[typescript]": {
5+
"editor.defaultFormatter": "esbenp.prettier-vscode"
6+
},
7+
"[typescriptreact]": {
8+
"editor.defaultFormatter": "esbenp.prettier-vscode"
9+
},
10+
"editor.codeActionsOnSave": {
11+
"source.fixAll.eslint": "explicit"
12+
}
213
}

wallets/rn_cli_wallet/babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ module.exports = {
2424
},
2525
},
2626
],
27+
['react-native-worklets/plugin'],
2728
],
2829
};

wallets/rn_cli_wallet/ios/Podfile.lock

Lines changed: 251 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1818,6 +1818,63 @@ PODS:
18181818
- React-Core
18191819
- react-native-get-random-values (1.11.0):
18201820
- React-Core
1821+
- react-native-keyboard-controller (1.20.6):
1822+
- boost
1823+
- DoubleConversion
1824+
- fast_float
1825+
- fmt
1826+
- glog
1827+
- hermes-engine
1828+
- RCT-Folly
1829+
- RCT-Folly/Fabric
1830+
- RCTRequired
1831+
- RCTTypeSafety
1832+
- React-Core
1833+
- React-debug
1834+
- React-Fabric
1835+
- React-featureflags
1836+
- React-graphics
1837+
- React-ImageManager
1838+
- React-jsi
1839+
- react-native-keyboard-controller/common (= 1.20.6)
1840+
- React-NativeModulesApple
1841+
- React-RCTFabric
1842+
- React-renderercss
1843+
- React-rendererdebug
1844+
- React-utils
1845+
- ReactCodegen
1846+
- ReactCommon/turbomodule/bridging
1847+
- ReactCommon/turbomodule/core
1848+
- SocketRocket
1849+
- Yoga
1850+
- react-native-keyboard-controller/common (1.20.6):
1851+
- boost
1852+
- DoubleConversion
1853+
- fast_float
1854+
- fmt
1855+
- glog
1856+
- hermes-engine
1857+
- RCT-Folly
1858+
- RCT-Folly/Fabric
1859+
- RCTRequired
1860+
- RCTTypeSafety
1861+
- React-Core
1862+
- React-debug
1863+
- React-Fabric
1864+
- React-featureflags
1865+
- React-graphics
1866+
- React-ImageManager
1867+
- React-jsi
1868+
- React-NativeModulesApple
1869+
- React-RCTFabric
1870+
- React-renderercss
1871+
- React-rendererdebug
1872+
- React-utils
1873+
- ReactCodegen
1874+
- ReactCommon/turbomodule/bridging
1875+
- ReactCommon/turbomodule/core
1876+
- SocketRocket
1877+
- Yoga
18211878
- react-native-mmkv (3.3.3):
18221879
- boost
18231880
- DoubleConversion
@@ -2620,6 +2677,98 @@ PODS:
26202677
- ReactCommon/turbomodule/core
26212678
- SocketRocket
26222679
- Yoga
2680+
- RNReanimated (4.2.1):
2681+
- boost
2682+
- DoubleConversion
2683+
- fast_float
2684+
- fmt
2685+
- glog
2686+
- hermes-engine
2687+
- RCT-Folly
2688+
- RCT-Folly/Fabric
2689+
- RCTRequired
2690+
- RCTTypeSafety
2691+
- React-Core
2692+
- React-debug
2693+
- React-Fabric
2694+
- React-featureflags
2695+
- React-graphics
2696+
- React-hermes
2697+
- React-ImageManager
2698+
- React-jsi
2699+
- React-NativeModulesApple
2700+
- React-RCTFabric
2701+
- React-renderercss
2702+
- React-rendererdebug
2703+
- React-utils
2704+
- ReactCodegen
2705+
- ReactCommon/turbomodule/bridging
2706+
- ReactCommon/turbomodule/core
2707+
- RNReanimated/reanimated (= 4.2.1)
2708+
- RNWorklets
2709+
- SocketRocket
2710+
- Yoga
2711+
- RNReanimated/reanimated (4.2.1):
2712+
- boost
2713+
- DoubleConversion
2714+
- fast_float
2715+
- fmt
2716+
- glog
2717+
- hermes-engine
2718+
- RCT-Folly
2719+
- RCT-Folly/Fabric
2720+
- RCTRequired
2721+
- RCTTypeSafety
2722+
- React-Core
2723+
- React-debug
2724+
- React-Fabric
2725+
- React-featureflags
2726+
- React-graphics
2727+
- React-hermes
2728+
- React-ImageManager
2729+
- React-jsi
2730+
- React-NativeModulesApple
2731+
- React-RCTFabric
2732+
- React-renderercss
2733+
- React-rendererdebug
2734+
- React-utils
2735+
- ReactCodegen
2736+
- ReactCommon/turbomodule/bridging
2737+
- ReactCommon/turbomodule/core
2738+
- RNReanimated/reanimated/apple (= 4.2.1)
2739+
- RNWorklets
2740+
- SocketRocket
2741+
- Yoga
2742+
- RNReanimated/reanimated/apple (4.2.1):
2743+
- boost
2744+
- DoubleConversion
2745+
- fast_float
2746+
- fmt
2747+
- glog
2748+
- hermes-engine
2749+
- RCT-Folly
2750+
- RCT-Folly/Fabric
2751+
- RCTRequired
2752+
- RCTTypeSafety
2753+
- React-Core
2754+
- React-debug
2755+
- React-Fabric
2756+
- React-featureflags
2757+
- React-graphics
2758+
- React-hermes
2759+
- React-ImageManager
2760+
- React-jsi
2761+
- React-NativeModulesApple
2762+
- React-RCTFabric
2763+
- React-renderercss
2764+
- React-rendererdebug
2765+
- React-utils
2766+
- ReactCodegen
2767+
- ReactCommon/turbomodule/bridging
2768+
- ReactCommon/turbomodule/core
2769+
- RNWorklets
2770+
- SocketRocket
2771+
- Yoga
26232772
- RNScreens (4.16.0):
26242773
- boost
26252774
- DoubleConversion
@@ -2766,6 +2915,95 @@ PODS:
27662915
- ReactCommon/turbomodule/core
27672916
- SocketRocket
27682917
- Yoga
2918+
- RNWorklets (0.7.1):
2919+
- boost
2920+
- DoubleConversion
2921+
- fast_float
2922+
- fmt
2923+
- glog
2924+
- hermes-engine
2925+
- RCT-Folly
2926+
- RCT-Folly/Fabric
2927+
- RCTRequired
2928+
- RCTTypeSafety
2929+
- React-Core
2930+
- React-debug
2931+
- React-Fabric
2932+
- React-featureflags
2933+
- React-graphics
2934+
- React-hermes
2935+
- React-ImageManager
2936+
- React-jsi
2937+
- React-NativeModulesApple
2938+
- React-RCTFabric
2939+
- React-renderercss
2940+
- React-rendererdebug
2941+
- React-utils
2942+
- ReactCodegen
2943+
- ReactCommon/turbomodule/bridging
2944+
- ReactCommon/turbomodule/core
2945+
- RNWorklets/worklets (= 0.7.1)
2946+
- SocketRocket
2947+
- Yoga
2948+
- RNWorklets/worklets (0.7.1):
2949+
- boost
2950+
- DoubleConversion
2951+
- fast_float
2952+
- fmt
2953+
- glog
2954+
- hermes-engine
2955+
- RCT-Folly
2956+
- RCT-Folly/Fabric
2957+
- RCTRequired
2958+
- RCTTypeSafety
2959+
- React-Core
2960+
- React-debug
2961+
- React-Fabric
2962+
- React-featureflags
2963+
- React-graphics
2964+
- React-hermes
2965+
- React-ImageManager
2966+
- React-jsi
2967+
- React-NativeModulesApple
2968+
- React-RCTFabric
2969+
- React-renderercss
2970+
- React-rendererdebug
2971+
- React-utils
2972+
- ReactCodegen
2973+
- ReactCommon/turbomodule/bridging
2974+
- ReactCommon/turbomodule/core
2975+
- RNWorklets/worklets/apple (= 0.7.1)
2976+
- SocketRocket
2977+
- Yoga
2978+
- RNWorklets/worklets/apple (0.7.1):
2979+
- boost
2980+
- DoubleConversion
2981+
- fast_float
2982+
- fmt
2983+
- glog
2984+
- hermes-engine
2985+
- RCT-Folly
2986+
- RCT-Folly/Fabric
2987+
- RCTRequired
2988+
- RCTTypeSafety
2989+
- React-Core
2990+
- React-debug
2991+
- React-Fabric
2992+
- React-featureflags
2993+
- React-graphics
2994+
- React-hermes
2995+
- React-ImageManager
2996+
- React-jsi
2997+
- React-NativeModulesApple
2998+
- React-RCTFabric
2999+
- React-renderercss
3000+
- React-rendererdebug
3001+
- React-utils
3002+
- ReactCodegen
3003+
- ReactCommon/turbomodule/bridging
3004+
- ReactCommon/turbomodule/core
3005+
- SocketRocket
3006+
- Yoga
27693007
- Sentry/HybridSDK (8.56.2)
27703008
- SocketRocket (0.7.1)
27713009
- VisionCamera (4.7.2):
@@ -2822,6 +3060,7 @@ DEPENDENCIES:
28223060
- "react-native-compat (from `../node_modules/@walletconnect/react-native-compat`)"
28233061
- react-native-config (from `../node_modules/react-native-config`)
28243062
- react-native-get-random-values (from `../node_modules/react-native-get-random-values`)
3063+
- react-native-keyboard-controller (from `../node_modules/react-native-keyboard-controller`)
28253064
- react-native-mmkv (from `../node_modules/react-native-mmkv`)
28263065
- "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)"
28273066
- react-native-quick-base64 (from `../node_modules/react-native-quick-base64`)
@@ -2864,9 +3103,11 @@ DEPENDENCIES:
28643103
- "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)"
28653104
- RNDeviceInfo (from `../node_modules/react-native-device-info`)
28663105
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
3106+
- RNReanimated (from `../node_modules/react-native-reanimated`)
28673107
- RNScreens (from `../node_modules/react-native-screens`)
28683108
- "RNSentry (from `../node_modules/@sentry/react-native`)"
28693109
- RNSVG (from `../node_modules/react-native-svg`)
3110+
- RNWorklets (from `../node_modules/react-native-worklets`)
28703111
- SocketRocket (~> 0.7.1)
28713112
- VisionCamera (from `../node_modules/react-native-vision-camera`)
28723113
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
@@ -2966,6 +3207,8 @@ EXTERNAL SOURCES:
29663207
:path: "../node_modules/react-native-config"
29673208
react-native-get-random-values:
29683209
:path: "../node_modules/react-native-get-random-values"
3210+
react-native-keyboard-controller:
3211+
:path: "../node_modules/react-native-keyboard-controller"
29693212
react-native-mmkv:
29703213
:path: "../node_modules/react-native-mmkv"
29713214
react-native-netinfo:
@@ -3050,12 +3293,16 @@ EXTERNAL SOURCES:
30503293
:path: "../node_modules/react-native-device-info"
30513294
RNGestureHandler:
30523295
:path: "../node_modules/react-native-gesture-handler"
3296+
RNReanimated:
3297+
:path: "../node_modules/react-native-reanimated"
30533298
RNScreens:
30543299
:path: "../node_modules/react-native-screens"
30553300
RNSentry:
30563301
:path: "../node_modules/@sentry/react-native"
30573302
RNSVG:
30583303
:path: "../node_modules/react-native-svg"
3304+
RNWorklets:
3305+
:path: "../node_modules/react-native-worklets"
30593306
VisionCamera:
30603307
:path: "../node_modules/react-native-vision-camera"
30613308
Yoga:
@@ -3106,6 +3353,7 @@ SPEC CHECKSUMS:
31063353
react-native-compat: 3c39c3d97e7aca94e8c6576ca89d9e6326061216
31073354
react-native-config: 644074ab88db883fcfaa584f03520ec29589d7df
31083355
react-native-get-random-values: d16467cf726c618e9c7a8c3c39c31faa2244bbba
3356+
react-native-keyboard-controller: f2ed31d12d9d8cb8ad2f9110c18fa5df499b66a3
31093357
react-native-mmkv: ac7507625cd74bac0eb5333604a7cd7b08fe9e3e
31103358
react-native-netinfo: cec9c4e86083cb5b6aba0e0711f563e2fbbff187
31113359
react-native-quick-base64: 6568199bb2ac8e72ecdfdc73a230fbc5c1d3aac4
@@ -3148,9 +3396,11 @@ SPEC CHECKSUMS:
31483396
RNCClipboard: 4b58c780f63676367640f23c8e114e9bd0cf86ac
31493397
RNDeviceInfo: bcce8752b5043a623fe3c26789679b473f705d3c
31503398
RNGestureHandler: f1dd7f92a0faa2868a919ab53bb9d66eb4ebfcf5
3399+
RNReanimated: 7d59df16c018cf3ed5d5b45964cedea4fc5c26ef
31513400
RNScreens: 0bbf16c074ae6bb1058a7bf2d1ae017f4306797c
31523401
RNSentry: bbaa7ef3a4b131bc947de327ed9e47a054ce0978
31533402
RNSVG: 8c0bbfa480a24b24468f1c76bd852a4aac3178e6
3403+
RNWorklets: d9c050940f140af5d8b611d937eab1cbfce5e9a5
31543404
Sentry: b53951377b78e21a734f5dc8318e333dbfc682d7
31553405
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
31563406
VisionCamera: 30b358b807324c692064f78385e9a732ce1bebfe
@@ -3159,4 +3409,4 @@ SPEC CHECKSUMS:
31593409

31603410
PODFILE CHECKSUM: 37b3abb743131d0d701e76db155ef06d7f5954ad
31613411

3162-
COCOAPODS: 1.16.2
3412+
COCOAPODS: 1.14.3

wallets/rn_cli_wallet/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,18 @@
5252
"react-native-dialog": "9.3.0",
5353
"react-native-gesture-handler": "2.28.0",
5454
"react-native-get-random-values": "1.11.0",
55+
"react-native-keyboard-controller": "^1.20.6",
5556
"react-native-mmkv": "3.3.3",
5657
"react-native-modal": "14.0.0-rc.1",
5758
"react-native-quick-base64": "2.2.2",
5859
"react-native-quick-crypto": "0.7.17",
60+
"react-native-reanimated": "^4.2.1",
5961
"react-native-safe-area-context": "5.6.1",
6062
"react-native-screens": "4.16.0",
6163
"react-native-svg": "15.14.0",
6264
"react-native-toast-message": "2.3.3",
6365
"react-native-vision-camera": "4.7.2",
66+
"react-native-worklets": "^0.7.1",
6467
"stream-browserify": "3.0.0",
6568
"tronweb": "^6.1.1",
6669
"valtio": "2.1.8"

wallets/rn_cli_wallet/src/assets/AlertCircle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const SvgAlertCircle = (props: SvgProps) => (
77
fillRule="evenodd"
88
clipRule="evenodd"
99
d="M7 0.583344C3.45617 0.583344 0.583332 3.45618 0.583332 7.00001C0.583332 10.5438 3.45617 13.4167 7 13.4167C10.5438 13.4167 13.4167 10.5438 13.4167 7.00001C13.4167 3.45618 10.5438 0.583344 7 0.583344ZM7.58333 4.66668C7.58333 4.34451 7.32217 4.08334 7 4.08334C6.67783 4.08334 6.41667 4.34451 6.41667 4.66668V7.00001C6.41667 7.32218 6.67783 7.58334 7 7.58334C7.32217 7.58334 7.58333 7.32218 7.58333 7.00001V4.66668ZM7 8.75001C6.67783 8.75001 6.41667 9.01118 6.41667 9.33334C6.41667 9.65551 6.67783 9.91668 7 9.91668H7.00583C7.328 9.91668 7.58917 9.65551 7.58917 9.33334C7.58917 9.01118 7.328 8.75001 7.00583 8.75001H7Z"
10-
fill="#FF800A"
10+
fill={props.fill || "#FF800A"}
1111
/>
1212
</Svg>
1313
);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Svg, { Path, type SvgProps } from 'react-native-svg';
2+
3+
const SvgArrowLeft = (props: SvgProps) => (
4+
<Svg viewBox="0 0 38 38" fill="none" {...props}>
5+
<Path
6+
d="M26.8123 19.0008C26.8123 19.2495 26.7135 19.4879 26.5377 19.6638C26.3619 19.8396 26.1234 19.9383 25.8748 19.9383H14.3904L18.4154 23.9626C18.5915 24.1387 18.6905 24.3776 18.6905 24.6266C18.6905 24.8757 18.5915 25.1146 18.4154 25.2907C18.2393 25.4668 18.0004 25.5658 17.7513 25.5658C17.5023 25.5658 17.2634 25.4668 17.0873 25.2907L11.4623 19.6657C11.3749 19.5786 11.3055 19.4751 11.2582 19.3611C11.2109 19.2472 11.1865 19.125 11.1865 19.0016C11.1865 18.8782 11.2109 18.7561 11.2582 18.6421C11.3055 18.5282 11.3749 18.4247 11.4623 18.3376L17.0873 12.7126C17.1745 12.6254 17.278 12.5562 17.3919 12.509C17.5059 12.4618 17.628 12.4375 17.7513 12.4375C17.8747 12.4375 17.9968 12.4618 18.1107 12.509C18.2247 12.5562 18.3282 12.6254 18.4154 12.7126C18.5026 12.7998 18.5718 12.9033 18.619 13.0172C18.6662 13.1312 18.6905 13.2533 18.6905 13.3766C18.6905 13.5 18.6662 13.6221 18.619 13.736C18.5718 13.85 18.5026 13.9535 18.4154 14.0407L14.3904 18.0633H25.8748C26.1234 18.0633 26.3619 18.1621 26.5377 18.3379C26.7135 18.5137 26.8123 18.7522 26.8123 19.0008Z"
7+
fill={props.fill || '#202020'}
8+
/>
9+
</Svg>
10+
);
11+
export default SvgArrowLeft;

0 commit comments

Comments
 (0)