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,338 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
4
|
+
import { Animated } from 'react-native';
|
|
5
|
+
import styled from 'styled-components/native';
|
|
6
|
+
import QRCode from 'react-native-qrcode-svg';
|
|
7
|
+
import Share from 'react-native-share';
|
|
8
|
+
import Ionicons from 'react-native-vector-icons/Ionicons';
|
|
9
|
+
import { AnimatedDots } from "../../../../components/AnimatedDots.js";
|
|
10
|
+
|
|
11
|
+
// Styled Components
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
const Container = styled.View`
|
|
14
|
+
flex: 1;
|
|
15
|
+
background-color: #f5f5f5;
|
|
16
|
+
padding-bottom: 60%;
|
|
17
|
+
`;
|
|
18
|
+
const Header = styled.View`
|
|
19
|
+
flex-direction: row;
|
|
20
|
+
align-items: center;
|
|
21
|
+
padding: 16px;
|
|
22
|
+
padding-top: 40px;
|
|
23
|
+
background-color: #ffffff;
|
|
24
|
+
border-bottom-width: 1px;
|
|
25
|
+
border-bottom-color: #e0e0e0;
|
|
26
|
+
`;
|
|
27
|
+
const BackButton = styled.TouchableOpacity`
|
|
28
|
+
padding: 8px;
|
|
29
|
+
`;
|
|
30
|
+
const BackIcon = styled.Text`
|
|
31
|
+
font-size: 24px;
|
|
32
|
+
color: #000000;
|
|
33
|
+
`;
|
|
34
|
+
const HeaderTitle = styled.Text`
|
|
35
|
+
flex: 1;
|
|
36
|
+
font-size: 18px;
|
|
37
|
+
font-weight: 600;
|
|
38
|
+
color: #000000;
|
|
39
|
+
text-align: center;
|
|
40
|
+
margin-right: 40px;
|
|
41
|
+
`;
|
|
42
|
+
const ScrollContainer = styled.ScrollView`
|
|
43
|
+
flex: 1;
|
|
44
|
+
`;
|
|
45
|
+
const ContentContainer = styled.View`
|
|
46
|
+
padding: 24px;
|
|
47
|
+
align-items: center;
|
|
48
|
+
`;
|
|
49
|
+
const AmountContainer = styled.View`
|
|
50
|
+
background-color: #ffffff;
|
|
51
|
+
border-radius: 16px;
|
|
52
|
+
padding: 24px;
|
|
53
|
+
width: 100%;
|
|
54
|
+
align-items: center;
|
|
55
|
+
margin-bottom: 24px;
|
|
56
|
+
shadow-color: #000;
|
|
57
|
+
shadow-offset: 0px 2px;
|
|
58
|
+
shadow-opacity: 0.05;
|
|
59
|
+
shadow-radius: 8px;
|
|
60
|
+
elevation: 3;
|
|
61
|
+
`;
|
|
62
|
+
const AmountLabel = styled.Text`
|
|
63
|
+
font-size: 14px;
|
|
64
|
+
color: #666666;
|
|
65
|
+
margin-bottom: 8px;
|
|
66
|
+
`;
|
|
67
|
+
const AmountText = styled.Text`
|
|
68
|
+
font-size: 36px;
|
|
69
|
+
font-weight: 700;
|
|
70
|
+
color: #0a3d2e;
|
|
71
|
+
margin-bottom: 8px;
|
|
72
|
+
`;
|
|
73
|
+
const DescriptionText = styled.Text`
|
|
74
|
+
font-size: 14px;
|
|
75
|
+
color: #999999;
|
|
76
|
+
font-style: italic;
|
|
77
|
+
`;
|
|
78
|
+
const QRContainer = styled.View`
|
|
79
|
+
background-color: #ffffff;
|
|
80
|
+
border-radius: 16px;
|
|
81
|
+
padding: 32px;
|
|
82
|
+
align-items: center;
|
|
83
|
+
margin-bottom: 24px;
|
|
84
|
+
shadow-color: #000;
|
|
85
|
+
shadow-offset: 0px 2px;
|
|
86
|
+
shadow-opacity: 0.05;
|
|
87
|
+
shadow-radius: 8px;
|
|
88
|
+
elevation: 3;
|
|
89
|
+
`;
|
|
90
|
+
const QRCodePlaceholder = styled.View`
|
|
91
|
+
width: 240px;
|
|
92
|
+
height: 240px;
|
|
93
|
+
background-color: #000000;
|
|
94
|
+
border-radius: 12px;
|
|
95
|
+
margin-bottom: 16px;
|
|
96
|
+
`;
|
|
97
|
+
const StatusContainer = styled.View`
|
|
98
|
+
align-items: center;
|
|
99
|
+
margin-bottom: 16px;
|
|
100
|
+
`;
|
|
101
|
+
const StatusText = styled.Text`
|
|
102
|
+
font-size: 16px;
|
|
103
|
+
color: #333333;
|
|
104
|
+
margin-bottom: 8px;
|
|
105
|
+
`;
|
|
106
|
+
const DotsContainer = styled.View`
|
|
107
|
+
flex-direction: row;
|
|
108
|
+
align-items: center;
|
|
109
|
+
`;
|
|
110
|
+
const Dot = styled(Animated.View)`
|
|
111
|
+
width: 8px;
|
|
112
|
+
height: 8px;
|
|
113
|
+
border-radius: 4px;
|
|
114
|
+
background-color: #0a3d2e;
|
|
115
|
+
margin: 0 4px;
|
|
116
|
+
`;
|
|
117
|
+
const TimerContainer = styled.View`
|
|
118
|
+
background-color: #FFF3E0;
|
|
119
|
+
border-radius: 20px;
|
|
120
|
+
padding: 12px 20px;
|
|
121
|
+
margin-bottom: 24px;
|
|
122
|
+
`;
|
|
123
|
+
const TimerText = styled.Text`
|
|
124
|
+
font-size: 14px;
|
|
125
|
+
color: #F57C00;
|
|
126
|
+
font-weight: 600;
|
|
127
|
+
`;
|
|
128
|
+
const InfoBox = styled.View`
|
|
129
|
+
background-color: #E8F5F1;
|
|
130
|
+
border-radius: 12px;
|
|
131
|
+
padding: 16px;
|
|
132
|
+
width: 100%;
|
|
133
|
+
margin-bottom: 24px;
|
|
134
|
+
`;
|
|
135
|
+
const InfoText = styled.Text`
|
|
136
|
+
font-size: 13px;
|
|
137
|
+
color: #00A876;
|
|
138
|
+
line-height: 20px;
|
|
139
|
+
text-align: center;
|
|
140
|
+
`;
|
|
141
|
+
const ButtonRow = styled.View`
|
|
142
|
+
flex-direction: row;
|
|
143
|
+
width: 100%;
|
|
144
|
+
gap: 12px;
|
|
145
|
+
margin-bottom: 16px;
|
|
146
|
+
`;
|
|
147
|
+
const OutlineButton = styled.TouchableOpacity`
|
|
148
|
+
flex: 1;
|
|
149
|
+
background-color: #ffffff;
|
|
150
|
+
border: 1.5px solid #0a3d2e;
|
|
151
|
+
border-radius: 28px;
|
|
152
|
+
padding: 16px;
|
|
153
|
+
align-items: center;
|
|
154
|
+
`;
|
|
155
|
+
const OutlineButtonText = styled.Text`
|
|
156
|
+
font-size: 15px;
|
|
157
|
+
font-weight: 600;
|
|
158
|
+
color: #0a3d2e;
|
|
159
|
+
`;
|
|
160
|
+
const PrimaryButton = styled.TouchableOpacity`
|
|
161
|
+
flex: 1;
|
|
162
|
+
background-color: #0a3d2e;
|
|
163
|
+
border-radius: 28px;
|
|
164
|
+
padding: 16px;
|
|
165
|
+
align-items: center;
|
|
166
|
+
`;
|
|
167
|
+
const PrimaryButtonText = styled.Text`
|
|
168
|
+
font-size: 15px;
|
|
169
|
+
font-weight: 600;
|
|
170
|
+
color: #ffffff;
|
|
171
|
+
`;
|
|
172
|
+
const SecondaryButton = styled.TouchableOpacity`
|
|
173
|
+
background-color: #ffffff;
|
|
174
|
+
border: 1.5px solid #E0E0E0;
|
|
175
|
+
border-radius: 28px;
|
|
176
|
+
padding: 16px;
|
|
177
|
+
align-items: center;
|
|
178
|
+
width: 100%;
|
|
179
|
+
`;
|
|
180
|
+
const SecondaryButtonText = styled.Text`
|
|
181
|
+
font-size: 15px;
|
|
182
|
+
font-weight: 600;
|
|
183
|
+
color: #666666;
|
|
184
|
+
`;
|
|
185
|
+
const Footer = styled.View`
|
|
186
|
+
padding: 16px;
|
|
187
|
+
background-color: #ffffff;
|
|
188
|
+
border-top-width: 1px;
|
|
189
|
+
border-top-color: #e0e0e0;
|
|
190
|
+
`;
|
|
191
|
+
const FooterText = styled.Text`
|
|
192
|
+
font-size: 12px;
|
|
193
|
+
color: #999999;
|
|
194
|
+
text-align: center;
|
|
195
|
+
line-height: 18px;
|
|
196
|
+
`;
|
|
197
|
+
|
|
198
|
+
// Main Component
|
|
199
|
+
|
|
200
|
+
const Qr = ({
|
|
201
|
+
amount = 5000,
|
|
202
|
+
description = 'Payment request',
|
|
203
|
+
onClose,
|
|
204
|
+
onPaymentReceived
|
|
205
|
+
}) => {
|
|
206
|
+
const [timeRemaining, setTimeRemaining] = useState(900); // 15 minutes in seconds
|
|
207
|
+
const [qrData, setQrData] = useState('');
|
|
208
|
+
const qrRef = useRef(null);
|
|
209
|
+
useEffect(() => {
|
|
210
|
+
// Generate QR code data (would be actual payment data in production)
|
|
211
|
+
const paymentData = {
|
|
212
|
+
amount,
|
|
213
|
+
description,
|
|
214
|
+
timestamp: Date.now(),
|
|
215
|
+
recipient: 'USER_ID_12345'
|
|
216
|
+
};
|
|
217
|
+
setQrData(JSON.stringify(paymentData));
|
|
218
|
+
}, [amount, description]);
|
|
219
|
+
useEffect(() => {
|
|
220
|
+
// Countdown timer
|
|
221
|
+
const timer = setInterval(() => {
|
|
222
|
+
setTimeRemaining(prev => {
|
|
223
|
+
if (prev <= 0) {
|
|
224
|
+
clearInterval(timer);
|
|
225
|
+
return 0;
|
|
226
|
+
}
|
|
227
|
+
return prev - 1;
|
|
228
|
+
});
|
|
229
|
+
}, 1000);
|
|
230
|
+
return () => clearInterval(timer);
|
|
231
|
+
}, []);
|
|
232
|
+
const formatTime = seconds => {
|
|
233
|
+
const mins = Math.floor(seconds / 60);
|
|
234
|
+
const secs = seconds % 60;
|
|
235
|
+
return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
|
|
236
|
+
};
|
|
237
|
+
const handleShare = async () => {
|
|
238
|
+
try {
|
|
239
|
+
if (!qrRef.current) return;
|
|
240
|
+
qrRef.current.toDataURL(async data => {
|
|
241
|
+
const shareOptions = {
|
|
242
|
+
title: 'Payment Request',
|
|
243
|
+
message: `Please pay ₦${amount.toLocaleString()} for ${description}.`,
|
|
244
|
+
url: `data:image/png;base64,${data}`,
|
|
245
|
+
// 👈 QR image
|
|
246
|
+
type: 'image/png'
|
|
247
|
+
};
|
|
248
|
+
await Share.open(shareOptions);
|
|
249
|
+
});
|
|
250
|
+
} catch (error) {
|
|
251
|
+
console.error('Error sharing QR:', error);
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
const handleRefresh = () => {
|
|
255
|
+
setTimeRemaining(900);
|
|
256
|
+
const paymentData = {
|
|
257
|
+
amount,
|
|
258
|
+
description,
|
|
259
|
+
direct: true,
|
|
260
|
+
timestamp: Date.now(),
|
|
261
|
+
recipient: 'USER_ID_12345'
|
|
262
|
+
};
|
|
263
|
+
setQrData(JSON.stringify(paymentData));
|
|
264
|
+
};
|
|
265
|
+
const formatAmount = value => {
|
|
266
|
+
return value.toLocaleString('en-NG', {
|
|
267
|
+
minimumFractionDigits: 2,
|
|
268
|
+
maximumFractionDigits: 2
|
|
269
|
+
});
|
|
270
|
+
};
|
|
271
|
+
return /*#__PURE__*/_jsxs(Container, {
|
|
272
|
+
children: [/*#__PURE__*/_jsxs(Header, {
|
|
273
|
+
children: [/*#__PURE__*/_jsx(BackButton, {
|
|
274
|
+
onPress: onClose,
|
|
275
|
+
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
276
|
+
name: "close",
|
|
277
|
+
size: 24
|
|
278
|
+
})
|
|
279
|
+
}), /*#__PURE__*/_jsx(HeaderTitle, {
|
|
280
|
+
children: "Receive via QR Code"
|
|
281
|
+
})]
|
|
282
|
+
}), /*#__PURE__*/_jsx(ScrollContainer, {
|
|
283
|
+
showsVerticalScrollIndicator: false,
|
|
284
|
+
children: /*#__PURE__*/_jsxs(ContentContainer, {
|
|
285
|
+
children: [/*#__PURE__*/_jsxs(QRContainer, {
|
|
286
|
+
children: [/*#__PURE__*/_jsx(QRCodePlaceholder, {
|
|
287
|
+
children: qrData && /*#__PURE__*/_jsx(QRCode, {
|
|
288
|
+
value: qrData,
|
|
289
|
+
size: 240
|
|
290
|
+
// logo={{uri: LOGO_DATA}}
|
|
291
|
+
,
|
|
292
|
+
logoSize: 60,
|
|
293
|
+
logoBackgroundColor: "transparent",
|
|
294
|
+
enableLinearGradient: true,
|
|
295
|
+
logoBorderRadius: 30,
|
|
296
|
+
getRef: c => qrRef.current = c
|
|
297
|
+
})
|
|
298
|
+
}), /*#__PURE__*/_jsxs(StatusContainer, {
|
|
299
|
+
children: [/*#__PURE__*/_jsxs(StatusText, {
|
|
300
|
+
children: ["Waiting for payment of \u20A6", formatAmount(amount)]
|
|
301
|
+
}), /*#__PURE__*/_jsx(AnimatedDots, {})]
|
|
302
|
+
})]
|
|
303
|
+
}), /*#__PURE__*/_jsx(TimerContainer, {
|
|
304
|
+
children: /*#__PURE__*/_jsxs(TimerText, {
|
|
305
|
+
children: ["Valid for: ", formatTime(timeRemaining), " mins"]
|
|
306
|
+
})
|
|
307
|
+
}), /*#__PURE__*/_jsx(InfoBox, {
|
|
308
|
+
children: /*#__PURE__*/_jsx(InfoText, {
|
|
309
|
+
children: "Ask the payer to scan this QR code with their camera or payment app to complete the transaction"
|
|
310
|
+
})
|
|
311
|
+
}), /*#__PURE__*/_jsxs(ButtonRow, {
|
|
312
|
+
children: [/*#__PURE__*/_jsx(OutlineButton, {
|
|
313
|
+
onPress: handleShare,
|
|
314
|
+
children: /*#__PURE__*/_jsx(OutlineButtonText, {
|
|
315
|
+
children: "Share QR"
|
|
316
|
+
})
|
|
317
|
+
}), /*#__PURE__*/_jsx(PrimaryButton, {
|
|
318
|
+
onPress: handleRefresh,
|
|
319
|
+
children: /*#__PURE__*/_jsx(PrimaryButtonText, {
|
|
320
|
+
children: "Refresh"
|
|
321
|
+
})
|
|
322
|
+
})]
|
|
323
|
+
}), /*#__PURE__*/_jsx(SecondaryButton, {
|
|
324
|
+
onPress: onClose,
|
|
325
|
+
children: /*#__PURE__*/_jsx(SecondaryButtonText, {
|
|
326
|
+
children: "Cancel Request"
|
|
327
|
+
})
|
|
328
|
+
})]
|
|
329
|
+
})
|
|
330
|
+
}), /*#__PURE__*/_jsx(Footer, {
|
|
331
|
+
children: /*#__PURE__*/_jsx(FooterText, {
|
|
332
|
+
children: "The payment will be automatically credited to your account once the payer scans and confirms"
|
|
333
|
+
})
|
|
334
|
+
})]
|
|
335
|
+
});
|
|
336
|
+
};
|
|
337
|
+
export default Qr;
|
|
338
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","useEffect","useRef","Animated","styled","QRCode","Share","Ionicons","AnimatedDots","jsx","_jsx","jsxs","_jsxs","Container","View","Header","BackButton","TouchableOpacity","BackIcon","Text","HeaderTitle","ScrollContainer","ScrollView","ContentContainer","AmountContainer","AmountLabel","AmountText","DescriptionText","QRContainer","QRCodePlaceholder","StatusContainer","StatusText","DotsContainer","Dot","TimerContainer","TimerText","InfoBox","InfoText","ButtonRow","OutlineButton","OutlineButtonText","PrimaryButton","PrimaryButtonText","SecondaryButton","SecondaryButtonText","Footer","FooterText","Qr","amount","description","onClose","onPaymentReceived","timeRemaining","setTimeRemaining","qrData","setQrData","qrRef","paymentData","timestamp","Date","now","recipient","JSON","stringify","timer","setInterval","prev","clearInterval","formatTime","seconds","mins","Math","floor","secs","toString","padStart","handleShare","current","toDataURL","data","shareOptions","title","message","toLocaleString","url","type","open","error","console","handleRefresh","direct","formatAmount","value","minimumFractionDigits","maximumFractionDigits","children","onPress","name","size","showsVerticalScrollIndicator","logoSize","logoBackgroundColor","enableLinearGradient","logoBorderRadius","getRef","c"],"sourceRoot":"../../../../../../../src","sources":["ui/screens/sub/receivePayment/Qr/index.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAC1D,SAAeC,QAAQ,QAAgB,cAAc;AACrD,OAAOC,MAAM,MAAM,0BAA0B;AAC7C,OAAOC,MAAM,MAAM,yBAAyB;AAC5C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