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
package/src/ui/screens/styles.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Text, TouchableOpacity } from
|
|
2
|
-
import styled from
|
|
1
|
+
import { Text, TouchableOpacity } from 'react-native';
|
|
2
|
+
import styled from 'styled-components/native';
|
|
3
3
|
|
|
4
4
|
export const ButtonContainer = styled.View`
|
|
5
5
|
width: 100%;
|
|
@@ -48,6 +48,12 @@ export const List = styled(TouchableOpacity)`
|
|
|
48
48
|
border-bottom-color: #f9f9f9;
|
|
49
49
|
`;
|
|
50
50
|
|
|
51
|
+
export const ListGroup = styled.View`
|
|
52
|
+
flex-direction: row;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: flex-start;
|
|
55
|
+
gap: 10px;
|
|
56
|
+
`;
|
|
51
57
|
|
|
52
58
|
export const ListText = styled(Text)`
|
|
53
59
|
font-size: 16px;
|
|
@@ -57,7 +63,6 @@ export const ListText = styled(Text)`
|
|
|
57
63
|
width: 95%;
|
|
58
64
|
`;
|
|
59
65
|
|
|
60
|
-
|
|
61
66
|
export const InputContainer = styled.View`
|
|
62
67
|
padding: 0 24px;
|
|
63
68
|
margin-top: 24px;
|
|
@@ -85,8 +90,15 @@ export const Label = styled.Text`
|
|
|
85
90
|
margin-bottom: 12px;
|
|
86
91
|
`;
|
|
87
92
|
|
|
93
|
+
export const ErrorLabel = styled.Text`
|
|
94
|
+
color: red;
|
|
95
|
+
font-style: italic;
|
|
96
|
+
font-size: 14px;
|
|
97
|
+
margin-bottom: 12px;
|
|
98
|
+
`;
|
|
99
|
+
|
|
88
100
|
export const InputBox = styled.View`
|
|
89
|
-
background-color: rgba(255, 255, 255, 0.3)
|
|
101
|
+
background-color: rgba(255, 255, 255, 0.3);
|
|
90
102
|
border-radius: 16px;
|
|
91
103
|
padding: 16px 20px;
|
|
92
104
|
flex-direction: row;
|
|
@@ -98,4 +110,4 @@ export const StyledTextInput = styled.TextInput`
|
|
|
98
110
|
flex: 1;
|
|
99
111
|
color: #d1d5db;
|
|
100
112
|
font-size: 16px;
|
|
101
|
-
`;
|
|
113
|
+
`;
|
|
@@ -86,7 +86,7 @@ const NFCIconContainer = styled(Animated.View)`
|
|
|
86
86
|
width: 140px;
|
|
87
87
|
height: 140px;
|
|
88
88
|
border-radius: 90px;
|
|
89
|
-
background-color: #
|
|
89
|
+
background-color: #e8f5f1;
|
|
90
90
|
align-items: center;
|
|
91
91
|
justify-content: center;
|
|
92
92
|
margin-bottom: 24px;
|
|
@@ -174,7 +174,7 @@ const InstructionText = styled.Text`
|
|
|
174
174
|
`;
|
|
175
175
|
|
|
176
176
|
const InfoBanner = styled.View`
|
|
177
|
-
background-color: #
|
|
177
|
+
background-color: #fff3e0;
|
|
178
178
|
border-radius: 12px;
|
|
179
179
|
padding: 16px;
|
|
180
180
|
width: 100%;
|
|
@@ -191,13 +191,13 @@ const InfoIcon = styled.Text`
|
|
|
191
191
|
const InfoText = styled.Text`
|
|
192
192
|
flex: 1;
|
|
193
193
|
font-size: 13px;
|
|
194
|
-
color: #
|
|
194
|
+
color: #f57c00;
|
|
195
195
|
line-height: 18px;
|
|
196
196
|
`;
|
|
197
197
|
|
|
198
198
|
const CancelButton = styled.TouchableOpacity`
|
|
199
199
|
background-color: #ffffff;
|
|
200
|
-
border: 1.5px solid #
|
|
200
|
+
border: 1.5px solid #e0e0e0;
|
|
201
201
|
border-radius: 28px;
|
|
202
202
|
padding: 16px;
|
|
203
203
|
align-items: center;
|
|
@@ -211,7 +211,7 @@ const CancelButtonText = styled.Text`
|
|
|
211
211
|
`;
|
|
212
212
|
|
|
213
213
|
const ConnectionStatusBadge = styled.View<{ connected: boolean }>`
|
|
214
|
-
background-color: ${props => props.connected ? '#0a3d2e' : '#E0E0E0'};
|
|
214
|
+
background-color: ${(props) => (props.connected ? '#0a3d2e' : '#E0E0E0')};
|
|
215
215
|
border-radius: 20px;
|
|
216
216
|
padding: 8px 16px;
|
|
217
217
|
margin-top: 16px;
|
|
@@ -220,10 +220,9 @@ const ConnectionStatusBadge = styled.View<{ connected: boolean }>`
|
|
|
220
220
|
const ConnectionStatusText = styled.Text<{ connected: boolean }>`
|
|
221
221
|
font-size: 12px;
|
|
222
222
|
font-weight: 600;
|
|
223
|
-
color: ${props => props.connected ? '#ffffff' : '#666666'};
|
|
223
|
+
color: ${(props) => (props.connected ? '#ffffff' : '#666666')};
|
|
224
224
|
`;
|
|
225
225
|
|
|
226
|
-
|
|
227
226
|
// Main Component
|
|
228
227
|
interface ReceiveNFCScreenProps {
|
|
229
228
|
amount: number;
|
|
@@ -242,40 +241,34 @@ const Nfc: React.FC<ReceiveNFCScreenProps> = ({
|
|
|
242
241
|
const [isConnecting, setIsConnecting] = useState(false);
|
|
243
242
|
const iconScale = useRef(new Animated.Value(1)).current;
|
|
244
243
|
|
|
245
|
-
|
|
246
|
-
const writeNFC = async(userId: string, userName: string) => {
|
|
244
|
+
const writeNFC = async (userId: string, userName: string) => {
|
|
247
245
|
await NfcManager.requestTechnology(NfcTech.Ndef);
|
|
248
246
|
const bytes = Ndef.encodeMessage([
|
|
249
|
-
Ndef.textRecord(JSON.stringify({ userId, userName }))
|
|
247
|
+
Ndef.textRecord(JSON.stringify({ userId, userName })),
|
|
250
248
|
]);
|
|
251
249
|
await NfcManager.ndefHandler.writeNdefMessage(bytes);
|
|
252
250
|
await NfcManager.cancelTechnologyRequest();
|
|
253
|
-
}
|
|
251
|
+
};
|
|
254
252
|
|
|
255
253
|
// Sender reads NFC tag
|
|
256
|
-
const readNFC=async() => {
|
|
254
|
+
const readNFC = async () => {
|
|
257
255
|
await NfcManager.requestTechnology(NfcTech.Ndef);
|
|
258
256
|
const tag: any = await NfcManager.getTag();
|
|
259
257
|
const paymentInfo = JSON.parse(tag?.ndefMessage[0].payload);
|
|
260
258
|
await NfcManager.cancelTechnologyRequest();
|
|
261
259
|
return paymentInfo;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
260
|
+
};
|
|
267
261
|
|
|
268
262
|
const checkNFCAvailability = () => {
|
|
269
263
|
// In production, check actual NFC status
|
|
270
264
|
// For now, simulate it's available
|
|
271
265
|
NfcManager.start()
|
|
272
266
|
.then(() => setNfcEnabled(true))
|
|
273
|
-
.catch(err => console.log('NFC start error:', err));
|
|
274
|
-
|
|
267
|
+
.catch((err) => console.log('NFC start error:', err));
|
|
268
|
+
|
|
275
269
|
return () => {
|
|
276
270
|
NfcManager.cancelTechnologyRequest().catch(() => {});
|
|
277
271
|
};
|
|
278
|
-
|
|
279
272
|
};
|
|
280
273
|
|
|
281
274
|
const formatAmount = (value: number): string => {
|
|
@@ -289,7 +282,7 @@ const Nfc: React.FC<ReceiveNFCScreenProps> = ({
|
|
|
289
282
|
// Simulate NFC detection
|
|
290
283
|
setIsConnecting(true);
|
|
291
284
|
Vibration.vibrate(100);
|
|
292
|
-
|
|
285
|
+
|
|
293
286
|
// In production, handle actual NFC tag detection
|
|
294
287
|
setTimeout(() => {
|
|
295
288
|
setIsConnecting(false);
|
|
@@ -364,7 +357,7 @@ const Nfc: React.FC<ReceiveNFCScreenProps> = ({
|
|
|
364
357
|
{/* Instructions */}
|
|
365
358
|
<InstructionCard>
|
|
366
359
|
<InstructionTitle>How to receive payment</InstructionTitle>
|
|
367
|
-
|
|
360
|
+
|
|
368
361
|
<InstructionItem>
|
|
369
362
|
<InstructionNumber>
|
|
370
363
|
<InstructionNumberText>1</InstructionNumberText>
|
|
@@ -408,11 +401,10 @@ const Nfc: React.FC<ReceiveNFCScreenProps> = ({
|
|
|
408
401
|
<CancelButton onPress={onClose}>
|
|
409
402
|
<CancelButtonText>Cancel</CancelButtonText>
|
|
410
403
|
</CancelButton>
|
|
411
|
-
</ContentContainer>
|
|
404
|
+
</ContentContainer>
|
|
412
405
|
</ScrollContainer>
|
|
413
|
-
|
|
414
406
|
</Container>
|
|
415
407
|
);
|
|
416
408
|
};
|
|
417
409
|
|
|
418
|
-
export default Nfc;
|
|
410
|
+
export default Nfc;
|
|
@@ -129,7 +129,7 @@ const Dot = styled(Animated.View)<{ delay: number }>`
|
|
|
129
129
|
`;
|
|
130
130
|
|
|
131
131
|
const TimerContainer = styled.View`
|
|
132
|
-
background-color: #
|
|
132
|
+
background-color: #fff3e0;
|
|
133
133
|
border-radius: 20px;
|
|
134
134
|
padding: 12px 20px;
|
|
135
135
|
margin-bottom: 24px;
|
|
@@ -137,12 +137,12 @@ const TimerContainer = styled.View`
|
|
|
137
137
|
|
|
138
138
|
const TimerText = styled.Text`
|
|
139
139
|
font-size: 14px;
|
|
140
|
-
color: #
|
|
140
|
+
color: #f57c00;
|
|
141
141
|
font-weight: 600;
|
|
142
142
|
`;
|
|
143
143
|
|
|
144
144
|
const InfoBox = styled.View`
|
|
145
|
-
background-color: #
|
|
145
|
+
background-color: #e8f5f1;
|
|
146
146
|
border-radius: 12px;
|
|
147
147
|
padding: 16px;
|
|
148
148
|
width: 100%;
|
|
@@ -151,7 +151,7 @@ const InfoBox = styled.View`
|
|
|
151
151
|
|
|
152
152
|
const InfoText = styled.Text`
|
|
153
153
|
font-size: 13px;
|
|
154
|
-
color: #
|
|
154
|
+
color: #00a876;
|
|
155
155
|
line-height: 20px;
|
|
156
156
|
text-align: center;
|
|
157
157
|
`;
|
|
@@ -194,7 +194,7 @@ const PrimaryButtonText = styled.Text`
|
|
|
194
194
|
|
|
195
195
|
const SecondaryButton = styled.TouchableOpacity`
|
|
196
196
|
background-color: #ffffff;
|
|
197
|
-
border: 1.5px solid #
|
|
197
|
+
border: 1.5px solid #e0e0e0;
|
|
198
198
|
border-radius: 28px;
|
|
199
199
|
padding: 16px;
|
|
200
200
|
align-items: center;
|
|
@@ -221,7 +221,6 @@ const FooterText = styled.Text`
|
|
|
221
221
|
line-height: 18px;
|
|
222
222
|
`;
|
|
223
223
|
|
|
224
|
-
|
|
225
224
|
// Main Component
|
|
226
225
|
interface ReceiveQRCodeScreenProps {
|
|
227
226
|
amount: number;
|
|
@@ -291,7 +290,6 @@ const Qr: React.FC<ReceiveQRCodeScreenProps> = ({
|
|
|
291
290
|
}
|
|
292
291
|
};
|
|
293
292
|
|
|
294
|
-
|
|
295
293
|
const handleRefresh = () => {
|
|
296
294
|
setTimeRemaining(900);
|
|
297
295
|
const paymentData = {
|
|
@@ -324,26 +322,29 @@ const Qr: React.FC<ReceiveQRCodeScreenProps> = ({
|
|
|
324
322
|
{/* Content */}
|
|
325
323
|
<ScrollContainer showsVerticalScrollIndicator={false}>
|
|
326
324
|
<ContentContainer>
|
|
327
|
-
|
|
328
325
|
{/* QR Code */}
|
|
329
326
|
<QRContainer>
|
|
330
327
|
<QRCodePlaceholder>
|
|
331
328
|
{/* In production, replace with actual QR code library */}
|
|
332
329
|
{/* <QRCode value={qrData} size={240} /> */}
|
|
333
|
-
{qrData && (
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
330
|
+
{qrData && (
|
|
331
|
+
<QRCode
|
|
332
|
+
value={qrData}
|
|
333
|
+
size={240}
|
|
334
|
+
// logo={{uri: LOGO_DATA}}
|
|
335
|
+
logoSize={60}
|
|
336
|
+
logoBackgroundColor="transparent"
|
|
337
|
+
enableLinearGradient={true}
|
|
338
|
+
logoBorderRadius={30}
|
|
339
|
+
getRef={(c) => (qrRef.current = c)}
|
|
340
|
+
/>
|
|
341
|
+
)}
|
|
343
342
|
</QRCodePlaceholder>
|
|
344
343
|
|
|
345
344
|
<StatusContainer>
|
|
346
|
-
<StatusText>
|
|
345
|
+
<StatusText>
|
|
346
|
+
Waiting for payment of ₦{formatAmount(amount)}
|
|
347
|
+
</StatusText>
|
|
347
348
|
<AnimatedDots />
|
|
348
349
|
</StatusContainer>
|
|
349
350
|
</QRContainer>
|
|
@@ -388,4 +389,4 @@ const Qr: React.FC<ReceiveQRCodeScreenProps> = ({
|
|
|
388
389
|
);
|
|
389
390
|
};
|
|
390
391
|
|
|
391
|
-
export default Qr;
|
|
392
|
+
export default Qr;
|
|
@@ -5,7 +5,6 @@ import { Buffer } from 'buffer';
|
|
|
5
5
|
import Ionicons from 'react-native-vector-icons/Ionicons';
|
|
6
6
|
import type { ReceiveTransferScreenProps } from '../../../../../core/types';
|
|
7
7
|
|
|
8
|
-
|
|
9
8
|
// Styled Components
|
|
10
9
|
const Container = styled.View`
|
|
11
10
|
flex: 1;
|
|
@@ -43,7 +42,6 @@ const HeaderTitle = styled.Text`
|
|
|
43
42
|
|
|
44
43
|
const ScrollContainer = styled.ScrollView`
|
|
45
44
|
flex: 1;
|
|
46
|
-
|
|
47
45
|
`;
|
|
48
46
|
|
|
49
47
|
const ContentContainer = styled.View`
|
|
@@ -51,7 +49,7 @@ const ContentContainer = styled.View`
|
|
|
51
49
|
`;
|
|
52
50
|
|
|
53
51
|
const InfoBanner = styled.View`
|
|
54
|
-
background-color: #
|
|
52
|
+
background-color: #e8f5f1;
|
|
55
53
|
border-radius: 12px;
|
|
56
54
|
padding: 16px;
|
|
57
55
|
margin-bottom: 24px;
|
|
@@ -67,7 +65,7 @@ const InfoIcon = styled.Text`
|
|
|
67
65
|
const InfoText = styled.Text`
|
|
68
66
|
flex: 1;
|
|
69
67
|
font-size: 13px;
|
|
70
|
-
color: #
|
|
68
|
+
color: #00a876;
|
|
71
69
|
line-height: 20px;
|
|
72
70
|
`;
|
|
73
71
|
|
|
@@ -146,7 +144,7 @@ const DetailValue = styled.Text`
|
|
|
146
144
|
`;
|
|
147
145
|
|
|
148
146
|
const CopyButton = styled.TouchableOpacity`
|
|
149
|
-
background-color: #
|
|
147
|
+
background-color: #e8f5f1;
|
|
150
148
|
border-radius: 20px;
|
|
151
149
|
padding: 8px 16px;
|
|
152
150
|
margin-left: 12px;
|
|
@@ -160,12 +158,12 @@ const CopyButtonText = styled.Text`
|
|
|
160
158
|
|
|
161
159
|
const Divider = styled.View`
|
|
162
160
|
height: 1px;
|
|
163
|
-
background-color: #
|
|
161
|
+
background-color: #f0f0f0;
|
|
164
162
|
margin: 4px 0;
|
|
165
163
|
`;
|
|
166
164
|
|
|
167
165
|
const PaymentLinkCard = styled.View`
|
|
168
|
-
background-color: #
|
|
166
|
+
background-color: #fff3e0;
|
|
169
167
|
border-radius: 12px;
|
|
170
168
|
padding: 16px;
|
|
171
169
|
margin-bottom: 24px;
|
|
@@ -174,13 +172,13 @@ const PaymentLinkCard = styled.View`
|
|
|
174
172
|
const PaymentLinkTitle = styled.Text`
|
|
175
173
|
font-size: 14px;
|
|
176
174
|
font-weight: 600;
|
|
177
|
-
color: #
|
|
175
|
+
color: #f57c00;
|
|
178
176
|
margin-bottom: 8px;
|
|
179
177
|
`;
|
|
180
178
|
|
|
181
179
|
const PaymentLinkText = styled.Text`
|
|
182
180
|
font-size: 12px;
|
|
183
|
-
color: #
|
|
181
|
+
color: #f57c00;
|
|
184
182
|
margin-bottom: 12px;
|
|
185
183
|
`;
|
|
186
184
|
|
|
@@ -205,7 +203,7 @@ const LinkButtonRow = styled.View`
|
|
|
205
203
|
const SmallButton = styled.TouchableOpacity`
|
|
206
204
|
flex: 1;
|
|
207
205
|
background-color: #ffffff;
|
|
208
|
-
border: 1px solid #
|
|
206
|
+
border: 1px solid #f57c00;
|
|
209
207
|
border-radius: 20px;
|
|
210
208
|
padding: 10px;
|
|
211
209
|
align-items: center;
|
|
@@ -214,7 +212,7 @@ const SmallButton = styled.TouchableOpacity`
|
|
|
214
212
|
const SmallButtonText = styled.Text`
|
|
215
213
|
font-size: 13px;
|
|
216
214
|
font-weight: 600;
|
|
217
|
-
color: #
|
|
215
|
+
color: #f57c00;
|
|
218
216
|
`;
|
|
219
217
|
|
|
220
218
|
const ButtonContainer = styled.View`
|
|
@@ -250,7 +248,7 @@ const OutlineButtonText = styled.Text`
|
|
|
250
248
|
|
|
251
249
|
const SecondaryButton = styled.TouchableOpacity`
|
|
252
250
|
background-color: #ffffff;
|
|
253
|
-
border: 1.5px solid #
|
|
251
|
+
border: 1.5px solid #e0e0e0;
|
|
254
252
|
border-radius: 28px;
|
|
255
253
|
padding: 16px;
|
|
256
254
|
align-items: center;
|
|
@@ -275,7 +273,6 @@ const FooterText = styled.Text`
|
|
|
275
273
|
|
|
276
274
|
// Main Component
|
|
277
275
|
|
|
278
|
-
|
|
279
276
|
const Transfer: React.FC<ReceiveTransferScreenProps> = ({
|
|
280
277
|
amount = 0,
|
|
281
278
|
description = '',
|
|
@@ -297,7 +294,7 @@ const Transfer: React.FC<ReceiveTransferScreenProps> = ({
|
|
|
297
294
|
try {
|
|
298
295
|
await Clipboard.setString(text);
|
|
299
296
|
setCopiedField(fieldName);
|
|
300
|
-
|
|
297
|
+
|
|
301
298
|
// Reset copied state after 2 seconds
|
|
302
299
|
setTimeout(() => {
|
|
303
300
|
setCopiedField(null);
|
|
@@ -309,12 +306,13 @@ const Transfer: React.FC<ReceiveTransferScreenProps> = ({
|
|
|
309
306
|
|
|
310
307
|
const generatePaymentLink = (): string => {
|
|
311
308
|
// Generate a payment link (in production, this would be a real URL)
|
|
312
|
-
const base64 = Buffer.from(
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
309
|
+
const base64 = Buffer.from(
|
|
310
|
+
JSON.stringify({
|
|
311
|
+
account: recipient.accountNumber,
|
|
312
|
+
recipient: recipient.accountName,
|
|
313
|
+
})
|
|
314
|
+
).toString('base64');
|
|
316
315
|
|
|
317
|
-
|
|
318
316
|
return `https://tapit.app/pay/${base64}`;
|
|
319
317
|
};
|
|
320
318
|
|
|
@@ -386,11 +384,13 @@ Thank you!
|
|
|
386
384
|
</InfoBanner>
|
|
387
385
|
|
|
388
386
|
{/* Amount Display */}
|
|
389
|
-
{amount > 0 && (
|
|
390
|
-
<
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
387
|
+
{amount > 0 && (
|
|
388
|
+
<AmountCard>
|
|
389
|
+
<AmountLabel>Expected Amount</AmountLabel>
|
|
390
|
+
<AmountText>₦{formatAmount(amount)}</AmountText>
|
|
391
|
+
{description && <DescriptionText>{description}</DescriptionText>}
|
|
392
|
+
</AmountCard>
|
|
393
|
+
)}
|
|
394
394
|
|
|
395
395
|
{/* Account Details */}
|
|
396
396
|
<SectionTitle>Send money to this account</SectionTitle>
|
|
@@ -415,7 +415,9 @@ Thank you!
|
|
|
415
415
|
<DetailLabel>Account Name</DetailLabel>
|
|
416
416
|
<DetailValueContainer>
|
|
417
417
|
<DetailValue>{recipient.accountName}</DetailValue>
|
|
418
|
-
<CopyButton
|
|
418
|
+
<CopyButton
|
|
419
|
+
onPress={() => handleCopy(recipient.accountName, 'name')}
|
|
420
|
+
>
|
|
419
421
|
<CopyButtonText>
|
|
420
422
|
{copiedField === 'name' ? 'Copied!' : 'Copy'}
|
|
421
423
|
</CopyButtonText>
|
|
@@ -429,7 +431,9 @@ Thank you!
|
|
|
429
431
|
<DetailLabel>Bank</DetailLabel>
|
|
430
432
|
<DetailValueContainer>
|
|
431
433
|
<DetailValue>{recipient.bankName}</DetailValue>
|
|
432
|
-
<CopyButton
|
|
434
|
+
<CopyButton
|
|
435
|
+
onPress={() => handleCopy(recipient.bankName, 'bank')}
|
|
436
|
+
>
|
|
433
437
|
<CopyButtonText>
|
|
434
438
|
{copiedField === 'bank' ? 'Copied!' : 'Copy'}
|
|
435
439
|
</CopyButtonText>
|
|
@@ -487,7 +491,9 @@ Thank you!
|
|
|
487
491
|
|
|
488
492
|
<OutlineButton onPress={handleCopyAll}>
|
|
489
493
|
<OutlineButtonText>
|
|
490
|
-
{copiedField === 'all'
|
|
494
|
+
{copiedField === 'all'
|
|
495
|
+
? '✓ All Details Copied'
|
|
496
|
+
: 'Copy All Details'}
|
|
491
497
|
</OutlineButtonText>
|
|
492
498
|
</OutlineButton>
|
|
493
499
|
|
|
@@ -509,4 +515,4 @@ Thank you!
|
|
|
509
515
|
);
|
|
510
516
|
};
|
|
511
517
|
|
|
512
|
-
export default Transfer;
|
|
518
|
+
export default Transfer;
|