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.
- package/lib/module/FountainPayProvider.js +108 -18
- package/lib/module/FountainPayProvider.js.map +1 -1
- package/lib/module/core/api/client.js +13 -1
- package/lib/module/core/api/client.js.map +1 -1
- package/lib/module/core/api/index.js +66 -24
- package/lib/module/core/api/index.js.map +1 -1
- package/lib/module/engine/BLEReceiverService.js.map +1 -1
- package/lib/module/engine/BLESenderService.js.map +1 -1
- package/lib/module/engine/FPEngine.js +164 -43
- package/lib/module/engine/FPEngine.js.map +1 -1
- package/lib/module/engine/NearbyUsersService.js +1 -1
- package/lib/module/engine/NearbyUsersService.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/store/FPStore.js +155 -0
- package/lib/module/store/FPStore.js.map +1 -0
- package/lib/module/ui/components/AnimatedDots.js +3 -3
- package/lib/module/ui/components/AnimatedDots.js.map +1 -1
- package/lib/module/ui/components/ConfirmScreen.js +137 -123
- package/lib/module/ui/components/ConfirmScreen.js.map +1 -1
- package/lib/module/ui/components/FPButton.js.map +1 -1
- package/lib/module/ui/components/LoadingAnimation/InLoading.js +3 -3
- package/lib/module/ui/components/LoadingAnimation/InLoading.js.map +1 -1
- package/lib/module/ui/components/LoadingAnimation/index.js +3 -3
- package/lib/module/ui/components/LoadingAnimation/index.js.map +1 -1
- package/lib/module/ui/components/OtpInput/OTPInputView.js +11 -11
- package/lib/module/ui/components/OtpInput/OTPInputView.js.map +1 -1
- package/lib/module/ui/components/OtpInput/Styles.js +1 -1
- package/lib/module/ui/components/OtpInput/helpers/codeToArray.js +1 -1
- package/lib/module/ui/components/OtpInput/helpers/device.js.map +1 -1
- package/lib/module/ui/components/OtpInput/helpers/styles.js.map +1 -1
- package/lib/module/ui/components/OtpInput/index.js +3 -1
- package/lib/module/ui/components/OtpInput/index.js.map +1 -1
- package/lib/module/ui/components/PulseAnimation.js +2 -2
- package/lib/module/ui/components/PulseAnimation.js.map +1 -1
- package/lib/module/ui/modals/FPPaymentRequestModal.js +8 -7
- package/lib/module/ui/modals/FPPaymentRequestModal.js.map +1 -1
- package/lib/module/ui/modals/FPShell.js +2 -0
- package/lib/module/ui/modals/FPShell.js.map +1 -1
- package/lib/module/ui/screens/ReceiveScreen.js +8 -9
- package/lib/module/ui/screens/ReceiveScreen.js.map +1 -1
- package/lib/module/ui/screens/SendScreen.js +43 -94
- package/lib/module/ui/screens/SendScreen.js.map +1 -1
- package/lib/module/ui/screens/styles.js +15 -3
- package/lib/module/ui/screens/styles.js.map +1 -1
- package/lib/module/ui/screens/sub/receivePayment/Nfc/index.js +4 -4
- package/lib/module/ui/screens/sub/receivePayment/Nfc/index.js.map +1 -1
- package/lib/module/ui/screens/sub/receivePayment/Qr/index.js +5 -5
- package/lib/module/ui/screens/sub/receivePayment/Qr/index.js.map +1 -1
- package/lib/module/ui/screens/sub/receivePayment/Transfer/index.js +10 -11
- package/lib/module/ui/screens/sub/receivePayment/Transfer/index.js.map +1 -1
- package/lib/module/ui/screens/sub/sendPayment/BluetoothSubScreen.js +31 -8
- package/lib/module/ui/screens/sub/sendPayment/BluetoothSubScreen.js.map +1 -1
- package/lib/module/ui/screens/sub/sendPayment/NFCSubScreen.js +12 -8
- package/lib/module/ui/screens/sub/sendPayment/NFCSubScreen.js.map +1 -1
- package/lib/module/ui/screens/sub/sendPayment/NQRSubScreen.js +17 -5
- package/lib/module/ui/screens/sub/sendPayment/NQRSubScreen.js.map +1 -1
- package/lib/module/ui/screens/sub/sendPayment/ProximitySubScreen.js +67 -35
- package/lib/module/ui/screens/sub/sendPayment/ProximitySubScreen.js.map +1 -1
- package/lib/module/ui/screens/sub/sendPayment/TransferSubScreen.js +110 -34
- package/lib/module/ui/screens/sub/sendPayment/TransferSubScreen.js.map +1 -1
- package/lib/module/ui/theme/index.js.map +1 -1
- package/lib/typescript/src/FountainPayProvider.d.ts +1 -1
- package/lib/typescript/src/FountainPayProvider.d.ts.map +1 -1
- package/lib/typescript/src/core/api/client.d.ts.map +1 -1
- package/lib/typescript/src/core/api/index.d.ts +42 -26
- package/lib/typescript/src/core/api/index.d.ts.map +1 -1
- package/lib/typescript/src/core/types/index.d.ts +53 -28
- package/lib/typescript/src/core/types/index.d.ts.map +1 -1
- package/lib/typescript/src/engine/BLEReceiverService.d.ts +2 -0
- package/lib/typescript/src/engine/BLEReceiverService.d.ts.map +1 -1
- package/lib/typescript/src/engine/BLESenderService.d.ts.map +1 -1
- package/lib/typescript/src/engine/FPEngine.d.ts +5 -3
- package/lib/typescript/src/engine/FPEngine.d.ts.map +1 -1
- package/lib/typescript/src/engine/useIsForeground.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/store/FPStore.d.ts +60 -0
- package/lib/typescript/src/store/FPStore.d.ts.map +1 -0
- package/lib/typescript/src/ui/components/AnimatedDots.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/ConfirmScreen.d.ts +5 -5
- package/lib/typescript/src/ui/components/ConfirmScreen.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/FPButton.d.ts +1 -1
- package/lib/typescript/src/ui/components/FPButton.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/LoadingAnimation/InLoading.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/LoadingAnimation/index.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/OtpInput/OTPInputView.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/OtpInput/helpers/codeToArray.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/OtpInput/helpers/device.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/OtpInput/helpers/styles.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/OtpInput/helpers/types.d.ts +1 -2
- package/lib/typescript/src/ui/components/OtpInput/helpers/types.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/OtpInput/index.d.ts +3 -1
- package/lib/typescript/src/ui/components/OtpInput/index.d.ts.map +1 -1
- package/lib/typescript/src/ui/components/PulseAnimation.d.ts.map +1 -1
- package/lib/typescript/src/ui/modals/FPPaymentRequestModal.d.ts.map +1 -1
- package/lib/typescript/src/ui/modals/FPShell.d.ts.map +1 -1
- package/lib/typescript/src/ui/screens/ReceiveScreen.d.ts +1 -1
- package/lib/typescript/src/ui/screens/ReceiveScreen.d.ts.map +1 -1
- package/lib/typescript/src/ui/screens/SendScreen.d.ts +1 -1
- package/lib/typescript/src/ui/screens/SendScreen.d.ts.map +1 -1
- package/lib/typescript/src/ui/screens/styles.d.ts +197 -0
- package/lib/typescript/src/ui/screens/styles.d.ts.map +1 -1
- package/lib/typescript/src/ui/screens/sub/receivePayment/Nfc/index.d.ts.map +1 -1
- package/lib/typescript/src/ui/screens/sub/receivePayment/Qr/index.d.ts.map +1 -1
- package/lib/typescript/src/ui/screens/sub/receivePayment/Transfer/index.d.ts.map +1 -1
- package/lib/typescript/src/ui/screens/sub/sendPayment/BluetoothSubScreen.d.ts.map +1 -1
- package/lib/typescript/src/ui/screens/sub/sendPayment/NFCSubScreen.d.ts +1 -1
- package/lib/typescript/src/ui/screens/sub/sendPayment/NFCSubScreen.d.ts.map +1 -1
- package/lib/typescript/src/ui/screens/sub/sendPayment/NQRSubScreen.d.ts +1 -1
- package/lib/typescript/src/ui/screens/sub/sendPayment/NQRSubScreen.d.ts.map +1 -1
- package/lib/typescript/src/ui/screens/sub/sendPayment/ProximitySubScreen.d.ts +1 -1
- package/lib/typescript/src/ui/screens/sub/sendPayment/ProximitySubScreen.d.ts.map +1 -1
- package/lib/typescript/src/ui/screens/sub/sendPayment/TransferSubScreen.d.ts +1 -1
- package/lib/typescript/src/ui/screens/sub/sendPayment/TransferSubScreen.d.ts.map +1 -1
- package/lib/typescript/src/ui/theme/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/FountainPayProvider.tsx +163 -24
- package/src/core/api/client.ts +26 -4
- package/src/core/api/index.ts +170 -49
- package/src/core/types/index.ts +81 -48
- package/src/engine/BLEReceiverService.ts +86 -28
- package/src/engine/BLESenderService.ts +133 -69
- package/src/engine/FPEngine.ts +316 -97
- package/src/engine/NearbyUsersService.ts +6 -6
- package/src/engine/useIsForeground.ts +12 -12
- package/src/index.ts +10 -4
- package/src/store/FPStore.ts +216 -0
- package/src/ui/components/AnimatedDots.tsx +4 -5
- package/src/ui/components/ConfirmScreen.tsx +182 -169
- package/src/ui/components/FPButton.tsx +50 -9
- package/src/ui/components/LoadingAnimation/InLoading.tsx +23 -27
- package/src/ui/components/LoadingAnimation/index.tsx +3 -7
- package/src/ui/components/OtpInput/OTPInputView.tsx +254 -205
- package/src/ui/components/OtpInput/Styles.ts +1 -1
- package/src/ui/components/OtpInput/helpers/codeToArray.ts +2 -2
- package/src/ui/components/OtpInput/helpers/device.ts +4 -3
- package/src/ui/components/OtpInput/helpers/styles.ts +13 -14
- package/src/ui/components/OtpInput/helpers/types.ts +83 -79
- package/src/ui/components/OtpInput/index.tsx +18 -15
- package/src/ui/components/PulseAnimation.tsx +3 -5
- package/src/ui/modals/FPPaymentRequestModal.tsx +111 -28
- package/src/ui/modals/FPShell.tsx +60 -34
- package/src/ui/screens/ReceiveScreen.tsx +245 -84
- package/src/ui/screens/SendScreen.tsx +419 -167
- package/src/ui/screens/styles.ts +17 -5
- package/src/ui/screens/sub/receivePayment/Nfc/index.tsx +17 -25
- package/src/ui/screens/sub/receivePayment/Qr/index.tsx +21 -20
- package/src/ui/screens/sub/receivePayment/Transfer/index.tsx +34 -28
- package/src/ui/screens/sub/sendPayment/BluetoothSubScreen.tsx +135 -67
- package/src/ui/screens/sub/sendPayment/NFCSubScreen.tsx +188 -112
- package/src/ui/screens/sub/sendPayment/NQRSubScreen.tsx +102 -69
- package/src/ui/screens/sub/sendPayment/ProximitySubScreen.tsx +225 -99
- package/src/ui/screens/sub/sendPayment/TransferSubScreen.tsx +209 -89
- package/src/ui/theme/index.ts +14 -2
|
@@ -1,13 +1,43 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import {
|
|
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 {
|
|
5
|
-
|
|
6
|
-
|
|
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 {
|
|
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({
|
|
154
|
-
|
|
155
|
-
|
|
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 (!
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
|
|
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
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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.
|
|
310
|
+
bank.InstitutionName.toLowerCase().includes(query)
|
|
236
311
|
);
|
|
237
312
|
|
|
238
313
|
setFilteredBanks(filtered);
|
|
239
314
|
}, [searchStr, banks]);
|
|
240
315
|
|
|
241
|
-
|
|
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' }}>
|
|
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
|
-
<
|
|
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=
|
|
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
|
-
<
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
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 &&
|
|
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
|
|
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
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
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 &&
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
<
|
|
333
|
-
|
|
334
|
-
|
|
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
|
-
|
package/src/ui/theme/index.ts
CHANGED
|
@@ -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: {
|
|
23
|
-
|
|
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
|
};
|