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.
Files changed (155) hide show
  1. package/lib/module/FountainPayProvider.js +108 -18
  2. package/lib/module/FountainPayProvider.js.map +1 -1
  3. package/lib/module/core/api/client.js +13 -1
  4. package/lib/module/core/api/client.js.map +1 -1
  5. package/lib/module/core/api/index.js +66 -24
  6. package/lib/module/core/api/index.js.map +1 -1
  7. package/lib/module/engine/BLEReceiverService.js.map +1 -1
  8. package/lib/module/engine/BLESenderService.js.map +1 -1
  9. package/lib/module/engine/FPEngine.js +164 -43
  10. package/lib/module/engine/FPEngine.js.map +1 -1
  11. package/lib/module/engine/NearbyUsersService.js +1 -1
  12. package/lib/module/engine/NearbyUsersService.js.map +1 -1
  13. package/lib/module/index.js +1 -0
  14. package/lib/module/index.js.map +1 -1
  15. package/lib/module/store/FPStore.js +155 -0
  16. package/lib/module/store/FPStore.js.map +1 -0
  17. package/lib/module/ui/components/AnimatedDots.js +3 -3
  18. package/lib/module/ui/components/AnimatedDots.js.map +1 -1
  19. package/lib/module/ui/components/ConfirmScreen.js +137 -123
  20. package/lib/module/ui/components/ConfirmScreen.js.map +1 -1
  21. package/lib/module/ui/components/FPButton.js.map +1 -1
  22. package/lib/module/ui/components/LoadingAnimation/InLoading.js +3 -3
  23. package/lib/module/ui/components/LoadingAnimation/InLoading.js.map +1 -1
  24. package/lib/module/ui/components/LoadingAnimation/index.js +3 -3
  25. package/lib/module/ui/components/LoadingAnimation/index.js.map +1 -1
  26. package/lib/module/ui/components/OtpInput/OTPInputView.js +11 -11
  27. package/lib/module/ui/components/OtpInput/OTPInputView.js.map +1 -1
  28. package/lib/module/ui/components/OtpInput/Styles.js +1 -1
  29. package/lib/module/ui/components/OtpInput/helpers/codeToArray.js +1 -1
  30. package/lib/module/ui/components/OtpInput/helpers/device.js.map +1 -1
  31. package/lib/module/ui/components/OtpInput/helpers/styles.js.map +1 -1
  32. package/lib/module/ui/components/OtpInput/index.js +3 -1
  33. package/lib/module/ui/components/OtpInput/index.js.map +1 -1
  34. package/lib/module/ui/components/PulseAnimation.js +2 -2
  35. package/lib/module/ui/components/PulseAnimation.js.map +1 -1
  36. package/lib/module/ui/modals/FPPaymentRequestModal.js +8 -7
  37. package/lib/module/ui/modals/FPPaymentRequestModal.js.map +1 -1
  38. package/lib/module/ui/modals/FPShell.js +2 -0
  39. package/lib/module/ui/modals/FPShell.js.map +1 -1
  40. package/lib/module/ui/screens/ReceiveScreen.js +8 -9
  41. package/lib/module/ui/screens/ReceiveScreen.js.map +1 -1
  42. package/lib/module/ui/screens/SendScreen.js +43 -94
  43. package/lib/module/ui/screens/SendScreen.js.map +1 -1
  44. package/lib/module/ui/screens/styles.js +15 -3
  45. package/lib/module/ui/screens/styles.js.map +1 -1
  46. package/lib/module/ui/screens/sub/receivePayment/Nfc/index.js +4 -4
  47. package/lib/module/ui/screens/sub/receivePayment/Nfc/index.js.map +1 -1
  48. package/lib/module/ui/screens/sub/receivePayment/Qr/index.js +5 -5
  49. package/lib/module/ui/screens/sub/receivePayment/Qr/index.js.map +1 -1
  50. package/lib/module/ui/screens/sub/receivePayment/Transfer/index.js +10 -11
  51. package/lib/module/ui/screens/sub/receivePayment/Transfer/index.js.map +1 -1
  52. package/lib/module/ui/screens/sub/sendPayment/BluetoothSubScreen.js +31 -8
  53. package/lib/module/ui/screens/sub/sendPayment/BluetoothSubScreen.js.map +1 -1
  54. package/lib/module/ui/screens/sub/sendPayment/NFCSubScreen.js +12 -8
  55. package/lib/module/ui/screens/sub/sendPayment/NFCSubScreen.js.map +1 -1
  56. package/lib/module/ui/screens/sub/sendPayment/NQRSubScreen.js +17 -5
  57. package/lib/module/ui/screens/sub/sendPayment/NQRSubScreen.js.map +1 -1
  58. package/lib/module/ui/screens/sub/sendPayment/ProximitySubScreen.js +67 -35
  59. package/lib/module/ui/screens/sub/sendPayment/ProximitySubScreen.js.map +1 -1
  60. package/lib/module/ui/screens/sub/sendPayment/TransferSubScreen.js +110 -34
  61. package/lib/module/ui/screens/sub/sendPayment/TransferSubScreen.js.map +1 -1
  62. package/lib/module/ui/theme/index.js.map +1 -1
  63. package/lib/typescript/src/FountainPayProvider.d.ts +1 -1
  64. package/lib/typescript/src/FountainPayProvider.d.ts.map +1 -1
  65. package/lib/typescript/src/core/api/client.d.ts.map +1 -1
  66. package/lib/typescript/src/core/api/index.d.ts +42 -26
  67. package/lib/typescript/src/core/api/index.d.ts.map +1 -1
  68. package/lib/typescript/src/core/types/index.d.ts +53 -28
  69. package/lib/typescript/src/core/types/index.d.ts.map +1 -1
  70. package/lib/typescript/src/engine/BLEReceiverService.d.ts +2 -0
  71. package/lib/typescript/src/engine/BLEReceiverService.d.ts.map +1 -1
  72. package/lib/typescript/src/engine/BLESenderService.d.ts.map +1 -1
  73. package/lib/typescript/src/engine/FPEngine.d.ts +5 -3
  74. package/lib/typescript/src/engine/FPEngine.d.ts.map +1 -1
  75. package/lib/typescript/src/engine/useIsForeground.d.ts.map +1 -1
  76. package/lib/typescript/src/index.d.ts +2 -1
  77. package/lib/typescript/src/index.d.ts.map +1 -1
  78. package/lib/typescript/src/store/FPStore.d.ts +60 -0
  79. package/lib/typescript/src/store/FPStore.d.ts.map +1 -0
  80. package/lib/typescript/src/ui/components/AnimatedDots.d.ts.map +1 -1
  81. package/lib/typescript/src/ui/components/ConfirmScreen.d.ts +5 -5
  82. package/lib/typescript/src/ui/components/ConfirmScreen.d.ts.map +1 -1
  83. package/lib/typescript/src/ui/components/FPButton.d.ts +1 -1
  84. package/lib/typescript/src/ui/components/FPButton.d.ts.map +1 -1
  85. package/lib/typescript/src/ui/components/LoadingAnimation/InLoading.d.ts.map +1 -1
  86. package/lib/typescript/src/ui/components/LoadingAnimation/index.d.ts.map +1 -1
  87. package/lib/typescript/src/ui/components/OtpInput/OTPInputView.d.ts.map +1 -1
  88. package/lib/typescript/src/ui/components/OtpInput/helpers/codeToArray.d.ts.map +1 -1
  89. package/lib/typescript/src/ui/components/OtpInput/helpers/device.d.ts.map +1 -1
  90. package/lib/typescript/src/ui/components/OtpInput/helpers/styles.d.ts.map +1 -1
  91. package/lib/typescript/src/ui/components/OtpInput/helpers/types.d.ts +1 -2
  92. package/lib/typescript/src/ui/components/OtpInput/helpers/types.d.ts.map +1 -1
  93. package/lib/typescript/src/ui/components/OtpInput/index.d.ts +3 -1
  94. package/lib/typescript/src/ui/components/OtpInput/index.d.ts.map +1 -1
  95. package/lib/typescript/src/ui/components/PulseAnimation.d.ts.map +1 -1
  96. package/lib/typescript/src/ui/modals/FPPaymentRequestModal.d.ts.map +1 -1
  97. package/lib/typescript/src/ui/modals/FPShell.d.ts.map +1 -1
  98. package/lib/typescript/src/ui/screens/ReceiveScreen.d.ts +1 -1
  99. package/lib/typescript/src/ui/screens/ReceiveScreen.d.ts.map +1 -1
  100. package/lib/typescript/src/ui/screens/SendScreen.d.ts +1 -1
  101. package/lib/typescript/src/ui/screens/SendScreen.d.ts.map +1 -1
  102. package/lib/typescript/src/ui/screens/styles.d.ts +197 -0
  103. package/lib/typescript/src/ui/screens/styles.d.ts.map +1 -1
  104. package/lib/typescript/src/ui/screens/sub/receivePayment/Nfc/index.d.ts.map +1 -1
  105. package/lib/typescript/src/ui/screens/sub/receivePayment/Qr/index.d.ts.map +1 -1
  106. package/lib/typescript/src/ui/screens/sub/receivePayment/Transfer/index.d.ts.map +1 -1
  107. package/lib/typescript/src/ui/screens/sub/sendPayment/BluetoothSubScreen.d.ts.map +1 -1
  108. package/lib/typescript/src/ui/screens/sub/sendPayment/NFCSubScreen.d.ts +1 -1
  109. package/lib/typescript/src/ui/screens/sub/sendPayment/NFCSubScreen.d.ts.map +1 -1
  110. package/lib/typescript/src/ui/screens/sub/sendPayment/NQRSubScreen.d.ts +1 -1
  111. package/lib/typescript/src/ui/screens/sub/sendPayment/NQRSubScreen.d.ts.map +1 -1
  112. package/lib/typescript/src/ui/screens/sub/sendPayment/ProximitySubScreen.d.ts +1 -1
  113. package/lib/typescript/src/ui/screens/sub/sendPayment/ProximitySubScreen.d.ts.map +1 -1
  114. package/lib/typescript/src/ui/screens/sub/sendPayment/TransferSubScreen.d.ts +1 -1
  115. package/lib/typescript/src/ui/screens/sub/sendPayment/TransferSubScreen.d.ts.map +1 -1
  116. package/lib/typescript/src/ui/theme/index.d.ts.map +1 -1
  117. package/package.json +4 -4
  118. package/src/FountainPayProvider.tsx +163 -24
  119. package/src/core/api/client.ts +26 -4
  120. package/src/core/api/index.ts +170 -49
  121. package/src/core/types/index.ts +81 -48
  122. package/src/engine/BLEReceiverService.ts +86 -28
  123. package/src/engine/BLESenderService.ts +133 -69
  124. package/src/engine/FPEngine.ts +316 -97
  125. package/src/engine/NearbyUsersService.ts +6 -6
  126. package/src/engine/useIsForeground.ts +12 -12
  127. package/src/index.ts +10 -4
  128. package/src/store/FPStore.ts +216 -0
  129. package/src/ui/components/AnimatedDots.tsx +4 -5
  130. package/src/ui/components/ConfirmScreen.tsx +182 -169
  131. package/src/ui/components/FPButton.tsx +50 -9
  132. package/src/ui/components/LoadingAnimation/InLoading.tsx +23 -27
  133. package/src/ui/components/LoadingAnimation/index.tsx +3 -7
  134. package/src/ui/components/OtpInput/OTPInputView.tsx +254 -205
  135. package/src/ui/components/OtpInput/Styles.ts +1 -1
  136. package/src/ui/components/OtpInput/helpers/codeToArray.ts +2 -2
  137. package/src/ui/components/OtpInput/helpers/device.ts +4 -3
  138. package/src/ui/components/OtpInput/helpers/styles.ts +13 -14
  139. package/src/ui/components/OtpInput/helpers/types.ts +83 -79
  140. package/src/ui/components/OtpInput/index.tsx +18 -15
  141. package/src/ui/components/PulseAnimation.tsx +3 -5
  142. package/src/ui/modals/FPPaymentRequestModal.tsx +111 -28
  143. package/src/ui/modals/FPShell.tsx +60 -34
  144. package/src/ui/screens/ReceiveScreen.tsx +245 -84
  145. package/src/ui/screens/SendScreen.tsx +419 -167
  146. package/src/ui/screens/styles.ts +17 -5
  147. package/src/ui/screens/sub/receivePayment/Nfc/index.tsx +17 -25
  148. package/src/ui/screens/sub/receivePayment/Qr/index.tsx +21 -20
  149. package/src/ui/screens/sub/receivePayment/Transfer/index.tsx +34 -28
  150. package/src/ui/screens/sub/sendPayment/BluetoothSubScreen.tsx +135 -67
  151. package/src/ui/screens/sub/sendPayment/NFCSubScreen.tsx +188 -112
  152. package/src/ui/screens/sub/sendPayment/NQRSubScreen.tsx +102 -69
  153. package/src/ui/screens/sub/sendPayment/ProximitySubScreen.tsx +225 -99
  154. package/src/ui/screens/sub/sendPayment/TransferSubScreen.tsx +209 -89
  155. package/src/ui/theme/index.ts +14 -2
@@ -1,10 +1,22 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
- import { View, Text, StyleSheet, TouchableOpacity, Animated, Alert } from 'react-native';
2
+ import {
3
+ View,
4
+ Text,
5
+ StyleSheet,
6
+ TouchableOpacity,
7
+ Animated,
8
+ Alert,
9
+ } from 'react-native';
3
10
  import NfcManager, { NfcTech, Ndef } from 'react-native-nfc-manager';
4
11
  import { transferAPI } from '../../../../core/api';
5
12
  import { FPButton } from '../../../components/FPButton';
6
13
  import { C, R, S, F } from '../../../theme';
7
- import type { FPCurrency, FPError, FPTransaction, Props } from '../../../../core/types';
14
+ import type {
15
+ FPCurrency,
16
+ FPError,
17
+ FPTransaction,
18
+ Props,
19
+ } from '../../../../core/types';
8
20
  import styled from 'styled-components/native';
9
21
  import Svg, { Path } from 'react-native-svg';
10
22
  import Ionicons from 'react-native-vector-icons/Ionicons';
@@ -21,7 +33,7 @@ const Header = styled(View)`
21
33
  align-items: center;
22
34
  justify-content: space-between;
23
35
  padding: 12px 16px;
24
- position: absolute !important;
36
+ position: absolute;
25
37
  top: 40px;
26
38
  left: 0;
27
39
  right: 0;
@@ -31,7 +43,7 @@ const Header = styled(View)`
31
43
  shadow-offset: 0px 2px;
32
44
  shadow-opacity: 0.1;
33
45
  shadow-radius: 4px;
34
- z-index: 9999999999 !important;
46
+ z-index: 9999999999;
35
47
  `;
36
48
 
37
49
  const HeaderButton = styled(TouchableOpacity)`
@@ -65,7 +77,7 @@ const QuickLinksIcon = styled.TouchableOpacity<{ bg?: string }>`
65
77
  width: 96px;
66
78
  height: 96px;
67
79
  border-radius: 100%;
68
- background-color: ${props => props.bg || '#18181b'};
80
+ background-color: ${(props) => props.bg || '#18181b'};
69
81
  justify-content: center;
70
82
  align-items: center;
71
83
  margin-bottom: 16px;
@@ -86,7 +98,7 @@ const LCIconContainer = styled(Animated.View)`
86
98
  width: 140px;
87
99
  height: 140px;
88
100
  border-radius: 90px;
89
- background-color: #E8F5F1;
101
+ background-color: #e8f5f1;
90
102
  align-items: center;
91
103
  justify-content: center;
92
104
  margin-top: 24px;
@@ -110,37 +122,70 @@ const StatusText = styled.Text`
110
122
  margin-bottom: 8px;
111
123
  `;
112
124
 
113
- const NFCIcon =({ color = "#111", size = 22 })=>(
114
- <Svg width={size} height={size} strokeWidth="0.9" viewBox="0 0 24 24" fill="none" color={color}>
115
- <Path d="M12 19.51L12.01 19.4989" stroke="#fff" strokeWidth="0.9" strokeLinecap="round" strokeLinejoin="round" />
116
- <Path d="M2 8C8 3.5 16 3.5 22 8" stroke="#fff" strokeWidth="0.9" strokeLinecap="round" strokeLinejoin="round" />
117
- <Path d="M5 12C9 9 15 9 19 12" stroke="#fff" strokeWidth="0.9" strokeLinecap="round" strokeLinejoin="round" />
118
- <Path d="M8.5 15.5C10.7504 14.1 13.2498 14.0996 15.5001 15.5" stroke="#fff" strokeWidth="0.9" strokeLinecap="round" strokeLinejoin="round" />
119
- </Svg>
120
- )
121
-
125
+ const NFCIcon = ({ color = '#111', size = 22 }) => (
126
+ <Svg
127
+ width={size}
128
+ height={size}
129
+ strokeWidth="0.9"
130
+ viewBox="0 0 24 24"
131
+ fill="none"
132
+ color={color}
133
+ >
134
+ <Path
135
+ d="M12 19.51L12.01 19.4989"
136
+ stroke="#fff"
137
+ strokeWidth="0.9"
138
+ strokeLinecap="round"
139
+ strokeLinejoin="round"
140
+ />
141
+ <Path
142
+ d="M2 8C8 3.5 16 3.5 22 8"
143
+ stroke="#fff"
144
+ strokeWidth="0.9"
145
+ strokeLinecap="round"
146
+ strokeLinejoin="round"
147
+ />
148
+ <Path
149
+ d="M5 12C9 9 15 9 19 12"
150
+ stroke="#fff"
151
+ strokeWidth="0.9"
152
+ strokeLinecap="round"
153
+ strokeLinejoin="round"
154
+ />
155
+ <Path
156
+ d="M8.5 15.5C10.7504 14.1 13.2498 14.0996 15.5001 15.5"
157
+ stroke="#fff"
158
+ strokeWidth="0.9"
159
+ strokeLinecap="round"
160
+ strokeLinejoin="round"
161
+ />
162
+ </Svg>
163
+ );
122
164
 
123
165
  interface PropT {
124
166
  mode: 'send' | 'receive';
125
- amount?: number; currency?: FPCurrency;
126
- myWallet?: { accountName: string;
127
- accountNumber: string;
128
- bankCode: string;
129
- bankName: string
167
+ amount?: number;
168
+ currency?: FPCurrency;
169
+ myWallet?: {
170
+ accountName: string;
171
+ accountNumber: string;
172
+ bankCode: string;
173
+ bankName: string;
130
174
  };
131
175
  onDone: () => void;
132
- onSuccess?: (tx: FPTransaction) => void; onError?: (err: FPError) => void;
176
+ onSuccess?: (tx: FPTransaction) => void;
177
+ onError?: (err: FPError) => void;
133
178
  }
134
179
 
135
180
  type Phase = 'idle' | 'active' | 'success' | 'error';
136
181
 
137
182
  export function NFCSubScreen({
138
- amount,
183
+ amount,
139
184
  currency,
140
- onClose,
141
- onProcessTransaction,
142
- onError
143
- }: Props) {
185
+ onClose,
186
+ onProcessTransaction,
187
+ onError,
188
+ }: Props) {
144
189
  const [phase, setPhase] = useState<Phase>('idle');
145
190
  const [msg, setMsg] = useState('');
146
191
  const iconScale = useRef(new Animated.Value(1)).current;
@@ -159,23 +204,23 @@ export function NFCSubScreen({
159
204
  // };
160
205
 
161
206
  const sendMoney = async (wallet: any) => {
162
-
163
207
  console.log('NFC details:', wallet);
164
208
  onProcessTransaction?.(wallet as any);
165
- }
166
-
209
+ };
167
210
 
168
- const tapToSend = async () => {
211
+ const tapToScan = async () => {
169
212
  setPhase('active');
170
213
  try {
171
- await NfcManager.start();
214
+ // await NfcManager.start();
172
215
  await NfcManager.requestTechnology(NfcTech.Ndef);
173
216
  const tag = await NfcManager.getTag();
174
- if (!tag?.ndefMessage?.[0]?.payload) throw new Error('No wallet data on tag');
217
+ if (!tag?.ndefMessage?.[0]?.payload)
218
+ throw new Error('No wallet data on tag');
175
219
  const payload = new Uint8Array(tag.ndefMessage[0].payload);
176
220
  const text = Ndef.text.decodePayload(payload);
177
221
  const wallet = JSON.parse(text);
178
- setPhase('success'); setMsg('NFC scanned!');
222
+ setPhase('success');
223
+ setMsg('NFC scanned!');
179
224
  Alert.alert(
180
225
  'NFC Scanned',
181
226
  `Would you love to continue with this transaction?`,
@@ -190,13 +235,17 @@ export function NFCSubScreen({
190
235
  },
191
236
  ]
192
237
  );
193
-
194
- } catch (e: any) {
195
- setPhase('error');
196
- setMsg(e.message);
197
- onError?.({ code: 'NFC_ERROR', message: e.message });
238
+ } catch (e: any) {
239
+ if (e.message?.toLowerCase().includes('cancel')) {
240
+ setPhase('idle');
241
+ return;
242
+ }
243
+ setPhase('error');
244
+ setMsg(e.message);
245
+ onError?.({ code: 'NFC_ERROR', message: e.message });
246
+ } finally {
247
+ NfcManager.cancelTechnologyRequest();
198
248
  }
199
- finally { NfcManager.cancelTechnologyRequest(); }
200
249
  };
201
250
 
202
251
  useEffect(() => {
@@ -204,99 +253,126 @@ export function NFCSubScreen({
204
253
  .then(() => console.log('NFC Manager started'))
205
254
  .catch((err: any) => {
206
255
  console.log('NFC start error:', err);
207
- setPhase('error');
256
+ setPhase('error');
208
257
  setMsg(err.message);
209
258
  onError?.({ code: 'NFC_ERROR', message: err.message });
210
259
  });
211
-
260
+
212
261
  return () => {
213
262
  NfcManager.cancelTechnologyRequest().catch(() => {});
214
263
  };
215
264
  }, []);
216
-
217
- return (
218
-
219
265
 
266
+ return (
220
267
  <Container>
221
-
222
268
  {/* Header */}
223
- <Header>
224
- <HeaderButton onPress={onClose}>
225
- <Ionicons name="close" size={24} />
269
+ <Header>
270
+ <HeaderButton onPress={onClose}>
271
+ <Ionicons name="close" size={24} />
272
+ </HeaderButton>
273
+
274
+ <HeaderCenter>
275
+ <Text style={{ fontWeight: 'bold', fontSize: 16, color: '#FFF' }}>
276
+ NFC
277
+ </Text>
278
+ <Text style={{ fontSize: 10, color: '#FFF' }}>Transfer</Text>
279
+ </HeaderCenter>
280
+
281
+ <HeaderRight>
282
+ <HeaderButton>
283
+ <Ionicons name="image-outline" size={22} />
226
284
  </HeaderButton>
227
-
228
- <HeaderCenter>
229
- <Text style={{ fontWeight: 'bold', fontSize: 16, color:'#FFF' }}>NFC</Text>
230
- <Text style={{ fontSize: 10, color: '#FFF' }}>Transfer</Text>
231
- </HeaderCenter>
232
-
233
- <HeaderRight>
234
- <HeaderButton>
235
- <Ionicons name="image-outline" size={22} />
236
- </HeaderButton>
237
- <HeaderButton>
238
- <Ionicons name="settings-outline" size={22} />
239
- </HeaderButton>
240
- </HeaderRight>
241
- </Header>
285
+ <HeaderButton>
286
+ <Ionicons name="settings-outline" size={22} />
287
+ </HeaderButton>
288
+ </HeaderRight>
289
+ </Header>
290
+
291
+ <QuickLinksContainer>
292
+ {phase === 'idle' ? (
293
+ <>
294
+ <QuickLinksIcon
295
+ onPress={() => {
296
+ tapToScan();
297
+ }}
298
+ >
299
+ <NFCIcon size={40} color="#FFF" />
300
+ </QuickLinksIcon>
301
+ <QuickLinksText>Start NFC Scan</QuickLinksText>
302
+ </>
303
+ ) : phase === 'active' ? (
304
+ <LCAnimationContainer>
305
+ <PulseAnimation />
306
+ <LCIconContainer
307
+ style={{ transform: [{ scale: iconScale }], marginTop: 64 }}
308
+ >
309
+ <LCIcon>📡</LCIcon>
310
+ </LCIconContainer>
242
311
 
243
- <QuickLinksContainer>
244
- {phase === 'idle' ? (
245
- <>
246
- <QuickLinksIcon onPress={()=>{tapToSend()}}>
247
- <NFCIcon size={40} color="#FFF" />
248
- </QuickLinksIcon>
249
- <QuickLinksText>Start NFC Scan</QuickLinksText>
250
- </>
251
- )
252
- : phase === 'active' ? (
253
- <LCAnimationContainer>
254
- <PulseAnimation />
255
- <LCIconContainer style={{ transform: [{ scale: iconScale }], marginTop: 64 }}>
256
- <LCIcon>📡</LCIcon>
257
- </LCIconContainer>
258
-
259
- <StatusTextContainer>
260
- <StatusText>
261
- Searching for nearby users
262
- </StatusText>
263
- {/* <StatusSubText>Hold devices back-to-back</StatusSubText> */}
264
- </StatusTextContainer>
265
- </LCAnimationContainer>
266
- )
267
- : phase === 'success' ? (
268
- <>
269
- <QuickLinksIcon bg="#057e32" onPress={()=>{tapToSend()}}>
270
- <Ionicons name="checkmark" size={40} color="#FFF" />
271
- </QuickLinksIcon>
272
- <QuickLinksText>NFC Scanned</QuickLinksText>
273
- </>
274
- )
275
- : (
276
- <>
277
- <View style={[st.tapZone, st.tapError]}>
278
- <Text style={st.tapEmoji}>{'ERR'}</Text>
279
- <Text style={st.tapLabel}>
280
- {msg}
281
- </Text>
282
- </View>
283
- <FPButton label="Try Again" onPress={() => setPhase('idle')} style={{ marginTop: S.md }} />
284
- </>
285
- )}
286
-
287
- </QuickLinksContainer>
312
+ <StatusTextContainer>
313
+ <StatusText>Searching for nearby users</StatusText>
314
+ {/* <StatusSubText>Hold devices back-to-back</StatusSubText> */}
315
+ </StatusTextContainer>
316
+ </LCAnimationContainer>
317
+ ) : phase === 'success' ? (
318
+ <>
319
+ <QuickLinksIcon
320
+ bg="#057e32"
321
+ onPress={() => {
322
+ tapToScan();
323
+ }}
324
+ >
325
+ <Ionicons name="checkmark" size={40} color="#FFF" />
326
+ </QuickLinksIcon>
327
+ <QuickLinksText>NFC Scanned</QuickLinksText>
328
+ </>
329
+ ) : (
330
+ <>
331
+ <View style={[st.tapZone, st.tapError]}>
332
+ <Text style={st.tapEmoji}>{'ERR'}</Text>
333
+ <Text style={st.tapLabel}>{msg}</Text>
334
+ </View>
335
+ <FPButton
336
+ label="Try Again"
337
+ onPress={() => setPhase('idle')}
338
+ style={{ marginTop: S.md }}
339
+ />
340
+ </>
341
+ )}
342
+ </QuickLinksContainer>
288
343
  </Container>
289
344
  );
290
345
  }
291
346
 
292
347
  const st = StyleSheet.create({
293
348
  wrap: { flex: 1, padding: S.lg },
294
- back: { color: C.brand, fontSize: F.md, fontWeight: '600', marginBottom: S.md },
295
- title: { fontSize: F.xl, fontWeight: '800', color: C.ink, marginBottom: S.lg },
296
- tapZone: { height: 180, backgroundColor: C.ink, borderRadius: R.xl, justifyContent: 'center', alignItems: 'center' },
349
+ back: {
350
+ color: C.brand,
351
+ fontSize: F.md,
352
+ fontWeight: '600',
353
+ marginBottom: S.md,
354
+ },
355
+ title: {
356
+ fontSize: F.xl,
357
+ fontWeight: '800',
358
+ color: C.ink,
359
+ marginBottom: S.lg,
360
+ },
361
+ tapZone: {
362
+ height: 180,
363
+ backgroundColor: C.ink,
364
+ borderRadius: R.xl,
365
+ justifyContent: 'center',
366
+ alignItems: 'center',
367
+ },
297
368
  tapActive: { backgroundColor: C.brand },
298
369
  tapSuccess: { backgroundColor: C.green },
299
370
  tapError: { backgroundColor: C.red },
300
- tapEmoji: { fontSize: 40, color: C.white, fontWeight: '800', marginBottom: S.sm },
371
+ tapEmoji: {
372
+ fontSize: 40,
373
+ color: C.white,
374
+ fontWeight: '800',
375
+ marginBottom: S.sm,
376
+ },
301
377
  tapLabel: { color: C.white, fontSize: F.lg, fontWeight: '700' },
302
378
  });