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,354 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { View, Text, StyleSheet, TouchableOpacity, Animated, Alert } from 'react-native';
|
|
5
|
+
import NfcManager, { NfcTech, Ndef } from 'react-native-nfc-manager';
|
|
6
|
+
import { FPButton } from "../../../components/FPButton.js";
|
|
7
|
+
import { C, R, S, F } from "../../../theme/index.js";
|
|
8
|
+
import styled from 'styled-components/native';
|
|
9
|
+
import Svg, { Path } from 'react-native-svg';
|
|
10
|
+
import Ionicons from 'react-native-vector-icons/Ionicons';
|
|
11
|
+
import { PulseAnimation } from "../../../components/PulseAnimation.js";
|
|
12
|
+
|
|
13
|
+
// Styled Components
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
+
const Container = styled(View)`
|
|
16
|
+
flex: 1;
|
|
17
|
+
background-color: #000000;
|
|
18
|
+
`;
|
|
19
|
+
const Header = styled(View)`
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
padding: 12px 16px;
|
|
24
|
+
position: absolute !important;
|
|
25
|
+
top: 40px;
|
|
26
|
+
left: 0;
|
|
27
|
+
right: 0;
|
|
28
|
+
z-index: 10;
|
|
29
|
+
elevation: 4;
|
|
30
|
+
shadow-color: #000;
|
|
31
|
+
shadow-offset: 0px 2px;
|
|
32
|
+
shadow-opacity: 0.1;
|
|
33
|
+
shadow-radius: 4px;
|
|
34
|
+
z-index: 9999999999 !important;
|
|
35
|
+
`;
|
|
36
|
+
const HeaderButton = styled(TouchableOpacity)`
|
|
37
|
+
padding: 8px;
|
|
38
|
+
background-color: #fff;
|
|
39
|
+
width: 40px;
|
|
40
|
+
height: 40px;
|
|
41
|
+
border-radius: 50%;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
align-items: center;
|
|
44
|
+
`;
|
|
45
|
+
const HeaderCenter = styled(View)`
|
|
46
|
+
flex-direction: row;
|
|
47
|
+
align-items: center;
|
|
48
|
+
gap: 8px;
|
|
49
|
+
`;
|
|
50
|
+
const HeaderRight = styled(View)`
|
|
51
|
+
flex-direction: row;
|
|
52
|
+
align-items: center;
|
|
53
|
+
gap: 8px;
|
|
54
|
+
`;
|
|
55
|
+
const QuickLinksContainer = styled.View`
|
|
56
|
+
align-items: center;
|
|
57
|
+
margin-top: 250px;
|
|
58
|
+
`;
|
|
59
|
+
const QuickLinksIcon = styled.TouchableOpacity`
|
|
60
|
+
width: 96px;
|
|
61
|
+
height: 96px;
|
|
62
|
+
border-radius: 100%;
|
|
63
|
+
background-color: ${props => props.bg || '#18181b'};
|
|
64
|
+
justify-content: center;
|
|
65
|
+
align-items: center;
|
|
66
|
+
margin-bottom: 16px;
|
|
67
|
+
`;
|
|
68
|
+
const QuickLinksText = styled.Text`
|
|
69
|
+
color: #9ca3af;
|
|
70
|
+
font-size: 18px;
|
|
71
|
+
`;
|
|
72
|
+
const LCAnimationContainer = styled.View`
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
margin-top: 40%;
|
|
76
|
+
`;
|
|
77
|
+
const LCIconContainer = styled(Animated.View)`
|
|
78
|
+
width: 140px;
|
|
79
|
+
height: 140px;
|
|
80
|
+
border-radius: 90px;
|
|
81
|
+
background-color: #E8F5F1;
|
|
82
|
+
align-items: center;
|
|
83
|
+
justify-content: center;
|
|
84
|
+
margin-top: 24px;
|
|
85
|
+
margin-bottom: 24px;
|
|
86
|
+
`;
|
|
87
|
+
const LCIcon = styled.Text`
|
|
88
|
+
font-size: 80px;
|
|
89
|
+
`;
|
|
90
|
+
const StatusTextContainer = styled.View`
|
|
91
|
+
align-items: center;
|
|
92
|
+
margin-bottom: 8px;
|
|
93
|
+
`;
|
|
94
|
+
const StatusText = styled.Text`
|
|
95
|
+
font-size: 18px;
|
|
96
|
+
font-weight: 600;
|
|
97
|
+
color: #333333;
|
|
98
|
+
text-align: center;
|
|
99
|
+
margin-bottom: 8px;
|
|
100
|
+
`;
|
|
101
|
+
const NFCIcon = ({
|
|
102
|
+
color = "#111",
|
|
103
|
+
size = 22
|
|
104
|
+
}) => /*#__PURE__*/_jsxs(Svg, {
|
|
105
|
+
width: size,
|
|
106
|
+
height: size,
|
|
107
|
+
strokeWidth: "0.9",
|
|
108
|
+
viewBox: "0 0 24 24",
|
|
109
|
+
fill: "none",
|
|
110
|
+
color: color,
|
|
111
|
+
children: [/*#__PURE__*/_jsx(Path, {
|
|
112
|
+
d: "M12 19.51L12.01 19.4989",
|
|
113
|
+
stroke: "#fff",
|
|
114
|
+
strokeWidth: "0.9",
|
|
115
|
+
strokeLinecap: "round",
|
|
116
|
+
strokeLinejoin: "round"
|
|
117
|
+
}), /*#__PURE__*/_jsx(Path, {
|
|
118
|
+
d: "M2 8C8 3.5 16 3.5 22 8",
|
|
119
|
+
stroke: "#fff",
|
|
120
|
+
strokeWidth: "0.9",
|
|
121
|
+
strokeLinecap: "round",
|
|
122
|
+
strokeLinejoin: "round"
|
|
123
|
+
}), /*#__PURE__*/_jsx(Path, {
|
|
124
|
+
d: "M5 12C9 9 15 9 19 12",
|
|
125
|
+
stroke: "#fff",
|
|
126
|
+
strokeWidth: "0.9",
|
|
127
|
+
strokeLinecap: "round",
|
|
128
|
+
strokeLinejoin: "round"
|
|
129
|
+
}), /*#__PURE__*/_jsx(Path, {
|
|
130
|
+
d: "M8.5 15.5C10.7504 14.1 13.2498 14.0996 15.5001 15.5",
|
|
131
|
+
stroke: "#fff",
|
|
132
|
+
strokeWidth: "0.9",
|
|
133
|
+
strokeLinecap: "round",
|
|
134
|
+
strokeLinejoin: "round"
|
|
135
|
+
})]
|
|
136
|
+
});
|
|
137
|
+
export function NFCSubScreen({
|
|
138
|
+
amount,
|
|
139
|
+
currency,
|
|
140
|
+
onClose,
|
|
141
|
+
onProcessTransaction,
|
|
142
|
+
onError
|
|
143
|
+
}) {
|
|
144
|
+
const [phase, setPhase] = useState('idle');
|
|
145
|
+
const [msg, setMsg] = useState('');
|
|
146
|
+
const iconScale = useRef(new Animated.Value(1)).current;
|
|
147
|
+
|
|
148
|
+
// const tapToReceive = async () => {
|
|
149
|
+
// if (!myWallet) return;
|
|
150
|
+
// setPhase('active');
|
|
151
|
+
// try {
|
|
152
|
+
// await NfcManager.start();
|
|
153
|
+
// await NfcManager.requestTechnology(NfcTech.Ndef);
|
|
154
|
+
// const bytes = Ndef.encodeMessage([Ndef.textRecord(JSON.stringify(myWallet))]);
|
|
155
|
+
// if (bytes) await NfcManager.ndefHandler.writeNdefMessage(bytes);
|
|
156
|
+
// setPhase('success'); setMsg('Your payment details are now on the NFC tag.');
|
|
157
|
+
// } catch (e: any) { setPhase('error'); setMsg(e.message); onError?.({ code: 'NFC_ERROR', message: e.message }); }
|
|
158
|
+
// finally { NfcManager.cancelTechnologyRequest(); }
|
|
159
|
+
// };
|
|
160
|
+
|
|
161
|
+
const sendMoney = async wallet => {
|
|
162
|
+
console.log('NFC details:', wallet);
|
|
163
|
+
onProcessTransaction?.(wallet);
|
|
164
|
+
};
|
|
165
|
+
const tapToSend = async () => {
|
|
166
|
+
setPhase('active');
|
|
167
|
+
try {
|
|
168
|
+
await NfcManager.start();
|
|
169
|
+
await NfcManager.requestTechnology(NfcTech.Ndef);
|
|
170
|
+
const tag = await NfcManager.getTag();
|
|
171
|
+
if (!tag?.ndefMessage?.[0]?.payload) throw new Error('No wallet data on tag');
|
|
172
|
+
const payload = new Uint8Array(tag.ndefMessage[0].payload);
|
|
173
|
+
const text = Ndef.text.decodePayload(payload);
|
|
174
|
+
const wallet = JSON.parse(text);
|
|
175
|
+
setPhase('success');
|
|
176
|
+
setMsg('NFC scanned!');
|
|
177
|
+
Alert.alert('NFC Scanned', `Would you love to continue with this transaction?`, [{
|
|
178
|
+
text: 'Cancel',
|
|
179
|
+
style: 'cancel'
|
|
180
|
+
}, {
|
|
181
|
+
text: `Continue`,
|
|
182
|
+
onPress: () => sendMoney(wallet)
|
|
183
|
+
}]);
|
|
184
|
+
} catch (e) {
|
|
185
|
+
setPhase('error');
|
|
186
|
+
setMsg(e.message);
|
|
187
|
+
onError?.({
|
|
188
|
+
code: 'NFC_ERROR',
|
|
189
|
+
message: e.message
|
|
190
|
+
});
|
|
191
|
+
} finally {
|
|
192
|
+
NfcManager.cancelTechnologyRequest();
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
useEffect(() => {
|
|
196
|
+
NfcManager.start().then(() => console.log('NFC Manager started')).catch(err => {
|
|
197
|
+
console.log('NFC start error:', err);
|
|
198
|
+
setPhase('error');
|
|
199
|
+
setMsg(err.message);
|
|
200
|
+
onError?.({
|
|
201
|
+
code: 'NFC_ERROR',
|
|
202
|
+
message: err.message
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
return () => {
|
|
206
|
+
NfcManager.cancelTechnologyRequest().catch(() => {});
|
|
207
|
+
};
|
|
208
|
+
}, []);
|
|
209
|
+
return /*#__PURE__*/_jsxs(Container, {
|
|
210
|
+
children: [/*#__PURE__*/_jsxs(Header, {
|
|
211
|
+
children: [/*#__PURE__*/_jsx(HeaderButton, {
|
|
212
|
+
onPress: onClose,
|
|
213
|
+
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
214
|
+
name: "close",
|
|
215
|
+
size: 24
|
|
216
|
+
})
|
|
217
|
+
}), /*#__PURE__*/_jsxs(HeaderCenter, {
|
|
218
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
219
|
+
style: {
|
|
220
|
+
fontWeight: 'bold',
|
|
221
|
+
fontSize: 16,
|
|
222
|
+
color: '#FFF'
|
|
223
|
+
},
|
|
224
|
+
children: "NFC"
|
|
225
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
226
|
+
style: {
|
|
227
|
+
fontSize: 10,
|
|
228
|
+
color: '#FFF'
|
|
229
|
+
},
|
|
230
|
+
children: "Transfer"
|
|
231
|
+
})]
|
|
232
|
+
}), /*#__PURE__*/_jsxs(HeaderRight, {
|
|
233
|
+
children: [/*#__PURE__*/_jsx(HeaderButton, {
|
|
234
|
+
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
235
|
+
name: "image-outline",
|
|
236
|
+
size: 22
|
|
237
|
+
})
|
|
238
|
+
}), /*#__PURE__*/_jsx(HeaderButton, {
|
|
239
|
+
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
240
|
+
name: "settings-outline",
|
|
241
|
+
size: 22
|
|
242
|
+
})
|
|
243
|
+
})]
|
|
244
|
+
})]
|
|
245
|
+
}), /*#__PURE__*/_jsx(QuickLinksContainer, {
|
|
246
|
+
children: phase === 'idle' ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
247
|
+
children: [/*#__PURE__*/_jsx(QuickLinksIcon, {
|
|
248
|
+
onPress: () => {
|
|
249
|
+
tapToSend();
|
|
250
|
+
},
|
|
251
|
+
children: /*#__PURE__*/_jsx(NFCIcon, {
|
|
252
|
+
size: 40,
|
|
253
|
+
color: "#FFF"
|
|
254
|
+
})
|
|
255
|
+
}), /*#__PURE__*/_jsx(QuickLinksText, {
|
|
256
|
+
children: "Start NFC Scan"
|
|
257
|
+
})]
|
|
258
|
+
}) : phase === 'active' ? /*#__PURE__*/_jsxs(LCAnimationContainer, {
|
|
259
|
+
children: [/*#__PURE__*/_jsx(PulseAnimation, {}), /*#__PURE__*/_jsx(LCIconContainer, {
|
|
260
|
+
style: {
|
|
261
|
+
transform: [{
|
|
262
|
+
scale: iconScale
|
|
263
|
+
}],
|
|
264
|
+
marginTop: 64
|
|
265
|
+
},
|
|
266
|
+
children: /*#__PURE__*/_jsx(LCIcon, {
|
|
267
|
+
children: "\uD83D\uDCE1"
|
|
268
|
+
})
|
|
269
|
+
}), /*#__PURE__*/_jsx(StatusTextContainer, {
|
|
270
|
+
children: /*#__PURE__*/_jsx(StatusText, {
|
|
271
|
+
children: "Searching for nearby users"
|
|
272
|
+
})
|
|
273
|
+
})]
|
|
274
|
+
}) : phase === 'success' ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
275
|
+
children: [/*#__PURE__*/_jsx(QuickLinksIcon, {
|
|
276
|
+
bg: "#057e32",
|
|
277
|
+
onPress: () => {
|
|
278
|
+
tapToSend();
|
|
279
|
+
},
|
|
280
|
+
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
281
|
+
name: "checkmark",
|
|
282
|
+
size: 40,
|
|
283
|
+
color: "#FFF"
|
|
284
|
+
})
|
|
285
|
+
}), /*#__PURE__*/_jsx(QuickLinksText, {
|
|
286
|
+
children: "NFC Scanned"
|
|
287
|
+
})]
|
|
288
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
289
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
290
|
+
style: [st.tapZone, st.tapError],
|
|
291
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
292
|
+
style: st.tapEmoji,
|
|
293
|
+
children: 'ERR'
|
|
294
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
295
|
+
style: st.tapLabel,
|
|
296
|
+
children: msg
|
|
297
|
+
})]
|
|
298
|
+
}), /*#__PURE__*/_jsx(FPButton, {
|
|
299
|
+
label: "Try Again",
|
|
300
|
+
onPress: () => setPhase('idle'),
|
|
301
|
+
style: {
|
|
302
|
+
marginTop: S.md
|
|
303
|
+
}
|
|
304
|
+
})]
|
|
305
|
+
})
|
|
306
|
+
})]
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
const st = StyleSheet.create({
|
|
310
|
+
wrap: {
|
|
311
|
+
flex: 1,
|
|
312
|
+
padding: S.lg
|
|
313
|
+
},
|
|
314
|
+
back: {
|
|
315
|
+
color: C.brand,
|
|
316
|
+
fontSize: F.md,
|
|
317
|
+
fontWeight: '600',
|
|
318
|
+
marginBottom: S.md
|
|
319
|
+
},
|
|
320
|
+
title: {
|
|
321
|
+
fontSize: F.xl,
|
|
322
|
+
fontWeight: '800',
|
|
323
|
+
color: C.ink,
|
|
324
|
+
marginBottom: S.lg
|
|
325
|
+
},
|
|
326
|
+
tapZone: {
|
|
327
|
+
height: 180,
|
|
328
|
+
backgroundColor: C.ink,
|
|
329
|
+
borderRadius: R.xl,
|
|
330
|
+
justifyContent: 'center',
|
|
331
|
+
alignItems: 'center'
|
|
332
|
+
},
|
|
333
|
+
tapActive: {
|
|
334
|
+
backgroundColor: C.brand
|
|
335
|
+
},
|
|
336
|
+
tapSuccess: {
|
|
337
|
+
backgroundColor: C.green
|
|
338
|
+
},
|
|
339
|
+
tapError: {
|
|
340
|
+
backgroundColor: C.red
|
|
341
|
+
},
|
|
342
|
+
tapEmoji: {
|
|
343
|
+
fontSize: 40,
|
|
344
|
+
color: C.white,
|
|
345
|
+
fontWeight: '800',
|
|
346
|
+
marginBottom: S.sm
|
|
347
|
+
},
|
|
348
|
+
tapLabel: {
|
|
349
|
+
color: C.white,
|
|
350
|
+
fontSize: F.lg,
|
|
351
|
+
fontWeight: '700'
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
//# sourceMappingURL=NFCSubScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","useState","View","Text","StyleSheet","TouchableOpacity","Animated","Alert","NfcManager","NfcTech","Ndef","FPButton","C","R","S","F","styled","Svg","Path","Ionicons","PulseAnimation","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Container","Header","HeaderButton","HeaderCenter","HeaderRight","QuickLinksContainer","QuickLinksIcon","props","bg","QuickLinksText","LCAnimationContainer","LCIconContainer","LCIcon","StatusTextContainer","StatusText","NFCIcon","color","size","width","height","strokeWidth","viewBox","fill","children","d","stroke","strokeLinecap","strokeLinejoin","NFCSubScreen","amount","currency","onClose","onProcessTransaction","onError","phase","setPhase","msg","setMsg","iconScale","Value","current","sendMoney","wallet","console","log","tapToSend","start","requestTechnology","tag","getTag","ndefMessage","payload","Error","Uint8Array","text","decodePayload","JSON","parse","alert","style","onPress","e","message","code","cancelTechnologyRequest","then","catch","err","name","fontWeight","fontSize","transform","scale","marginTop","st","tapZone","tapError","tapEmoji","tapLabel","label","md","create","wrap","flex","padding","lg","back","brand","marginBottom","title","xl","ink","backgroundColor","borderRadius","justifyContent","alignItems","tapActive","tapSuccess","green","red","white","sm"],"sourceRoot":"../../../../../../src","sources":["ui/screens/sub/sendPayment/NFCSubScreen.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,SAASC,IAAI,EAAEC,IAAI,EAAEC,UAAU,EAAEC,gBAAgB,EAAEC,QAAQ,EAAEC,KAAK,QAAQ,cAAc;AACxF,OAAOC,UAAU,IAAIC,OAAO,EAAEC,IAAI,QAAQ,0BAA0B;AAEpE,SAASC,QAAQ,QAAQ,iCAA8B;AACvD,SAASC,CAAC,EAAEC,CAAC,EAAEC,CAAC,EAAEC,CAAC,QAAQ,yBAAgB;AAE3C,OAAOC,MAAM,MAAM,0BAA0B;AAC7C,OAAOC,GAAG,IAAIC,IAAI,QAAQ,kBAAkB;AAC5C,OAAOC,QAAQ,MAAM,oCAAoC;AACzD,SAASC,cAAc,QAAQ,uCAAoC;;AAEnE;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AACA,MAAMC,SAAS,GAAGX,MAAM,CAACd,IAAI,CAAC;AAC9B;AACA;AACA,CAAC;AAED,MAAM0B,MAAM,G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