react-native-fpay 0.2.9 → 0.3.2
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 +5 -1
- package/lib/module/FountainPayProvider.js.map +1 -1
- package/lib/module/core/api/index.js +22 -12
- package/lib/module/core/api/index.js.map +1 -1
- package/lib/module/engine/BLEReceiverService.js.map +1 -1
- package/lib/module/engine/FPEngine.js +24 -13
- package/lib/module/engine/FPEngine.js.map +1 -1
- package/lib/module/engine/useIsForeground.js +17 -0
- package/lib/module/engine/useIsForeground.js.map +1 -0
- package/lib/module/ui/components/AnimatedDots.js +68 -0
- package/lib/module/ui/components/AnimatedDots.js.map +1 -0
- package/lib/module/ui/components/ConfirmScreen.js +333 -0
- package/lib/module/ui/components/ConfirmScreen.js.map +1 -0
- package/lib/module/ui/modals/FPPaymentRequestModal.js +6 -8
- package/lib/module/ui/modals/FPPaymentRequestModal.js.map +1 -1
- package/lib/module/ui/modals/FPShell.js +7 -4
- package/lib/module/ui/modals/FPShell.js.map +1 -1
- package/lib/module/ui/screens/ReceiveScreen.js +379 -274
- package/lib/module/ui/screens/ReceiveScreen.js.map +1 -1
- package/lib/module/ui/screens/SendScreen.js +154 -45
- package/lib/module/ui/screens/SendScreen.js.map +1 -1
- package/lib/module/ui/screens/styles.js +89 -0
- package/lib/module/ui/screens/styles.js.map +1 -0
- package/lib/module/ui/screens/sub/receivePayment/Nfc/index.js +361 -0
- package/lib/module/ui/screens/sub/receivePayment/Nfc/index.js.map +1 -0
- package/lib/module/ui/screens/sub/receivePayment/Qr/index.js +338 -0
- package/lib/module/ui/screens/sub/receivePayment/Qr/index.js.map +1 -0
- package/lib/module/ui/screens/sub/receivePayment/Transfer/index.js +453 -0
- package/lib/module/ui/screens/sub/receivePayment/Transfer/index.js.map +1 -0
- package/lib/module/ui/screens/sub/{BluetoothSubScreen.js → sendPayment/BluetoothSubScreen.js} +25 -32
- package/lib/module/ui/screens/sub/sendPayment/BluetoothSubScreen.js.map +1 -0
- package/lib/module/ui/screens/sub/sendPayment/NFCSubScreen.js +354 -0
- package/lib/module/ui/screens/sub/sendPayment/NFCSubScreen.js.map +1 -0
- package/lib/module/ui/screens/sub/sendPayment/NQRSubScreen.js +440 -0
- package/lib/module/ui/screens/sub/sendPayment/NQRSubScreen.js.map +1 -0
- package/lib/module/ui/screens/sub/{ProximitySubScreen.js → sendPayment/ProximitySubScreen.js} +20 -111
- package/lib/module/ui/screens/sub/sendPayment/ProximitySubScreen.js.map +1 -0
- package/lib/module/ui/screens/sub/sendPayment/TransferSubScreen.js +327 -0
- package/lib/module/ui/screens/sub/sendPayment/TransferSubScreen.js.map +1 -0
- package/lib/typescript/src/FountainPayProvider.d.ts.map +1 -1
- package/lib/typescript/src/core/api/index.d.ts +20 -27
- package/lib/typescript/src/core/api/index.d.ts.map +1 -1
- package/lib/typescript/src/core/types/index.d.ts +56 -13
- 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/FPEngine.d.ts +3 -1
- package/lib/typescript/src/engine/FPEngine.d.ts.map +1 -1
- package/lib/typescript/src/engine/useIsForeground.d.ts +2 -0
- package/lib/typescript/src/engine/useIsForeground.d.ts.map +1 -0
- package/lib/typescript/src/ui/components/AnimatedDots.d.ts +2 -0
- package/lib/typescript/src/ui/components/AnimatedDots.d.ts.map +1 -0
- package/lib/typescript/src/ui/components/ConfirmScreen.d.ts +10 -0
- package/lib/typescript/src/ui/components/ConfirmScreen.d.ts.map +1 -0
- package/lib/typescript/src/ui/components/OtpInput/Styles.d.ts +3 -3
- 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 +2 -9
- package/lib/typescript/src/ui/screens/ReceiveScreen.d.ts.map +1 -1
- package/lib/typescript/src/ui/screens/SendScreen.d.ts +4 -2
- package/lib/typescript/src/ui/screens/SendScreen.d.ts.map +1 -1
- package/lib/typescript/src/ui/screens/styles.d.ts +1390 -0
- package/lib/typescript/src/ui/screens/styles.d.ts.map +1 -0
- package/lib/typescript/src/ui/screens/sub/receivePayment/Nfc/index.d.ts +10 -0
- package/lib/typescript/src/ui/screens/sub/receivePayment/Nfc/index.d.ts.map +1 -0
- package/lib/typescript/src/ui/screens/sub/receivePayment/Qr/index.d.ts +10 -0
- package/lib/typescript/src/ui/screens/sub/receivePayment/Qr/index.d.ts.map +1 -0
- package/lib/typescript/src/ui/screens/sub/receivePayment/Transfer/index.d.ts +5 -0
- package/lib/typescript/src/ui/screens/sub/receivePayment/Transfer/index.d.ts.map +1 -0
- package/lib/typescript/src/ui/screens/sub/{BluetoothSubScreen.d.ts → sendPayment/BluetoothSubScreen.d.ts} +2 -11
- package/lib/typescript/src/ui/screens/sub/sendPayment/BluetoothSubScreen.d.ts.map +1 -0
- package/lib/typescript/src/ui/screens/sub/sendPayment/NFCSubScreen.d.ts +3 -0
- package/lib/typescript/src/ui/screens/sub/sendPayment/NFCSubScreen.d.ts.map +1 -0
- package/lib/typescript/src/ui/screens/sub/sendPayment/NQRSubScreen.d.ts +3 -0
- package/lib/typescript/src/ui/screens/sub/sendPayment/NQRSubScreen.d.ts.map +1 -0
- package/lib/typescript/src/ui/screens/sub/{ProximitySubScreen.d.ts → sendPayment/ProximitySubScreen.d.ts} +2 -10
- package/lib/typescript/src/ui/screens/sub/sendPayment/ProximitySubScreen.d.ts.map +1 -0
- package/lib/typescript/src/ui/screens/sub/sendPayment/TransferSubScreen.d.ts +3 -0
- package/lib/typescript/src/ui/screens/sub/sendPayment/TransferSubScreen.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/FountainPayProvider.tsx +7 -1
- package/src/core/api/index.ts +34 -19
- package/src/core/types/index.ts +67 -13
- package/src/engine/BLEReceiverService.ts +2 -0
- package/src/engine/FPEngine.ts +29 -14
- package/src/engine/useIsForeground.ts +18 -0
- package/src/ui/components/AnimatedDots.tsx +81 -0
- package/src/ui/components/ConfirmScreen.tsx +421 -0
- package/src/ui/modals/FPPaymentRequestModal.tsx +7 -6
- package/src/ui/modals/FPShell.tsx +9 -9
- package/src/ui/screens/ReceiveScreen.tsx +266 -115
- package/src/ui/screens/SendScreen.tsx +141 -19
- package/src/ui/screens/styles.ts +101 -0
- package/src/ui/screens/sub/receivePayment/Nfc/index.tsx +418 -0
- package/src/ui/screens/sub/receivePayment/Qr/index.tsx +391 -0
- package/src/ui/screens/sub/receivePayment/Transfer/index.tsx +512 -0
- package/src/ui/screens/sub/{BluetoothSubScreen.tsx → sendPayment/BluetoothSubScreen.tsx} +27 -46
- package/src/ui/screens/sub/sendPayment/NFCSubScreen.tsx +302 -0
- package/src/ui/screens/sub/sendPayment/NQRSubScreen.tsx +490 -0
- package/src/ui/screens/sub/{ProximitySubScreen.tsx → sendPayment/ProximitySubScreen.tsx} +24 -44
- package/src/ui/screens/sub/sendPayment/TransferSubScreen.tsx +345 -0
- package/lib/module/ui/screens/sub/BluetoothSubScreen.js.map +0 -1
- package/lib/module/ui/screens/sub/NFCSubScreen.js +0 -164
- package/lib/module/ui/screens/sub/NFCSubScreen.js.map +0 -1
- package/lib/module/ui/screens/sub/NQRSubScreen.js +0 -131
- package/lib/module/ui/screens/sub/NQRSubScreen.js.map +0 -1
- package/lib/module/ui/screens/sub/ProximitySubScreen.js.map +0 -1
- package/lib/module/ui/screens/sub/TransferSubScreen.js +0 -353
- package/lib/module/ui/screens/sub/TransferSubScreen.js.map +0 -1
- package/lib/typescript/src/ui/screens/sub/BluetoothSubScreen.d.ts.map +0 -1
- package/lib/typescript/src/ui/screens/sub/NFCSubScreen.d.ts +0 -18
- package/lib/typescript/src/ui/screens/sub/NFCSubScreen.d.ts.map +0 -1
- package/lib/typescript/src/ui/screens/sub/NQRSubScreen.d.ts +0 -12
- package/lib/typescript/src/ui/screens/sub/NQRSubScreen.d.ts.map +0 -1
- package/lib/typescript/src/ui/screens/sub/ProximitySubScreen.d.ts.map +0 -1
- package/lib/typescript/src/ui/screens/sub/TransferSubScreen.d.ts +0 -11
- package/lib/typescript/src/ui/screens/sub/TransferSubScreen.d.ts.map +0 -1
- package/src/ui/screens/sub/NFCSubScreen.tsx +0 -86
- package/src/ui/screens/sub/NQRSubScreen.tsx +0 -62
- package/src/ui/screens/sub/TransferSubScreen.tsx +0 -147
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { View, Text, TextInput, FlatList, TouchableOpacity, StyleSheet, ActivityIndicator, ScrollView, Animated, Dimensions, Easing, Pressable } from 'react-native';
|
|
3
|
+
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';
|
|
7
|
+
import styled from 'styled-components/native';
|
|
8
|
+
import Ionicons from 'react-native-vector-icons/Ionicons';
|
|
9
|
+
import { AnimatedDots } from '../../../components/AnimatedDots';
|
|
10
|
+
import { ButtonContainer, ContentContainer, CTAButton, CTAText, HomeIndicator, InputBox, InputContainer, Label, List, ListText, StyledTextInput } from '../../styles';
|
|
11
|
+
|
|
12
|
+
type Step = 'bank' | 'account' | 'confirm' | 'processing' | 'done';
|
|
13
|
+
const { width, height } = Dimensions.get('window');
|
|
14
|
+
|
|
15
|
+
const Container = styled(View)`
|
|
16
|
+
flex: 1;
|
|
17
|
+
background-color: #000000;
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
const FormContainer = styled(View)`
|
|
21
|
+
flex: 1;
|
|
22
|
+
margin-top: 100px;
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const Header = styled(View)`
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
padding: 12px 16px;
|
|
30
|
+
position: absolute !important;
|
|
31
|
+
top: 40px;
|
|
32
|
+
left: 0;
|
|
33
|
+
right: 0;
|
|
34
|
+
z-index: 10;
|
|
35
|
+
elevation: 4;
|
|
36
|
+
shadow-color: #000;
|
|
37
|
+
shadow-offset: 0px 2px;
|
|
38
|
+
shadow-opacity: 0.1;
|
|
39
|
+
shadow-radius: 4px;
|
|
40
|
+
z-index: 9999999999 !important;
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
const HeaderButton = styled(TouchableOpacity)`
|
|
44
|
+
padding: 8px;
|
|
45
|
+
background-color: #fff;
|
|
46
|
+
width: 40px;
|
|
47
|
+
height: 40px;
|
|
48
|
+
border-radius: 50%;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
align-items: center;
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
const HeaderCenter = styled(View)`
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: 8px;
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
const HeaderRight = styled(View)`
|
|
60
|
+
flex-direction: row;
|
|
61
|
+
align-items: center;
|
|
62
|
+
gap: 8px;
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
const BottomSheet = styled(View)`
|
|
68
|
+
position: absolute;
|
|
69
|
+
bottom: 0;
|
|
70
|
+
left: 0;
|
|
71
|
+
right: 0;
|
|
72
|
+
background-color: #ffffff;
|
|
73
|
+
border-top-left-radius: 24px;
|
|
74
|
+
border-top-right-radius: 24px;
|
|
75
|
+
padding: 20px 20px 32px;
|
|
76
|
+
elevation: 20;
|
|
77
|
+
shadow-color: #000;
|
|
78
|
+
shadow-offset: 0px -4px;
|
|
79
|
+
shadow-opacity: 0.15;
|
|
80
|
+
shadow-radius: 12px;
|
|
81
|
+
height: ${height * 0.9}px;
|
|
82
|
+
z-index: 9999999999 !important;
|
|
83
|
+
`;
|
|
84
|
+
|
|
85
|
+
const AnimatedBottomSheet = styled(Animated.View)`
|
|
86
|
+
position: absolute;
|
|
87
|
+
bottom: 0;
|
|
88
|
+
left: 0;
|
|
89
|
+
right: 0;
|
|
90
|
+
background-color: #ffffff;
|
|
91
|
+
border-top-left-radius: 24px;
|
|
92
|
+
border-top-right-radius: 24px;
|
|
93
|
+
padding: 20px 20px 32px;
|
|
94
|
+
shadow-color: #000;
|
|
95
|
+
shadow-offset: 0px -4px;
|
|
96
|
+
shadow-opacity: 0.15;
|
|
97
|
+
shadow-radius: 12px;
|
|
98
|
+
height: ${height * 0.9}px;
|
|
99
|
+
z-index: 9999999999 !important;
|
|
100
|
+
`;
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
const SheetHeader = styled(View)`
|
|
104
|
+
flex-direction: row;
|
|
105
|
+
justify-content: flex-end;
|
|
106
|
+
align-items: center;
|
|
107
|
+
gap: 40%;
|
|
108
|
+
margin-bottom: 12px;
|
|
109
|
+
`;
|
|
110
|
+
|
|
111
|
+
const SheetHandle = styled(View)`
|
|
112
|
+
width: 40px;
|
|
113
|
+
height: 4px;
|
|
114
|
+
background-color: #d1d5db;
|
|
115
|
+
border-radius: 2px;
|
|
116
|
+
align-self: center;
|
|
117
|
+
margin-bottom: 20px;
|
|
118
|
+
`;
|
|
119
|
+
|
|
120
|
+
const SheetScrollView = styled(ScrollView)`
|
|
121
|
+
flex: 1;
|
|
122
|
+
`;
|
|
123
|
+
|
|
124
|
+
const SectionTitle = styled(Text)`
|
|
125
|
+
font-size: 18px;
|
|
126
|
+
font-weight: 700;
|
|
127
|
+
color: #1f2937;
|
|
128
|
+
margin-bottom: 16px;
|
|
129
|
+
`;
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
const SearchContainer = styled(View)`
|
|
134
|
+
flex-direction: row;
|
|
135
|
+
align-items: center;
|
|
136
|
+
background-color: #f9fafb;
|
|
137
|
+
border-radius: 12px;
|
|
138
|
+
padding: 14px 16px;
|
|
139
|
+
margin-bottom: 24px;
|
|
140
|
+
border: 1px solid #e5e7eb;
|
|
141
|
+
`;
|
|
142
|
+
|
|
143
|
+
const SearchInput = styled(TextInput)`
|
|
144
|
+
flex: 1;
|
|
145
|
+
margin-left: 10px;
|
|
146
|
+
font-size: 14px;
|
|
147
|
+
color: #1f2937;
|
|
148
|
+
padding: 0;
|
|
149
|
+
`;
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
export function TransferSubScreen({ amount, currency, onClose, onProcessTransaction, onError }: Props) {
|
|
154
|
+
const [searchStr, setSearchStr] = useState<string>("");
|
|
155
|
+
const [accountNumber, setAccountNumber] = useState<string>("");
|
|
156
|
+
const [bank, setBank] = useState<any>({});
|
|
157
|
+
const [accountDetail, setAccountDetail] = useState<any>({});
|
|
158
|
+
|
|
159
|
+
const [isVerifying, setIsVerifying] = useState<boolean>(false);
|
|
160
|
+
|
|
161
|
+
const [showBankList, setShowBankList] = useState<boolean>(false);
|
|
162
|
+
|
|
163
|
+
const [banks, setBanks] = useState<any>([])
|
|
164
|
+
const [filteredBanks, setFilteredBanks] = useState<any>([]);
|
|
165
|
+
const slideAnim = React.useRef(new Animated.Value(height)).current;
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
const openSheet = () => {
|
|
169
|
+
setShowBankList(true);
|
|
170
|
+
Animated.timing(slideAnim, {
|
|
171
|
+
toValue: 0,
|
|
172
|
+
duration: 300,
|
|
173
|
+
easing: Easing.bezier(0.25, 0.8, 0.25, 1),
|
|
174
|
+
useNativeDriver: true,
|
|
175
|
+
}).start();
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const closeSheet = () => {
|
|
179
|
+
Animated.timing(slideAnim, {
|
|
180
|
+
toValue: height,
|
|
181
|
+
duration: 250,
|
|
182
|
+
easing: Easing.bezier(0.25, 0.8, 0.25, 1),
|
|
183
|
+
useNativeDriver: true,
|
|
184
|
+
}).start(() => {
|
|
185
|
+
setShowBankList(false);
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
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
|
+
}
|
|
204
|
+
|
|
205
|
+
const handleSelectBank = (bank: any) => {
|
|
206
|
+
setBank(bank);
|
|
207
|
+
closeSheet();
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
useEffect(() => { transferAPI.getBanks().then(setBanks).catch(() => {}); }, []);
|
|
212
|
+
|
|
213
|
+
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
|
+
|
|
225
|
+
|
|
226
|
+
useEffect(() => {
|
|
227
|
+
const query = searchStr.trim().toLowerCase();
|
|
228
|
+
|
|
229
|
+
if (!query) {
|
|
230
|
+
setFilteredBanks(banks);
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const filtered = banks.filter((bank: any) =>
|
|
235
|
+
bank.name.toLowerCase().includes(query)
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
setFilteredBanks(filtered);
|
|
239
|
+
}, [searchStr, banks]);
|
|
240
|
+
|
|
241
|
+
return(
|
|
242
|
+
<Container>
|
|
243
|
+
{/* Header */}
|
|
244
|
+
<Header>
|
|
245
|
+
<HeaderButton onPress={onClose}>
|
|
246
|
+
<Ionicons name="close" size={24} />
|
|
247
|
+
</HeaderButton>
|
|
248
|
+
|
|
249
|
+
<HeaderCenter>
|
|
250
|
+
<Text style={{ fontWeight: 'bold', fontSize: 16, color:'#FFF' }}>Bank</Text>
|
|
251
|
+
<Text style={{ fontSize: 10, color: '#FFF' }}>Transfer</Text>
|
|
252
|
+
</HeaderCenter>
|
|
253
|
+
|
|
254
|
+
<HeaderRight>
|
|
255
|
+
|
|
256
|
+
</HeaderRight>
|
|
257
|
+
</Header>
|
|
258
|
+
<FormContainer>
|
|
259
|
+
<InputContainer>
|
|
260
|
+
<Label>Account Details</Label>
|
|
261
|
+
<InputBox>
|
|
262
|
+
<StyledTextInput
|
|
263
|
+
placeholder="Enter account number"
|
|
264
|
+
placeholderTextColor="#d1d5db"
|
|
265
|
+
value={accountNumber}
|
|
266
|
+
keyboardType="number-pad"
|
|
267
|
+
maxLength={10}
|
|
268
|
+
onChangeText={(text) => {
|
|
269
|
+
// remove anything that is not a number
|
|
270
|
+
const numericText = text.replace(/[^0-9]/g, '');
|
|
271
|
+
setAccountNumber(numericText);
|
|
272
|
+
}}
|
|
273
|
+
/>
|
|
274
|
+
|
|
275
|
+
</InputBox>
|
|
276
|
+
</InputContainer>
|
|
277
|
+
|
|
278
|
+
<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}}>
|
|
290
|
+
{isVerifying && <AnimatedDots />}
|
|
291
|
+
{!isVerifying && accountDetail && <Label>{accountDetail.name?.toUpperCase()}</Label>}
|
|
292
|
+
</View>
|
|
293
|
+
|
|
294
|
+
</InputContainer>
|
|
295
|
+
<HomeIndicator />
|
|
296
|
+
<ContentContainer>
|
|
297
|
+
<ButtonContainer>
|
|
298
|
+
<CTAButton activeOpacity={0.8} disabled={!accountDetail || !accountDetail.name} onPress={handleSend}>
|
|
299
|
+
<CTAText>Send</CTAText>
|
|
300
|
+
</CTAButton>
|
|
301
|
+
</ButtonContainer>
|
|
302
|
+
</ContentContainer>
|
|
303
|
+
|
|
304
|
+
</FormContainer>
|
|
305
|
+
{showBankList && (
|
|
306
|
+
<AnimatedBottomSheet
|
|
307
|
+
style={{
|
|
308
|
+
transform: [{ translateY: slideAnim }],
|
|
309
|
+
}}
|
|
310
|
+
>
|
|
311
|
+
<SheetHeader>
|
|
312
|
+
<SheetHandle />
|
|
313
|
+
<Pressable onPress={() => setShowBankList(false)}>
|
|
314
|
+
<Ionicons name="close" size={22} />
|
|
315
|
+
</Pressable>
|
|
316
|
+
</SheetHeader>
|
|
317
|
+
|
|
318
|
+
<SheetScrollView showsVerticalScrollIndicator={false}>
|
|
319
|
+
<SearchContainer>
|
|
320
|
+
<Ionicons name="search" size={18} color="#9ca3af" />
|
|
321
|
+
<SearchInput
|
|
322
|
+
placeholder="Type a name or phone number to send"
|
|
323
|
+
placeholderTextColor="#9ca3af"
|
|
324
|
+
value={searchStr}
|
|
325
|
+
onChangeText={setSearchStr}
|
|
326
|
+
/>
|
|
327
|
+
</SearchContainer>
|
|
328
|
+
<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
|
+
})}
|
|
337
|
+
</SheetScrollView>
|
|
338
|
+
</AnimatedBottomSheet>
|
|
339
|
+
)}
|
|
340
|
+
|
|
341
|
+
</Container>
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","View","Text","TouchableOpacity","Alert","styled","Svg","Path","Ionicons","transferAPI","FPEngine","PulseAnimation","InLoading","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Container","Header","HeaderButton","HeaderCenter","HeaderRight","QuickLinksContainer","QuickLinksContainerWithDevices","QuickLinksIcon","QuickLinksText","DeviceCard","DeviceInfo","DeviceName","DeviceSignal","PayButton","PayButtonText","ScrollContainer","ScrollView","ContentContainer","BluetoothIconContainer","BluetoothIcon","color","size","width","height","strokeWidth","viewBox","fill","children","d","stroke","strokeLinecap","strokeLinejoin","fillRule","clipRule","BluetoothScanningIcon","PHASE_LABEL","idle","scanning","selected","requesting","transferring","done","declined","error","BluetoothSubScreen","mode","amount","currency","onDone","onSuccess","onError","devices","setDevices","setScanning","status","setStatus","currentDevice","setCurrentDevice","handleScan","scanForBluetoothDevices","device","prevDevices","exists","find","id","length","console","alert","handlePayment","userName","name","text","style","onPress","initiatePayment","user","getUser","deviceConnection","request","senderId","userId","accountNumber","senderName","accountName","timestamp","Date","now","log","response","sendBluetoothPaymentRequest","accepted","accountDetails","code","message","result","send","bankCode","narration","reference","transactionId","tx","type","channel","recipient","createdAt","fp","includes","fontWeight","fontSize","showsVerticalScrollIndicator","map","appName","rssi","activeOpacity"],"sourceRoot":"../../../../../src","sources":["ui/screens/sub/BluetoothSubScreen.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAeC,QAAQ,QAAQ,O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I;YAAA,CAEvC,CAAC,eACbzE,KAAA,CAACe,YAAY;cAAAe,QAAA,GAAC,UACJ,EAACiC,MAAM,CAACoD,IAAI,EAAC,MACvB;YAAA,CAAc,CAAC;UAAA,CACL,CAAC,EACZxD,aAAa,EAAEQ,EAAE,KAAKJ,MAAM,CAACI,EAAE,gBAC9BrE,IAAA,CAACF,SAAS;YAAC4B,IAAI,EAAE,EAAG;YAACkD,IAAI,EAAC;UAAE,CAAE,CAAC,gBAE/B5E,IAAA,CAACkB,SAAS;YACR4D,OAAO,EAAEA,CAAA,KAAML,aAAa,CAACR,MAAM,CAAE;YACrCqD,aAAa,EAAE,GAAI;YAAAtF,QAAA,eAEnBhC,IAAA,CAACmB,aAAa;cAAAa,QAAA,EAAC;YAAG,CAAe;UAAC,CACzB,CACZ;QAAA,GAnBciC,MAAM,CAACI,EAoBZ,CACb,CAAC;MAAA,CACc;IAAC,CAEJ,CAElB;EAAA,CACQ,CAAC;AAEhB","ignoreList":[]}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { useState } from 'react';
|
|
4
|
-
import { View, Text, StyleSheet } from 'react-native';
|
|
5
|
-
import NfcManager, { NfcTech, Ndef } from 'react-native-nfc-manager';
|
|
6
|
-
import { transferAPI } from "../../../core/api/index.js";
|
|
7
|
-
import { FPButton } from "../../components/FPButton.js";
|
|
8
|
-
import { C, R, S, F } from "../../theme/index.js";
|
|
9
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
export function NFCSubScreen({
|
|
11
|
-
mode,
|
|
12
|
-
amount,
|
|
13
|
-
currency = 'NGN',
|
|
14
|
-
myWallet,
|
|
15
|
-
onDone,
|
|
16
|
-
onSuccess,
|
|
17
|
-
onError
|
|
18
|
-
}) {
|
|
19
|
-
const [phase, setPhase] = useState('idle');
|
|
20
|
-
const [msg, setMsg] = useState('');
|
|
21
|
-
const tapToReceive = async () => {
|
|
22
|
-
if (!myWallet) return;
|
|
23
|
-
setPhase('active');
|
|
24
|
-
try {
|
|
25
|
-
await NfcManager.start();
|
|
26
|
-
await NfcManager.requestTechnology(NfcTech.Ndef);
|
|
27
|
-
const bytes = Ndef.encodeMessage([Ndef.textRecord(JSON.stringify(myWallet))]);
|
|
28
|
-
if (bytes) await NfcManager.ndefHandler.writeNdefMessage(bytes);
|
|
29
|
-
setPhase('success');
|
|
30
|
-
setMsg('Your payment details are now on the NFC tag.');
|
|
31
|
-
} catch (e) {
|
|
32
|
-
setPhase('error');
|
|
33
|
-
setMsg(e.message);
|
|
34
|
-
onError?.({
|
|
35
|
-
code: 'NFC_ERROR',
|
|
36
|
-
message: e.message
|
|
37
|
-
});
|
|
38
|
-
} finally {
|
|
39
|
-
NfcManager.cancelTechnologyRequest();
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
const tapToSend = async () => {
|
|
43
|
-
setPhase('active');
|
|
44
|
-
try {
|
|
45
|
-
await NfcManager.start();
|
|
46
|
-
await NfcManager.requestTechnology(NfcTech.Ndef);
|
|
47
|
-
const tag = await NfcManager.getTag();
|
|
48
|
-
if (!tag?.ndefMessage?.[0]?.payload) throw new Error('No wallet data on tag');
|
|
49
|
-
const payload = new Uint8Array(tag.ndefMessage[0].payload);
|
|
50
|
-
const text = Ndef.text.decodePayload(payload);
|
|
51
|
-
const wallet = JSON.parse(text);
|
|
52
|
-
const result = await transferAPI.send({
|
|
53
|
-
accountNumber: wallet.accountNumber,
|
|
54
|
-
bankCode: wallet.bankCode,
|
|
55
|
-
amount: (amount ?? 0) * 100,
|
|
56
|
-
narration: 'NFC payment'
|
|
57
|
-
});
|
|
58
|
-
onSuccess?.({
|
|
59
|
-
id: result.reference,
|
|
60
|
-
reference: result.reference,
|
|
61
|
-
type: 'debit',
|
|
62
|
-
channel: 'nfc',
|
|
63
|
-
amount: result.amount,
|
|
64
|
-
currency: result.currency,
|
|
65
|
-
status: result.status,
|
|
66
|
-
recipient: {
|
|
67
|
-
accountName: wallet.accountName
|
|
68
|
-
},
|
|
69
|
-
createdAt: result.createdAt
|
|
70
|
-
});
|
|
71
|
-
setPhase('success');
|
|
72
|
-
setMsg('Payment sent!');
|
|
73
|
-
} catch (e) {
|
|
74
|
-
setPhase('error');
|
|
75
|
-
setMsg(e.message);
|
|
76
|
-
onError?.({
|
|
77
|
-
code: 'NFC_ERROR',
|
|
78
|
-
message: e.message
|
|
79
|
-
});
|
|
80
|
-
} finally {
|
|
81
|
-
NfcManager.cancelTechnologyRequest();
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
85
|
-
style: st.wrap,
|
|
86
|
-
children: [/*#__PURE__*/_jsxs(Text, {
|
|
87
|
-
style: st.title,
|
|
88
|
-
children: ["NFC ", mode === 'send' ? 'Payment' : 'Receive']
|
|
89
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
90
|
-
style: [st.tapZone, phase === 'active' && st.tapActive, phase === 'success' && st.tapSuccess, phase === 'error' && st.tapError],
|
|
91
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
92
|
-
style: st.tapEmoji,
|
|
93
|
-
children: phase === 'success' ? 'OK' : phase === 'error' ? 'ERR' : 'NFC'
|
|
94
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
95
|
-
style: st.tapLabel,
|
|
96
|
-
children: phase === 'idle' ? mode === 'send' ? 'Tap to pay' : 'Tap to receive' : phase === 'active' ? 'Scanning...' : phase === 'success' ? 'Success!' : msg
|
|
97
|
-
})]
|
|
98
|
-
}), phase === 'idle' && /*#__PURE__*/_jsx(FPButton, {
|
|
99
|
-
label: mode === 'send' ? 'Start NFC Scan' : 'Write to NFC Tag',
|
|
100
|
-
onPress: mode === 'send' ? tapToSend : tapToReceive,
|
|
101
|
-
style: {
|
|
102
|
-
marginTop: S.md
|
|
103
|
-
}
|
|
104
|
-
}), phase === 'success' && /*#__PURE__*/_jsx(FPButton, {
|
|
105
|
-
label: "Done",
|
|
106
|
-
onPress: onDone,
|
|
107
|
-
style: {
|
|
108
|
-
marginTop: S.md
|
|
109
|
-
}
|
|
110
|
-
}), phase === 'error' && /*#__PURE__*/_jsx(FPButton, {
|
|
111
|
-
label: "Try Again",
|
|
112
|
-
onPress: () => setPhase('idle'),
|
|
113
|
-
style: {
|
|
114
|
-
marginTop: S.md
|
|
115
|
-
}
|
|
116
|
-
})]
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
const st = StyleSheet.create({
|
|
120
|
-
wrap: {
|
|
121
|
-
flex: 1,
|
|
122
|
-
padding: S.lg
|
|
123
|
-
},
|
|
124
|
-
back: {
|
|
125
|
-
color: C.brand,
|
|
126
|
-
fontSize: F.md,
|
|
127
|
-
fontWeight: '600',
|
|
128
|
-
marginBottom: S.md
|
|
129
|
-
},
|
|
130
|
-
title: {
|
|
131
|
-
fontSize: F.xl,
|
|
132
|
-
fontWeight: '800',
|
|
133
|
-
color: C.ink,
|
|
134
|
-
marginBottom: S.lg
|
|
135
|
-
},
|
|
136
|
-
tapZone: {
|
|
137
|
-
height: 180,
|
|
138
|
-
backgroundColor: C.ink,
|
|
139
|
-
borderRadius: R.xl,
|
|
140
|
-
justifyContent: 'center',
|
|
141
|
-
alignItems: 'center'
|
|
142
|
-
},
|
|
143
|
-
tapActive: {
|
|
144
|
-
backgroundColor: C.brand
|
|
145
|
-
},
|
|
146
|
-
tapSuccess: {
|
|
147
|
-
backgroundColor: C.green
|
|
148
|
-
},
|
|
149
|
-
tapError: {
|
|
150
|
-
backgroundColor: C.red
|
|
151
|
-
},
|
|
152
|
-
tapEmoji: {
|
|
153
|
-
fontSize: 40,
|
|
154
|
-
color: C.white,
|
|
155
|
-
fontWeight: '800',
|
|
156
|
-
marginBottom: S.sm
|
|
157
|
-
},
|
|
158
|
-
tapLabel: {
|
|
159
|
-
color: C.white,
|
|
160
|
-
fontSize: F.lg,
|
|
161
|
-
fontWeight: '700'
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
//# sourceMappingURL=NFCSubScreen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","View","Text","StyleSheet","NfcManager","NfcTech","Ndef","transferAPI","FPButton","C","R","S","F","jsxs","_jsxs","jsx","_jsx","NFCSubScreen","mode","amount","currency","myWallet","onDone","onSuccess","onError","phase","setPhase","msg","setMsg","tapToReceive","start","requestTechnology","bytes","encodeMessage","textRecord","JSON","stringify","ndefHandler","writeNdefMessage","e","message","code","cancelTechnologyRequest","tapToSend","tag","getTag","ndefMessage","payload","Error","Uint8Array","text","decodePayload","wallet","parse","result","send","accountNumber","bankCode","narration","id","reference","type","channel","status","recipient","accountName","createdAt","style","st","wrap","children","title","tapZone","tapActive","tapSuccess","tapError","tapEmoji","tapLabel","label","onPress","marginTop","md","create","flex","padding","lg","back","color","brand","fontSize","fontWeight","marginBottom","xl","ink","height","backgroundColor","borderRadius","justifyContent","alignItems","green","red","white","sm"],"sourceRoot":"../../../../../src","sources":["ui/screens/sub/NFCSubScreen.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,IAAI,EAAEC,IAAI,EAAEC,UAAU,QAA0B,cAAc;AACvE,OAAOC,UAAU,IAAIC,OAAO,EAAEC,IAAI,QAAQ,0BAA0B;AACpE,SAASC,WAAW,QAAQ,4BAAmB;AAC/C,SAASC,QAAQ,QAAQ,8BAA2B;AACpD,SAASC,CAAC,EAAEC,CAAC,EAAEC,CAAC,EAAEC,CAAC,QAAQ,sBAAa;AAAC,SAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAAC,IAAA;AAiBzC,OAAO,SAASC,YAAYA,CAAC;EAAEC,IAAI;EAAEC,MAAM;EAAEC,QAAQ,GAAG,KAAK;EAAEC,QAAQ;EAAEC,MAAM;EAAEC,SAAS;EAAEC;AAAe,CAAC,EAAE;EAC5G,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG1B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E;EAAM,CAAC;EACvCd,UAAU,EAAE;IAAEqB,eAAe,EAAEtF,CAAC,CAAC0F;EAAM,CAAC;EACxCxB,QAAQ,EAAE;IAAEoB,eAAe,EAAEtF,CAAC,CAAC2F;EAAI,CAAC;EACpCxB,QAAQ,EAAE;IAAEa,QAAQ,EAAE,EAAE;IAAEF,KAAK,EAAE9E,CAAC,CAAC4F,KAAK;IAAEX,UAAU,EAAE,KAAK;IAAEC,YAAY,EAAEhF,CAAC,CAAC2F;EAAG,CAAC;EACjFzB,QAAQ,EAAE;IAAEU,KAAK,EAAE9E,CAAC,CAAC4F,KAAK;IAAEZ,QAAQ,EAAE7E,CAAC,CAACyE,EAAE;IAAEK,UAAU,EAAE;EAAM;AAChE,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { useEffect, useState } from 'react';
|
|
4
|
-
import { View, Text, StyleSheet, ActivityIndicator, Image } from 'react-native';
|
|
5
|
-
import { nqrAPI } from "../../../core/api/index.js";
|
|
6
|
-
import { C, R, S, F, shadow } from "../../theme/index.js";
|
|
7
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
export function NQRSubScreen({
|
|
9
|
-
mode,
|
|
10
|
-
amount,
|
|
11
|
-
currency = 'NGN',
|
|
12
|
-
onDone,
|
|
13
|
-
onError
|
|
14
|
-
}) {
|
|
15
|
-
const [qr, setQr] = useState(null);
|
|
16
|
-
const [loading, setLoading] = useState(false);
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (mode === 'receive') {
|
|
19
|
-
setLoading(true);
|
|
20
|
-
nqrAPI.generate({
|
|
21
|
-
amount: amount ? amount * 100 : undefined,
|
|
22
|
-
currency
|
|
23
|
-
}).then(setQr).catch(e => onError?.(e)).finally(() => setLoading(false));
|
|
24
|
-
}
|
|
25
|
-
}, []);
|
|
26
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
27
|
-
style: st.wrap,
|
|
28
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
29
|
-
style: st.title,
|
|
30
|
-
children: mode === 'receive' ? 'Your QR Code' : 'Scan QR Code'
|
|
31
|
-
}), loading && /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
32
|
-
size: "large",
|
|
33
|
-
color: C.brand,
|
|
34
|
-
style: {
|
|
35
|
-
marginTop: S.xl
|
|
36
|
-
}
|
|
37
|
-
}), qr && /*#__PURE__*/_jsxs(View, {
|
|
38
|
-
style: st.qrCard,
|
|
39
|
-
children: [/*#__PURE__*/_jsx(Image, {
|
|
40
|
-
source: {
|
|
41
|
-
uri: 'data:image/png;base64,' + qr.qrCodeImageBase64
|
|
42
|
-
},
|
|
43
|
-
style: {
|
|
44
|
-
width: 200,
|
|
45
|
-
height: 200
|
|
46
|
-
}
|
|
47
|
-
}), amount && /*#__PURE__*/_jsxs(Text, {
|
|
48
|
-
style: st.amount,
|
|
49
|
-
children: [currency, " ", amount.toLocaleString('en-NG', {
|
|
50
|
-
minimumFractionDigits: 2
|
|
51
|
-
})]
|
|
52
|
-
}), /*#__PURE__*/_jsxs(Text, {
|
|
53
|
-
style: st.ref,
|
|
54
|
-
children: ["Ref: ", qr.reference]
|
|
55
|
-
}), qr.expiresAt && /*#__PURE__*/_jsxs(Text, {
|
|
56
|
-
style: st.expiry,
|
|
57
|
-
children: ["Expires: ", new Date(qr.expiresAt).toLocaleTimeString()]
|
|
58
|
-
})]
|
|
59
|
-
}), mode === 'send' && /*#__PURE__*/_jsxs(View, {
|
|
60
|
-
style: st.placeholder,
|
|
61
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
62
|
-
style: st.placeholderText,
|
|
63
|
-
children: "Camera scanner"
|
|
64
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
65
|
-
style: st.placeholderSub,
|
|
66
|
-
children: "Integrate your preferred camera/QR library here and pass the scanned qrString to nqrAPI.pay()"
|
|
67
|
-
})]
|
|
68
|
-
})]
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
const st = StyleSheet.create({
|
|
72
|
-
wrap: {
|
|
73
|
-
flex: 1,
|
|
74
|
-
padding: S.lg
|
|
75
|
-
},
|
|
76
|
-
back: {
|
|
77
|
-
color: C.brand,
|
|
78
|
-
fontSize: F.md,
|
|
79
|
-
fontWeight: '600',
|
|
80
|
-
marginBottom: S.md
|
|
81
|
-
},
|
|
82
|
-
title: {
|
|
83
|
-
fontSize: F.xl,
|
|
84
|
-
fontWeight: '800',
|
|
85
|
-
color: C.ink,
|
|
86
|
-
marginBottom: S.lg
|
|
87
|
-
},
|
|
88
|
-
qrCard: {
|
|
89
|
-
alignItems: 'center',
|
|
90
|
-
backgroundColor: C.white,
|
|
91
|
-
borderRadius: R.xl,
|
|
92
|
-
padding: S.xl,
|
|
93
|
-
...shadow.lg
|
|
94
|
-
},
|
|
95
|
-
amount: {
|
|
96
|
-
fontSize: F.xxl,
|
|
97
|
-
fontWeight: '800',
|
|
98
|
-
color: C.ink,
|
|
99
|
-
marginTop: S.md
|
|
100
|
-
},
|
|
101
|
-
ref: {
|
|
102
|
-
fontSize: F.sm,
|
|
103
|
-
color: C.muted,
|
|
104
|
-
marginTop: S.sm
|
|
105
|
-
},
|
|
106
|
-
expiry: {
|
|
107
|
-
fontSize: F.xs,
|
|
108
|
-
color: C.amber,
|
|
109
|
-
marginTop: 4
|
|
110
|
-
},
|
|
111
|
-
placeholder: {
|
|
112
|
-
flex: 1,
|
|
113
|
-
backgroundColor: C.ink,
|
|
114
|
-
borderRadius: R.xl,
|
|
115
|
-
justifyContent: 'center',
|
|
116
|
-
alignItems: 'center',
|
|
117
|
-
padding: S.xl
|
|
118
|
-
},
|
|
119
|
-
placeholderText: {
|
|
120
|
-
color: C.white,
|
|
121
|
-
fontSize: F.xl,
|
|
122
|
-
fontWeight: '700'
|
|
123
|
-
},
|
|
124
|
-
placeholderSub: {
|
|
125
|
-
color: C.ghost,
|
|
126
|
-
fontSize: F.sm,
|
|
127
|
-
textAlign: 'center',
|
|
128
|
-
marginTop: S.sm
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
//# sourceMappingURL=NQRSubScreen.js.map
|