react-native-fpay 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/lib/module/FountainPayProvider.js +108 -18
  2. package/lib/module/FountainPayProvider.js.map +1 -1
  3. package/lib/module/core/api/client.js +13 -1
  4. package/lib/module/core/api/client.js.map +1 -1
  5. package/lib/module/core/api/index.js +66 -24
  6. package/lib/module/core/api/index.js.map +1 -1
  7. package/lib/module/engine/BLEReceiverService.js.map +1 -1
  8. package/lib/module/engine/BLESenderService.js.map +1 -1
  9. package/lib/module/engine/FPEngine.js +164 -43
  10. package/lib/module/engine/FPEngine.js.map +1 -1
  11. package/lib/module/engine/NearbyUsersService.js +1 -1
  12. package/lib/module/engine/NearbyUsersService.js.map +1 -1
  13. package/lib/module/index.js +1 -0
  14. package/lib/module/index.js.map +1 -1
  15. package/lib/module/store/FPStore.js +155 -0
  16. package/lib/module/store/FPStore.js.map +1 -0
  17. package/lib/module/ui/components/AnimatedDots.js +3 -3
  18. package/lib/module/ui/components/AnimatedDots.js.map +1 -1
  19. package/lib/module/ui/components/ConfirmScreen.js +137 -123
  20. package/lib/module/ui/components/ConfirmScreen.js.map +1 -1
  21. package/lib/module/ui/components/FPButton.js.map +1 -1
  22. package/lib/module/ui/components/LoadingAnimation/InLoading.js +3 -3
  23. package/lib/module/ui/components/LoadingAnimation/InLoading.js.map +1 -1
  24. package/lib/module/ui/components/LoadingAnimation/index.js +3 -3
  25. package/lib/module/ui/components/LoadingAnimation/index.js.map +1 -1
  26. package/lib/module/ui/components/OtpInput/OTPInputView.js +11 -11
  27. package/lib/module/ui/components/OtpInput/OTPInputView.js.map +1 -1
  28. package/lib/module/ui/components/OtpInput/Styles.js +1 -1
  29. package/lib/module/ui/components/OtpInput/helpers/codeToArray.js +1 -1
  30. package/lib/module/ui/components/OtpInput/helpers/device.js.map +1 -1
  31. package/lib/module/ui/components/OtpInput/helpers/styles.js.map +1 -1
  32. package/lib/module/ui/components/OtpInput/index.js +3 -1
  33. package/lib/module/ui/components/OtpInput/index.js.map +1 -1
  34. package/lib/module/ui/components/PulseAnimation.js +2 -2
  35. package/lib/module/ui/components/PulseAnimation.js.map +1 -1
  36. package/lib/module/ui/modals/FPPaymentRequestModal.js +8 -7
  37. package/lib/module/ui/modals/FPPaymentRequestModal.js.map +1 -1
  38. package/lib/module/ui/modals/FPShell.js +2 -0
  39. package/lib/module/ui/modals/FPShell.js.map +1 -1
  40. package/lib/module/ui/screens/ReceiveScreen.js +8 -9
  41. package/lib/module/ui/screens/ReceiveScreen.js.map +1 -1
  42. package/lib/module/ui/screens/SendScreen.js +43 -94
  43. package/lib/module/ui/screens/SendScreen.js.map +1 -1
  44. package/lib/module/ui/screens/styles.js +15 -3
  45. package/lib/module/ui/screens/styles.js.map +1 -1
  46. package/lib/module/ui/screens/sub/receivePayment/Nfc/index.js +4 -4
  47. package/lib/module/ui/screens/sub/receivePayment/Nfc/index.js.map +1 -1
  48. package/lib/module/ui/screens/sub/receivePayment/Qr/index.js +5 -5
  49. package/lib/module/ui/screens/sub/receivePayment/Qr/index.js.map +1 -1
  50. package/lib/module/ui/screens/sub/receivePayment/Transfer/index.js +10 -11
  51. package/lib/module/ui/screens/sub/receivePayment/Transfer/index.js.map +1 -1
  52. package/lib/module/ui/screens/sub/sendPayment/BluetoothSubScreen.js +31 -8
  53. package/lib/module/ui/screens/sub/sendPayment/BluetoothSubScreen.js.map +1 -1
  54. package/lib/module/ui/screens/sub/sendPayment/NFCSubScreen.js +12 -8
  55. package/lib/module/ui/screens/sub/sendPayment/NFCSubScreen.js.map +1 -1
  56. package/lib/module/ui/screens/sub/sendPayment/NQRSubScreen.js +17 -5
  57. package/lib/module/ui/screens/sub/sendPayment/NQRSubScreen.js.map +1 -1
  58. package/lib/module/ui/screens/sub/sendPayment/ProximitySubScreen.js +67 -35
  59. package/lib/module/ui/screens/sub/sendPayment/ProximitySubScreen.js.map +1 -1
  60. package/lib/module/ui/screens/sub/sendPayment/TransferSubScreen.js +110 -34
  61. package/lib/module/ui/screens/sub/sendPayment/TransferSubScreen.js.map +1 -1
  62. package/lib/module/ui/theme/index.js.map +1 -1
  63. package/lib/typescript/src/FountainPayProvider.d.ts +1 -1
  64. package/lib/typescript/src/FountainPayProvider.d.ts.map +1 -1
  65. package/lib/typescript/src/core/api/client.d.ts.map +1 -1
  66. package/lib/typescript/src/core/api/index.d.ts +42 -26
  67. package/lib/typescript/src/core/api/index.d.ts.map +1 -1
  68. package/lib/typescript/src/core/types/index.d.ts +53 -28
  69. package/lib/typescript/src/core/types/index.d.ts.map +1 -1
  70. package/lib/typescript/src/engine/BLEReceiverService.d.ts +2 -0
  71. package/lib/typescript/src/engine/BLEReceiverService.d.ts.map +1 -1
  72. package/lib/typescript/src/engine/BLESenderService.d.ts.map +1 -1
  73. package/lib/typescript/src/engine/FPEngine.d.ts +5 -3
  74. package/lib/typescript/src/engine/FPEngine.d.ts.map +1 -1
  75. package/lib/typescript/src/engine/useIsForeground.d.ts.map +1 -1
  76. package/lib/typescript/src/index.d.ts +2 -1
  77. package/lib/typescript/src/index.d.ts.map +1 -1
  78. package/lib/typescript/src/store/FPStore.d.ts +60 -0
  79. package/lib/typescript/src/store/FPStore.d.ts.map +1 -0
  80. package/lib/typescript/src/ui/components/AnimatedDots.d.ts.map +1 -1
  81. package/lib/typescript/src/ui/components/ConfirmScreen.d.ts +5 -5
  82. package/lib/typescript/src/ui/components/ConfirmScreen.d.ts.map +1 -1
  83. package/lib/typescript/src/ui/components/FPButton.d.ts +1 -1
  84. package/lib/typescript/src/ui/components/FPButton.d.ts.map +1 -1
  85. package/lib/typescript/src/ui/components/LoadingAnimation/InLoading.d.ts.map +1 -1
  86. package/lib/typescript/src/ui/components/LoadingAnimation/index.d.ts.map +1 -1
  87. package/lib/typescript/src/ui/components/OtpInput/OTPInputView.d.ts.map +1 -1
  88. package/lib/typescript/src/ui/components/OtpInput/helpers/codeToArray.d.ts.map +1 -1
  89. package/lib/typescript/src/ui/components/OtpInput/helpers/device.d.ts.map +1 -1
  90. package/lib/typescript/src/ui/components/OtpInput/helpers/styles.d.ts.map +1 -1
  91. package/lib/typescript/src/ui/components/OtpInput/helpers/types.d.ts +1 -2
  92. package/lib/typescript/src/ui/components/OtpInput/helpers/types.d.ts.map +1 -1
  93. package/lib/typescript/src/ui/components/OtpInput/index.d.ts +3 -1
  94. package/lib/typescript/src/ui/components/OtpInput/index.d.ts.map +1 -1
  95. package/lib/typescript/src/ui/components/PulseAnimation.d.ts.map +1 -1
  96. package/lib/typescript/src/ui/modals/FPPaymentRequestModal.d.ts.map +1 -1
  97. package/lib/typescript/src/ui/modals/FPShell.d.ts.map +1 -1
  98. package/lib/typescript/src/ui/screens/ReceiveScreen.d.ts +1 -1
  99. package/lib/typescript/src/ui/screens/ReceiveScreen.d.ts.map +1 -1
  100. package/lib/typescript/src/ui/screens/SendScreen.d.ts +1 -1
  101. package/lib/typescript/src/ui/screens/SendScreen.d.ts.map +1 -1
  102. package/lib/typescript/src/ui/screens/styles.d.ts +197 -0
  103. package/lib/typescript/src/ui/screens/styles.d.ts.map +1 -1
  104. package/lib/typescript/src/ui/screens/sub/receivePayment/Nfc/index.d.ts.map +1 -1
  105. package/lib/typescript/src/ui/screens/sub/receivePayment/Qr/index.d.ts.map +1 -1
  106. package/lib/typescript/src/ui/screens/sub/receivePayment/Transfer/index.d.ts.map +1 -1
  107. package/lib/typescript/src/ui/screens/sub/sendPayment/BluetoothSubScreen.d.ts.map +1 -1
  108. package/lib/typescript/src/ui/screens/sub/sendPayment/NFCSubScreen.d.ts +1 -1
  109. package/lib/typescript/src/ui/screens/sub/sendPayment/NFCSubScreen.d.ts.map +1 -1
  110. package/lib/typescript/src/ui/screens/sub/sendPayment/NQRSubScreen.d.ts +1 -1
  111. package/lib/typescript/src/ui/screens/sub/sendPayment/NQRSubScreen.d.ts.map +1 -1
  112. package/lib/typescript/src/ui/screens/sub/sendPayment/ProximitySubScreen.d.ts +1 -1
  113. package/lib/typescript/src/ui/screens/sub/sendPayment/ProximitySubScreen.d.ts.map +1 -1
  114. package/lib/typescript/src/ui/screens/sub/sendPayment/TransferSubScreen.d.ts +1 -1
  115. package/lib/typescript/src/ui/screens/sub/sendPayment/TransferSubScreen.d.ts.map +1 -1
  116. package/lib/typescript/src/ui/theme/index.d.ts.map +1 -1
  117. package/package.json +4 -4
  118. package/src/FountainPayProvider.tsx +163 -24
  119. package/src/core/api/client.ts +26 -4
  120. package/src/core/api/index.ts +170 -49
  121. package/src/core/types/index.ts +81 -48
  122. package/src/engine/BLEReceiverService.ts +86 -28
  123. package/src/engine/BLESenderService.ts +133 -69
  124. package/src/engine/FPEngine.ts +316 -97
  125. package/src/engine/NearbyUsersService.ts +6 -6
  126. package/src/engine/useIsForeground.ts +12 -12
  127. package/src/index.ts +10 -4
  128. package/src/store/FPStore.ts +216 -0
  129. package/src/ui/components/AnimatedDots.tsx +4 -5
  130. package/src/ui/components/ConfirmScreen.tsx +182 -169
  131. package/src/ui/components/FPButton.tsx +50 -9
  132. package/src/ui/components/LoadingAnimation/InLoading.tsx +23 -27
  133. package/src/ui/components/LoadingAnimation/index.tsx +3 -7
  134. package/src/ui/components/OtpInput/OTPInputView.tsx +254 -205
  135. package/src/ui/components/OtpInput/Styles.ts +1 -1
  136. package/src/ui/components/OtpInput/helpers/codeToArray.ts +2 -2
  137. package/src/ui/components/OtpInput/helpers/device.ts +4 -3
  138. package/src/ui/components/OtpInput/helpers/styles.ts +13 -14
  139. package/src/ui/components/OtpInput/helpers/types.ts +83 -79
  140. package/src/ui/components/OtpInput/index.tsx +18 -15
  141. package/src/ui/components/PulseAnimation.tsx +3 -5
  142. package/src/ui/modals/FPPaymentRequestModal.tsx +111 -28
  143. package/src/ui/modals/FPShell.tsx +60 -34
  144. package/src/ui/screens/ReceiveScreen.tsx +245 -84
  145. package/src/ui/screens/SendScreen.tsx +419 -167
  146. package/src/ui/screens/styles.ts +17 -5
  147. package/src/ui/screens/sub/receivePayment/Nfc/index.tsx +17 -25
  148. package/src/ui/screens/sub/receivePayment/Qr/index.tsx +21 -20
  149. package/src/ui/screens/sub/receivePayment/Transfer/index.tsx +34 -28
  150. package/src/ui/screens/sub/sendPayment/BluetoothSubScreen.tsx +135 -67
  151. package/src/ui/screens/sub/sendPayment/NFCSubScreen.tsx +188 -112
  152. package/src/ui/screens/sub/sendPayment/NQRSubScreen.tsx +102 -69
  153. package/src/ui/screens/sub/sendPayment/ProximitySubScreen.tsx +225 -99
  154. package/src/ui/screens/sub/sendPayment/TransferSubScreen.tsx +209 -89
  155. package/src/ui/theme/index.ts +14 -2
@@ -1,13 +1,43 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import { View, Text, TextInput, FlatList, TouchableOpacity, StyleSheet, ActivityIndicator, ScrollView, Animated, Dimensions, Easing, Pressable } from 'react-native';
2
+ import {
3
+ View,
4
+ Text,
5
+ TextInput,
6
+ TouchableOpacity,
7
+ ScrollView,
8
+ Animated,
9
+ Dimensions,
10
+ Easing,
11
+ Pressable,
12
+ Image,
13
+ Switch,
14
+ } from 'react-native';
3
15
  import { transferAPI } from '../../../../core/api';
4
- import { FPButton } from '../../../components/FPButton';
5
- import { C, R, S, F, shadow } from '../../../theme';
6
- import type { FPCurrency, FPTransaction, FPError, Props, FPSendPaymentRequest } from '../../../../core/types';
16
+ import type {
17
+ FPError,
18
+ Props,
19
+ FPSendPaymentRequest,
20
+ FPSendWalletPaymentRequest,
21
+ } from '../../../../core/types';
7
22
  import styled from 'styled-components/native';
8
23
  import Ionicons from 'react-native-vector-icons/Ionicons';
9
24
  import { AnimatedDots } from '../../../components/AnimatedDots';
10
- import { ButtonContainer, ContentContainer, CTAButton, CTAText, HomeIndicator, InputBox, InputContainer, Label, List, ListText, StyledTextInput } from '../../styles';
25
+ import {
26
+ ButtonContainer,
27
+ ContentContainer,
28
+ CTAButton,
29
+ CTAText,
30
+ ErrorLabel,
31
+ HomeIndicator,
32
+ InputBox,
33
+ InputContainer,
34
+ Label,
35
+ List,
36
+ ListGroup,
37
+ ListText,
38
+ StyledTextInput,
39
+ } from '../../styles';
40
+ import { getFPStore } from '../../../../store/FPStore';
11
41
 
12
42
  type Step = 'bank' | 'account' | 'confirm' | 'processing' | 'done';
13
43
  const { width, height } = Dimensions.get('window');
@@ -62,8 +92,6 @@ const HeaderRight = styled(View)`
62
92
  gap: 8px;
63
93
  `;
64
94
 
65
-
66
-
67
95
  const BottomSheet = styled(View)`
68
96
  position: absolute;
69
97
  bottom: 0;
@@ -99,7 +127,6 @@ const AnimatedBottomSheet = styled(Animated.View)`
99
127
  z-index: 9999999999 !important;
100
128
  `;
101
129
 
102
-
103
130
  const SheetHeader = styled(View)`
104
131
  flex-direction: row;
105
132
  justify-content: flex-end;
@@ -128,8 +155,6 @@ const SectionTitle = styled(Text)`
128
155
  margin-bottom: 16px;
129
156
  `;
130
157
 
131
-
132
-
133
158
  const SearchContainer = styled(View)`
134
159
  flex-direction: row;
135
160
  align-items: center;
@@ -148,11 +173,37 @@ const SearchInput = styled(TextInput)`
148
173
  padding: 0;
149
174
  `;
150
175
 
176
+ const BankLogo = styled(Image)`
177
+ width: 24px;
178
+ height: 24px;
179
+ border-radius: 100%;
180
+ margin-right: 12px;
181
+ `;
182
+
183
+ const SwitchGroup = styled(View)`
184
+ flex-direction: row;
185
+ align-items: center;
186
+ justify-content: space-between;
187
+ margin-bottom: 12px;
188
+ `;
151
189
 
190
+ const SwitchLabel = styled(Text)`
191
+ font-size: 14px;
192
+ color: #fff;
193
+ margin-left: 12px;
194
+ `;
152
195
 
153
- export function TransferSubScreen({ amount, currency, onClose, onProcessTransaction, onError }: Props) {
154
- const [searchStr, setSearchStr] = useState<string>("");
155
- const [accountNumber, setAccountNumber] = useState<string>("");
196
+ export function TransferSubScreen({
197
+ amount,
198
+ currency,
199
+ onClose,
200
+ onProcessTransaction,
201
+ onError,
202
+ }: Props) {
203
+ const [searchStr, setSearchStr] = useState<string>('');
204
+ const [accountNumber, setAccountNumber] = useState<string>('');
205
+ const [error, setError] = useState<string>('');
206
+ const [isBank, setIsBank] = useState<boolean>(false);
156
207
  const [bank, setBank] = useState<any>({});
157
208
  const [accountDetail, setAccountDetail] = useState<any>({});
158
209
 
@@ -160,11 +211,10 @@ export function TransferSubScreen({ amount, currency, onClose, onProcessTransact
160
211
 
161
212
  const [showBankList, setShowBankList] = useState<boolean>(false);
162
213
 
163
- const [banks, setBanks] = useState<any>([])
214
+ const [banks, setBanks] = useState<any>(getFPStore().banks);
164
215
  const [filteredBanks, setFilteredBanks] = useState<any>([]);
165
216
  const slideAnim = React.useRef(new Animated.Value(height)).current;
166
217
 
167
-
168
218
  const openSheet = () => {
169
219
  setShowBankList(true);
170
220
  Animated.timing(slideAnim, {
@@ -187,80 +237,127 @@ export function TransferSubScreen({ amount, currency, onClose, onProcessTransact
187
237
  };
188
238
 
189
239
  const handleSend = async () => {
190
- if (!bank || !accountDetail) return;
191
- try {
192
- const paylaod: FPSendPaymentRequest = {
193
- amount: amount,
194
- currency: currency,
195
- channel: 'transfer',
196
- narration: `Send ${currency}${amount} to ${accountDetail.accountName}`,
197
- recipient: accountDetail
198
- }
199
- onProcessTransaction?.(paylaod);
200
- } catch (err) {
201
- onError?.(err as FPError);
202
- }
203
- }
240
+ if (!accountDetail) return;
241
+
242
+ try {
243
+ const base = {
244
+ recipient: accountDetail,
245
+ amount, // keep as number — host app converts if needed
246
+ currency,
247
+ narration: `Send ${currency}${amount} to ${accountDetail.accountName}`,
248
+ reference: `SEND_${Date.now()}`,
249
+ channel: 'transfer' as const,
250
+ };
251
+
252
+ if (!isBank) {
253
+ onProcessTransaction?.({
254
+ ...base,
255
+ sender_id: getFPStore().psspId ?? '',
256
+ sender_type: 'USER' as const,
257
+ });
258
+ } else if (isBank && bank) {
259
+ onProcessTransaction?.({
260
+ ...base,
261
+ isBank: true,
262
+ });
263
+ }
264
+ } catch (err: any) {
265
+ onError?.(err);
266
+ }
267
+ };
204
268
 
205
269
  const handleSelectBank = (bank: any) => {
206
270
  setBank(bank);
207
271
  closeSheet();
208
272
  };
209
273
 
210
-
211
- useEffect(() => { transferAPI.getBanks().then(setBanks).catch(() => {}); }, []);
274
+ // useEffect(() => { transferAPI.getBanks().then(setBanks).catch(() => {}); }, []);
212
275
 
213
276
  useEffect(() => {
214
- if (accountNumber.length === 10 && bank) {
215
- setIsVerifying(true);
216
- setAccountDetail(null);
217
- transferAPI.verifyAccount(accountNumber, bank.code)
218
- .then(r => setAccountDetail(r))
219
- .catch(() => setAccountDetail(null))
220
- .finally(() => setIsVerifying(false));
221
- }
222
- }, [accountNumber, bank]);
223
-
224
-
277
+ if (accountNumber.length !== 10) return;
278
+
279
+ setIsVerifying(true);
280
+ setAccountDetail(null);
281
+ setError('');
282
+
283
+ const verify =
284
+ isBank && bank
285
+ ? transferAPI.verifyAccount(accountNumber, bank.InstitutionCode)
286
+ : !isBank
287
+ ? transferAPI.verifyWalletAccount(accountNumber)
288
+ : null;
289
+
290
+ if (!verify) return; // isBank true but no bank selected yet
291
+
292
+ verify
293
+ .then((r: any) => setAccountDetail(r.payload))
294
+ .catch((e: any) => {
295
+ setAccountDetail(null);
296
+ setError(e.message || 'Failed to verify account');
297
+ })
298
+ .finally(() => setIsVerifying(false));
299
+ }, [accountNumber, bank, isBank]);
225
300
 
226
301
  useEffect(() => {
227
302
  const query = searchStr.trim().toLowerCase();
228
303
 
229
304
  if (!query) {
230
- setFilteredBanks(banks);
305
+ setFilteredBanks(banks.slice(0, 20));
231
306
  return;
232
307
  }
233
308
 
234
309
  const filtered = banks.filter((bank: any) =>
235
- bank.name.toLowerCase().includes(query)
310
+ bank.InstitutionName.toLowerCase().includes(query)
236
311
  );
237
312
 
238
313
  setFilteredBanks(filtered);
239
314
  }, [searchStr, banks]);
240
315
 
241
- return(
316
+ useEffect(() => {
317
+ if (getFPStore().banks.length > 0) {
318
+ setBanks(getFPStore().banks);
319
+ }
320
+ }, [getFPStore().banks]);
321
+
322
+ return (
242
323
  <Container>
243
324
  {/* Header */}
244
325
  <Header>
245
326
  <HeaderButton onPress={onClose}>
246
327
  <Ionicons name="close" size={24} />
247
328
  </HeaderButton>
248
-
329
+
249
330
  <HeaderCenter>
250
- <Text style={{ fontWeight: 'bold', fontSize: 16, color:'#FFF' }}>Bank</Text>
331
+ <Text style={{ fontWeight: 'bold', fontSize: 16, color: '#FFF' }}>
332
+ Bank
333
+ </Text>
251
334
  <Text style={{ fontSize: 10, color: '#FFF' }}>Transfer</Text>
252
335
  </HeaderCenter>
253
-
254
- <HeaderRight>
255
-
256
- </HeaderRight>
336
+
337
+ <HeaderRight />
257
338
  </Header>
258
339
  <FormContainer>
259
340
  <InputContainer>
260
- <Label>Account Details</Label>
341
+ <SwitchGroup>
342
+ <Label>Account Details</Label>
343
+ <ListGroup>
344
+ <SwitchLabel>To Banks</SwitchLabel>
345
+ <Switch
346
+ trackColor={{ false: '#767577', true: '#FFF' }}
347
+ thumbColor={isBank ? '#003333' : '#f4f3f4'}
348
+ ios_backgroundColor="#3e3e3e"
349
+ value={isBank}
350
+ onValueChange={() => setIsBank(!isBank)}
351
+ style={{ transform: [{ scaleX: 0.7 }, { scaleY: 0.7 }] }}
352
+ />
353
+ </ListGroup>
354
+ </SwitchGroup>
355
+
261
356
  <InputBox>
262
357
  <StyledTextInput
263
- placeholder="Enter account number"
358
+ placeholder={
359
+ !isBank ? 'Enter wallet address' : 'Enter account number'
360
+ }
264
361
  placeholderTextColor="#d1d5db"
265
362
  value={accountNumber}
266
363
  keyboardType="number-pad"
@@ -271,36 +368,51 @@ export function TransferSubScreen({ amount, currency, onClose, onProcessTransact
271
368
  setAccountNumber(numericText);
272
369
  }}
273
370
  />
274
-
275
371
  </InputBox>
276
372
  </InputContainer>
277
-
373
+ {isBank && (
374
+ <InputContainer>
375
+ <Label>Bank</Label>
376
+ <InputBox>
377
+ <StyledTextInput
378
+ placeholder="Enter Bank"
379
+ placeholderTextColor="#d1d5db"
380
+ value={bank?.InstitutionName ?? ''}
381
+ editable={false}
382
+ onPress={() => {
383
+ openSheet();
384
+ }}
385
+ />
386
+ </InputBox>
387
+ </InputContainer>
388
+ )}
278
389
  <InputContainer>
279
- <Label>Bank</Label>
280
- <InputBox>
281
- <StyledTextInput
282
- placeholder="Enter Bank"
283
- placeholderTextColor="#d1d5db"
284
- value={bank?.name ?? ''}
285
- editable={false}
286
- onPress={()=>{openSheet()}}
287
- />
288
- </InputBox>
289
- <View style={{flexDirection: 'row', alignItems: 'center', paddingTop: 16}}>
390
+ <View
391
+ style={{
392
+ flexDirection: 'row',
393
+ alignItems: 'center',
394
+ paddingTop: 6,
395
+ }}
396
+ >
290
397
  {isVerifying && <AnimatedDots />}
291
- {!isVerifying && accountDetail && <Label>{accountDetail.name?.toUpperCase()}</Label>}
398
+ {!isVerifying && accountDetail && (
399
+ <Label>{accountDetail.accountName?.toUpperCase()}</Label>
400
+ )}
401
+ {!isVerifying && error && <ErrorLabel>{error}</ErrorLabel>}
292
402
  </View>
293
-
294
- </InputContainer>
403
+ </InputContainer>
295
404
  <HomeIndicator />
296
405
  <ContentContainer>
297
406
  <ButtonContainer>
298
- <CTAButton activeOpacity={0.8} disabled={!accountDetail || !accountDetail.name} onPress={handleSend}>
407
+ <CTAButton
408
+ activeOpacity={0.8}
409
+ disabled={!accountDetail || !accountDetail.accountName}
410
+ onPress={handleSend}
411
+ >
299
412
  <CTAText>Send</CTAText>
300
413
  </CTAButton>
301
- </ButtonContainer>
414
+ </ButtonContainer>
302
415
  </ContentContainer>
303
-
304
416
  </FormContainer>
305
417
  {showBankList && (
306
418
  <AnimatedBottomSheet
@@ -314,32 +426,40 @@ export function TransferSubScreen({ amount, currency, onClose, onProcessTransact
314
426
  <Ionicons name="close" size={22} />
315
427
  </Pressable>
316
428
  </SheetHeader>
317
-
429
+
318
430
  <SheetScrollView showsVerticalScrollIndicator={false}>
319
431
  <SearchContainer>
320
432
  <Ionicons name="search" size={18} color="#9ca3af" />
321
433
  <SearchInput
322
- placeholder="Type a name or phone number to send"
323
- placeholderTextColor="#9ca3af"
324
- value={searchStr}
325
- onChangeText={setSearchStr}
434
+ placeholder="Type a name or phone number to send"
435
+ placeholderTextColor="#9ca3af"
436
+ value={searchStr}
437
+ onChangeText={setSearchStr}
326
438
  />
327
439
  </SearchContainer>
328
440
  <SectionTitle>Banks</SectionTitle>
329
- {filteredBanks && filteredBanks.map((bank: any, index: number)=>{
330
- return (
331
- <List key={`bank-id-${index}`} onPress={() => handleSelectBank(bank)}>
332
- <ListText>{bank.name}</ListText>
333
- <Ionicons name="chevron-forward" size={20} color="#1f2937" />
334
- </List>
335
- )
336
- })}
441
+ {filteredBanks &&
442
+ filteredBanks.map((bank: any, index: number) => {
443
+ return (
444
+ <List
445
+ key={`bank-id-${index}`}
446
+ onPress={() => handleSelectBank(bank)}
447
+ >
448
+ <ListGroup>
449
+ {bank.logo && <BankLogo source={{ uri: bank.logo }} />}
450
+ <ListText>{bank.InstitutionName}</ListText>
451
+ </ListGroup>
452
+ <Ionicons
453
+ name="chevron-forward"
454
+ size={20}
455
+ color="#1f2937"
456
+ />
457
+ </List>
458
+ );
459
+ })}
337
460
  </SheetScrollView>
338
- </AnimatedBottomSheet>
461
+ </AnimatedBottomSheet>
339
462
  )}
340
-
341
463
  </Container>
342
464
  );
343
465
  }
344
-
345
-
@@ -19,6 +19,18 @@ export const S = { xs: 4, sm: 8, md: 16, lg: 24, xl: 32, xxl: 48 };
19
19
  export const F = { xs: 11, sm: 13, md: 15, lg: 17, xl: 20, xxl: 24, hero: 32 };
20
20
 
21
21
  export const shadow = {
22
- sm: { shadowColor: '#0B1D35', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.07, shadowRadius: 6, elevation: 2 },
23
- lg: { shadowColor: '#0B1D35', shadowOffset: { width: 0, height: 8 }, shadowOpacity: 0.12, shadowRadius: 20, elevation: 8 },
22
+ sm: {
23
+ shadowColor: '#0B1D35',
24
+ shadowOffset: { width: 0, height: 2 },
25
+ shadowOpacity: 0.07,
26
+ shadowRadius: 6,
27
+ elevation: 2,
28
+ },
29
+ lg: {
30
+ shadowColor: '#0B1D35',
31
+ shadowOffset: { width: 0, height: 8 },
32
+ shadowOpacity: 0.12,
33
+ shadowRadius: 20,
34
+ elevation: 8,
35
+ },
24
36
  };