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.
Files changed (120) hide show
  1. package/lib/module/FountainPayProvider.js +5 -1
  2. package/lib/module/FountainPayProvider.js.map +1 -1
  3. package/lib/module/core/api/index.js +22 -12
  4. package/lib/module/core/api/index.js.map +1 -1
  5. package/lib/module/engine/BLEReceiverService.js.map +1 -1
  6. package/lib/module/engine/FPEngine.js +24 -13
  7. package/lib/module/engine/FPEngine.js.map +1 -1
  8. package/lib/module/engine/useIsForeground.js +17 -0
  9. package/lib/module/engine/useIsForeground.js.map +1 -0
  10. package/lib/module/ui/components/AnimatedDots.js +68 -0
  11. package/lib/module/ui/components/AnimatedDots.js.map +1 -0
  12. package/lib/module/ui/components/ConfirmScreen.js +333 -0
  13. package/lib/module/ui/components/ConfirmScreen.js.map +1 -0
  14. package/lib/module/ui/modals/FPPaymentRequestModal.js +6 -8
  15. package/lib/module/ui/modals/FPPaymentRequestModal.js.map +1 -1
  16. package/lib/module/ui/modals/FPShell.js +7 -4
  17. package/lib/module/ui/modals/FPShell.js.map +1 -1
  18. package/lib/module/ui/screens/ReceiveScreen.js +379 -274
  19. package/lib/module/ui/screens/ReceiveScreen.js.map +1 -1
  20. package/lib/module/ui/screens/SendScreen.js +154 -45
  21. package/lib/module/ui/screens/SendScreen.js.map +1 -1
  22. package/lib/module/ui/screens/styles.js +89 -0
  23. package/lib/module/ui/screens/styles.js.map +1 -0
  24. package/lib/module/ui/screens/sub/receivePayment/Nfc/index.js +361 -0
  25. package/lib/module/ui/screens/sub/receivePayment/Nfc/index.js.map +1 -0
  26. package/lib/module/ui/screens/sub/receivePayment/Qr/index.js +338 -0
  27. package/lib/module/ui/screens/sub/receivePayment/Qr/index.js.map +1 -0
  28. package/lib/module/ui/screens/sub/receivePayment/Transfer/index.js +453 -0
  29. package/lib/module/ui/screens/sub/receivePayment/Transfer/index.js.map +1 -0
  30. package/lib/module/ui/screens/sub/{BluetoothSubScreen.js → sendPayment/BluetoothSubScreen.js} +25 -32
  31. package/lib/module/ui/screens/sub/sendPayment/BluetoothSubScreen.js.map +1 -0
  32. package/lib/module/ui/screens/sub/sendPayment/NFCSubScreen.js +354 -0
  33. package/lib/module/ui/screens/sub/sendPayment/NFCSubScreen.js.map +1 -0
  34. package/lib/module/ui/screens/sub/sendPayment/NQRSubScreen.js +440 -0
  35. package/lib/module/ui/screens/sub/sendPayment/NQRSubScreen.js.map +1 -0
  36. package/lib/module/ui/screens/sub/{ProximitySubScreen.js → sendPayment/ProximitySubScreen.js} +20 -111
  37. package/lib/module/ui/screens/sub/sendPayment/ProximitySubScreen.js.map +1 -0
  38. package/lib/module/ui/screens/sub/sendPayment/TransferSubScreen.js +327 -0
  39. package/lib/module/ui/screens/sub/sendPayment/TransferSubScreen.js.map +1 -0
  40. package/lib/typescript/src/FountainPayProvider.d.ts.map +1 -1
  41. package/lib/typescript/src/core/api/index.d.ts +20 -27
  42. package/lib/typescript/src/core/api/index.d.ts.map +1 -1
  43. package/lib/typescript/src/core/types/index.d.ts +56 -13
  44. package/lib/typescript/src/core/types/index.d.ts.map +1 -1
  45. package/lib/typescript/src/engine/BLEReceiverService.d.ts +2 -0
  46. package/lib/typescript/src/engine/BLEReceiverService.d.ts.map +1 -1
  47. package/lib/typescript/src/engine/FPEngine.d.ts +3 -1
  48. package/lib/typescript/src/engine/FPEngine.d.ts.map +1 -1
  49. package/lib/typescript/src/engine/useIsForeground.d.ts +2 -0
  50. package/lib/typescript/src/engine/useIsForeground.d.ts.map +1 -0
  51. package/lib/typescript/src/ui/components/AnimatedDots.d.ts +2 -0
  52. package/lib/typescript/src/ui/components/AnimatedDots.d.ts.map +1 -0
  53. package/lib/typescript/src/ui/components/ConfirmScreen.d.ts +10 -0
  54. package/lib/typescript/src/ui/components/ConfirmScreen.d.ts.map +1 -0
  55. package/lib/typescript/src/ui/components/OtpInput/Styles.d.ts +3 -3
  56. package/lib/typescript/src/ui/modals/FPPaymentRequestModal.d.ts.map +1 -1
  57. package/lib/typescript/src/ui/modals/FPShell.d.ts.map +1 -1
  58. package/lib/typescript/src/ui/screens/ReceiveScreen.d.ts +2 -9
  59. package/lib/typescript/src/ui/screens/ReceiveScreen.d.ts.map +1 -1
  60. package/lib/typescript/src/ui/screens/SendScreen.d.ts +4 -2
  61. package/lib/typescript/src/ui/screens/SendScreen.d.ts.map +1 -1
  62. package/lib/typescript/src/ui/screens/styles.d.ts +1390 -0
  63. package/lib/typescript/src/ui/screens/styles.d.ts.map +1 -0
  64. package/lib/typescript/src/ui/screens/sub/receivePayment/Nfc/index.d.ts +10 -0
  65. package/lib/typescript/src/ui/screens/sub/receivePayment/Nfc/index.d.ts.map +1 -0
  66. package/lib/typescript/src/ui/screens/sub/receivePayment/Qr/index.d.ts +10 -0
  67. package/lib/typescript/src/ui/screens/sub/receivePayment/Qr/index.d.ts.map +1 -0
  68. package/lib/typescript/src/ui/screens/sub/receivePayment/Transfer/index.d.ts +5 -0
  69. package/lib/typescript/src/ui/screens/sub/receivePayment/Transfer/index.d.ts.map +1 -0
  70. package/lib/typescript/src/ui/screens/sub/{BluetoothSubScreen.d.ts → sendPayment/BluetoothSubScreen.d.ts} +2 -11
  71. package/lib/typescript/src/ui/screens/sub/sendPayment/BluetoothSubScreen.d.ts.map +1 -0
  72. package/lib/typescript/src/ui/screens/sub/sendPayment/NFCSubScreen.d.ts +3 -0
  73. package/lib/typescript/src/ui/screens/sub/sendPayment/NFCSubScreen.d.ts.map +1 -0
  74. package/lib/typescript/src/ui/screens/sub/sendPayment/NQRSubScreen.d.ts +3 -0
  75. package/lib/typescript/src/ui/screens/sub/sendPayment/NQRSubScreen.d.ts.map +1 -0
  76. package/lib/typescript/src/ui/screens/sub/{ProximitySubScreen.d.ts → sendPayment/ProximitySubScreen.d.ts} +2 -10
  77. package/lib/typescript/src/ui/screens/sub/sendPayment/ProximitySubScreen.d.ts.map +1 -0
  78. package/lib/typescript/src/ui/screens/sub/sendPayment/TransferSubScreen.d.ts +3 -0
  79. package/lib/typescript/src/ui/screens/sub/sendPayment/TransferSubScreen.d.ts.map +1 -0
  80. package/package.json +1 -1
  81. package/src/FountainPayProvider.tsx +7 -1
  82. package/src/core/api/index.ts +34 -19
  83. package/src/core/types/index.ts +67 -13
  84. package/src/engine/BLEReceiverService.ts +2 -0
  85. package/src/engine/FPEngine.ts +29 -14
  86. package/src/engine/useIsForeground.ts +18 -0
  87. package/src/ui/components/AnimatedDots.tsx +81 -0
  88. package/src/ui/components/ConfirmScreen.tsx +421 -0
  89. package/src/ui/modals/FPPaymentRequestModal.tsx +7 -6
  90. package/src/ui/modals/FPShell.tsx +9 -9
  91. package/src/ui/screens/ReceiveScreen.tsx +266 -115
  92. package/src/ui/screens/SendScreen.tsx +141 -19
  93. package/src/ui/screens/styles.ts +101 -0
  94. package/src/ui/screens/sub/receivePayment/Nfc/index.tsx +418 -0
  95. package/src/ui/screens/sub/receivePayment/Qr/index.tsx +391 -0
  96. package/src/ui/screens/sub/receivePayment/Transfer/index.tsx +512 -0
  97. package/src/ui/screens/sub/{BluetoothSubScreen.tsx → sendPayment/BluetoothSubScreen.tsx} +27 -46
  98. package/src/ui/screens/sub/sendPayment/NFCSubScreen.tsx +302 -0
  99. package/src/ui/screens/sub/sendPayment/NQRSubScreen.tsx +490 -0
  100. package/src/ui/screens/sub/{ProximitySubScreen.tsx → sendPayment/ProximitySubScreen.tsx} +24 -44
  101. package/src/ui/screens/sub/sendPayment/TransferSubScreen.tsx +345 -0
  102. package/lib/module/ui/screens/sub/BluetoothSubScreen.js.map +0 -1
  103. package/lib/module/ui/screens/sub/NFCSubScreen.js +0 -164
  104. package/lib/module/ui/screens/sub/NFCSubScreen.js.map +0 -1
  105. package/lib/module/ui/screens/sub/NQRSubScreen.js +0 -131
  106. package/lib/module/ui/screens/sub/NQRSubScreen.js.map +0 -1
  107. package/lib/module/ui/screens/sub/ProximitySubScreen.js.map +0 -1
  108. package/lib/module/ui/screens/sub/TransferSubScreen.js +0 -353
  109. package/lib/module/ui/screens/sub/TransferSubScreen.js.map +0 -1
  110. package/lib/typescript/src/ui/screens/sub/BluetoothSubScreen.d.ts.map +0 -1
  111. package/lib/typescript/src/ui/screens/sub/NFCSubScreen.d.ts +0 -18
  112. package/lib/typescript/src/ui/screens/sub/NFCSubScreen.d.ts.map +0 -1
  113. package/lib/typescript/src/ui/screens/sub/NQRSubScreen.d.ts +0 -12
  114. package/lib/typescript/src/ui/screens/sub/NQRSubScreen.d.ts.map +0 -1
  115. package/lib/typescript/src/ui/screens/sub/ProximitySubScreen.d.ts.map +0 -1
  116. package/lib/typescript/src/ui/screens/sub/TransferSubScreen.d.ts +0 -11
  117. package/lib/typescript/src/ui/screens/sub/TransferSubScreen.d.ts.map +0 -1
  118. package/src/ui/screens/sub/NFCSubScreen.tsx +0 -86
  119. package/src/ui/screens/sub/NQRSubScreen.tsx +0 -62
  120. package/src/ui/screens/sub/TransferSubScreen.tsx +0 -147
@@ -1,289 +1,394 @@
1
1
  "use strict";
2
2
 
3
3
  import React, { useState } from 'react';
4
- import { View, Text, TouchableOpacity, StyleSheet, ScrollView } from 'react-native';
5
- import { C, R, S, F, shadow } from "../theme/index.js";
6
- import { NQRSubScreen } from "./sub/NQRSubScreen.js";
7
- import { NFCSubScreen } from "./sub/NFCSubScreen.js";
4
+ import { View, Text, TextInput, TouchableOpacity, Dimensions, ScrollView } from 'react-native';
5
+ import styled from 'styled-components/native';
6
+ import Ionicons from 'react-native-vector-icons/Ionicons';
7
+ import Svg, { Path } from "react-native-svg";
8
+ import Transfer from "./sub/receivePayment/Transfer/index.js";
9
+ import Qr from "./sub/receivePayment/Qr/index.js";
10
+ import Nfc from "./sub/receivePayment/Nfc/index.js";
8
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
- const CHANNELS = [{
10
- id: 'transfer',
11
- emoji: '🏦',
12
- title: 'Bank Transfer',
13
- desc: 'Share your account number'
14
- }, {
15
- id: 'nqr',
16
- emoji: '⬛',
17
- title: 'NQR Code',
18
- desc: 'Generate a QR for others to scan'
19
- }, {
20
- id: 'nfc',
21
- emoji: '📲',
22
- title: 'NFC Tap',
23
- desc: 'Let someone tap to pay you'
24
- }];
25
- export function ReceiveScreen({
12
+ const {
13
+ width,
14
+ height
15
+ } = Dimensions.get('window');
16
+
17
+ // Styled Components
18
+ const Container = styled(View)`
19
+ flex: 1;
20
+ background-color: #000000;
21
+ `;
22
+
23
+ // Bottom Sheet Styles
24
+ const BottomSheet = styled(View)`
25
+ position: absolute;
26
+ bottom: 0;
27
+ left: 0;
28
+ right: 0;
29
+ background-color: #ffffff;
30
+ border-top-left-radius: 24px;
31
+ border-top-right-radius: 24px;
32
+ padding: 20px 20px 32px;
33
+ elevation: 20;
34
+ shadow-color: #000;
35
+ shadow-offset: 0px -4px;
36
+ shadow-opacity: 0.15;
37
+ shadow-radius: 12px;
38
+ max-height: ${height * 0.5}px;
39
+ `;
40
+ const SheetHandle = styled(View)`
41
+ width: 40px;
42
+ height: 4px;
43
+ background-color: #d1d5db;
44
+ border-radius: 2px;
45
+ align-self: center;
46
+ margin-bottom: 20px;
47
+ `;
48
+ const SheetScrollView = styled(ScrollView)`
49
+ flex: 1;
50
+ `;
51
+ const SectionTitle = styled(Text)`
52
+ font-size: 18px;
53
+ font-weight: 700;
54
+ color: #1f2937;
55
+ margin-bottom: 16px;
56
+ `;
57
+ const ActionsRow = styled(View)`
58
+ flex-direction: row;
59
+ gap: 16px;
60
+ margin-bottom: 24px;
61
+ `;
62
+ const ActionButton = styled(TouchableOpacity)`
63
+ align-items: center;
64
+ gap: 8px;
65
+ flex: 1;
66
+ `;
67
+ const ActionIconContainer = styled(View)`
68
+ width: 56px;
69
+ height: 56px;
70
+ border-radius: 100%;
71
+ background-color: ${props => props.color};
72
+ justify-content: center;
73
+ align-items: center;
74
+ elevation: 3;
75
+ shadow-color: #000;
76
+ shadow-offset: 0px 2px;
77
+ shadow-opacity: 0.12;
78
+ shadow-radius: 4px;
79
+ `;
80
+ const ActionLabel = styled(Text)`
81
+ font-size: 11px;
82
+ color: #374151;
83
+ text-align: center;
84
+ line-height: 14px;
85
+ `;
86
+ const SearchContainer = styled(View)`
87
+ flex-direction: row;
88
+ align-items: center;
89
+ background-color: #f9fafb;
90
+ border-radius: 12px;
91
+ padding: 14px 16px;
92
+ margin-bottom: 24px;
93
+ border: 1px solid #e5e7eb;
94
+ `;
95
+ const SearchInput = styled(TextInput)`
96
+ flex: 1;
97
+ margin-left: 10px;
98
+ font-size: 14px;
99
+ color: #1f2937;
100
+ padding: 0;
101
+ `;
102
+ const AddContactButton = styled.TouchableOpacity`
103
+ align-items: center;
104
+ margin-right: 20px;
105
+
106
+ flex-direction: row;
107
+ gap: 20px;
108
+
109
+ `;
110
+ const Icon = styled(Text)`
111
+ font-size: ${props => props.size || 24}px;
112
+ color: ${props => props.color || '#000000'};
113
+ `;
114
+ const AddCircle = styled.View`
115
+ width: 44px;
116
+ height: 44px;
117
+ border-radius: 32px;
118
+ background-color: #fff;
119
+ border-width: 2px;
120
+ border-color: #e0e0e0;
121
+ border-style: dashed;
122
+ justify-content: center;
123
+ align-items: center;
124
+ margin-bottom: 8px;
125
+ `;
126
+ const ContactName = styled.Text`
127
+ font-size: 12px;
128
+ color: #000;
129
+ `;
130
+ const ScanIcon = ({
131
+ color = "#111",
132
+ size = 22
133
+ }) => /*#__PURE__*/_jsxs(Svg, {
134
+ width: size,
135
+ height: size,
136
+ strokeWidth: "0.9",
137
+ viewBox: "0 0 24 24",
138
+ fill: "none",
139
+ color: color,
140
+ children: [/*#__PURE__*/_jsx(Path, {
141
+ d: "M6 3H3V6",
142
+ stroke: "#000000",
143
+ strokeWidth: "0.9",
144
+ strokeLinecap: "round",
145
+ strokeLinejoin: "round"
146
+ }), /*#__PURE__*/_jsx(Path, {
147
+ d: "M2 12H12L22 12",
148
+ stroke: "#000000",
149
+ strokeWidth: "0.9",
150
+ strokeLinecap: "round",
151
+ strokeLinejoin: "round"
152
+ }), /*#__PURE__*/_jsx(Path, {
153
+ d: "M9 19V17V15",
154
+ stroke: "#000000",
155
+ strokeWidth: "0.9",
156
+ strokeLinecap: "round",
157
+ strokeLinejoin: "round"
158
+ }), /*#__PURE__*/_jsx(Path, {
159
+ d: "M12 16V15.5V15",
160
+ stroke: "#000000",
161
+ strokeWidth: "0.9",
162
+ strokeLinecap: "round",
163
+ strokeLinejoin: "round"
164
+ }), /*#__PURE__*/_jsx(Path, {
165
+ d: "M15 17V16V15",
166
+ stroke: "#000000",
167
+ strokeWidth: "0.9",
168
+ strokeLinecap: "round",
169
+ strokeLinejoin: "round"
170
+ }), /*#__PURE__*/_jsx(Path, {
171
+ d: "M12 21V19.5V18",
172
+ stroke: "#000000",
173
+ strokeWidth: "0.9",
174
+ strokeLinecap: "round",
175
+ strokeLinejoin: "round"
176
+ }), /*#__PURE__*/_jsx(Path, {
177
+ d: "M18 3H21V6",
178
+ stroke: "#000000",
179
+ strokeWidth: "0.9",
180
+ strokeLinecap: "round",
181
+ strokeLinejoin: "round"
182
+ }), /*#__PURE__*/_jsx(Path, {
183
+ d: "M6 21H3V18",
184
+ stroke: "#000000",
185
+ strokeWidth: "0.9",
186
+ strokeLinecap: "round",
187
+ strokeLinejoin: "round"
188
+ }), /*#__PURE__*/_jsx(Path, {
189
+ d: "M18 21H21V18",
190
+ stroke: "#000000",
191
+ strokeWidth: "0.9",
192
+ strokeLinecap: "round",
193
+ strokeLinejoin: "round"
194
+ })]
195
+ });
196
+ const BluetoothIcon = ({
197
+ color = "#111",
198
+ size = 22
199
+ }) => /*#__PURE__*/_jsxs(Svg, {
200
+ width: size,
201
+ height: size,
202
+ strokeWidth: "0.9",
203
+ viewBox: "0 0 24 24",
204
+ fill: "none",
205
+ color: color,
206
+ children: [/*#__PURE__*/_jsx(Path, {
207
+ d: "M6 19.0007C3.57111 17.1763 2 14.2716 2 11C2 5.47715 6.47715 1 12 1C17.5228 1 22 5.47715 22 11C22 14.2716 20.4289 17.1763 18 19.0007",
208
+ stroke: "#fff",
209
+ strokeWidth: "0.9",
210
+ strokeLinecap: "round",
211
+ strokeLinejoin: "round"
212
+ }), /*#__PURE__*/_jsx(Path, {
213
+ d: "M6 19.0007C3.57111 17.1763 2 14.2716 2 11C2 5.47715 6.47715 1 12 1C17.5228 1 22 5.47715 22 11C22 14.2716 20.4289 17.1763 18 19.0007",
214
+ stroke: "#fff",
215
+ strokeWidth: "0.9",
216
+ strokeLinecap: "round",
217
+ strokeLinejoin: "round"
218
+ }), /*#__PURE__*/_jsx(Path, {
219
+ d: "M7.52779 15C6.57771 13.9385 6 12.5367 6 11C6 7.68629 8.68629 5 12 5C15.3137 5 18 7.68629 18 11C18 12.5367 17.4223 13.9385 16.4722 15",
220
+ stroke: "#fff",
221
+ strokeWidth: "0.9",
222
+ strokeLinecap: "round",
223
+ strokeLinejoin: "round"
224
+ }), /*#__PURE__*/_jsx(Path, {
225
+ fillRule: "evenodd",
226
+ clipRule: "evenodd",
227
+ d: "M9.25 11C9.25 9.48122 10.4812 8.25 12 8.25C13.5188 8.25 14.75 9.48122 14.75 11C14.75 12.5188 13.5188 13.75 12 13.75C10.4812 13.75 9.25 12.5188 9.25 11Z",
228
+ fill: "#fff"
229
+ }), /*#__PURE__*/_jsx(Path, {
230
+ d: "M15.0776 21.4865C14.8566 22.8126 13.7093 23.7844 12.365 23.7844H11.7536C10.4093 23.7844 9.262 22.8126 9.041 21.4865L8.53213 18.4333C8.29232 16.9946 9.43086 15.8854 10.5339 15.15C11.9123 14.231 12.3864 14.3406 13.5847 15.1396C14.6421 15.8445 15.8263 16.9946 15.5865 18.4333L15.0776 21.4865Z",
231
+ fill: "#fff"
232
+ })]
233
+ });
234
+ const NFCIcon = ({
235
+ color = "#111",
236
+ size = 22
237
+ }) => /*#__PURE__*/_jsxs(Svg, {
238
+ width: size,
239
+ height: size,
240
+ strokeWidth: "0.9",
241
+ viewBox: "0 0 24 24",
242
+ fill: "none",
243
+ color: color,
244
+ children: [/*#__PURE__*/_jsx(Path, {
245
+ d: "M12 19.51L12.01 19.4989",
246
+ stroke: "#fff",
247
+ strokeWidth: "0.9",
248
+ strokeLinecap: "round",
249
+ strokeLinejoin: "round"
250
+ }), /*#__PURE__*/_jsx(Path, {
251
+ d: "M2 8C8 3.5 16 3.5 22 8",
252
+ stroke: "#fff",
253
+ strokeWidth: "0.9",
254
+ strokeLinecap: "round",
255
+ strokeLinejoin: "round"
256
+ }), /*#__PURE__*/_jsx(Path, {
257
+ d: "M5 12C9 9 15 9 19 12",
258
+ stroke: "#fff",
259
+ strokeWidth: "0.9",
260
+ strokeLinecap: "round",
261
+ strokeLinejoin: "round"
262
+ }), /*#__PURE__*/_jsx(Path, {
263
+ d: "M8.5 15.5C10.7504 14.1 13.2498 14.0996 15.5001 15.5",
264
+ stroke: "#fff",
265
+ strokeWidth: "0.9",
266
+ strokeLinecap: "round",
267
+ strokeLinejoin: "round"
268
+ })]
269
+ });
270
+ const QRIcon = ({
271
+ color = "#111",
272
+ size = 22
273
+ }) => /*#__PURE__*/_jsxs(Svg, {
274
+ width: size,
275
+ height: size,
276
+ strokeWidth: "0.9",
277
+ viewBox: "0 0 24 24",
278
+ fill: "none",
279
+ color: color,
280
+ children: [/*#__PURE__*/_jsx(Path, {
281
+ fillRule: "evenodd",
282
+ clipRule: "evenodd",
283
+ d: "M2.25 3C2.25 2.58579 2.58579 2.25 3 2.25H6C6.41421 2.25 6.75 2.58579 6.75 3C6.75 3.41421 6.41421 3.75 6 3.75H3.75V6C3.75 6.41421 3.41421 6.75 3 6.75C2.58579 6.75 2.25 6.41421 2.25 6V3Z",
284
+ fill: "#fff"
285
+ }), /*#__PURE__*/_jsx(Path, {
286
+ fillRule: "evenodd",
287
+ clipRule: "evenodd",
288
+ d: "M17.25 3C17.25 2.58579 17.5858 2.25 18 2.25H21C21.4142 2.25 21.75 2.58579 21.75 3V6C21.75 6.41421 21.4142 6.75 21 6.75C20.5858 6.75 20.25 6.41421 20.25 6V3.75H18C17.5858 3.75 17.25 3.41421 17.25 3Z",
289
+ fill: "#fff"
290
+ }), /*#__PURE__*/_jsx(Path, {
291
+ fillRule: "evenodd",
292
+ clipRule: "evenodd",
293
+ d: "M3 17.25C3.41421 17.25 3.75 17.5858 3.75 18V20.25H6C6.41421 20.25 6.75 20.5858 6.75 21C6.75 21.4142 6.41421 21.75 6 21.75H3C2.58579 21.75 2.25 21.4142 2.25 21V18C2.25 17.5858 2.58579 17.25 3 17.25Z",
294
+ fill: "#fff"
295
+ }), /*#__PURE__*/_jsx(Path, {
296
+ fillRule: "evenodd",
297
+ clipRule: "evenodd",
298
+ d: "M21 17.25C21.4142 17.25 21.75 17.5858 21.75 18V21C21.75 21.4142 21.4142 21.75 21 21.75H18C17.5858 21.75 17.25 21.4142 17.25 21C17.25 20.5858 17.5858 20.25 18 20.25H20.25V18C20.25 17.5858 20.5858 17.25 21 17.25Z",
299
+ fill: "#fff"
300
+ }), /*#__PURE__*/_jsx(Path, {
301
+ fillRule: "evenodd",
302
+ clipRule: "evenodd",
303
+ d: "M12.9004 6.6654C12.3462 6.33289 11.6538 6.33289 11.0996 6.6654L7.09963 9.0654C6.57252 9.38167 6.25 9.95131 6.25 10.566V14.4336C6.25 15.0483 6.57252 15.618 7.09963 15.9342L11.0996 18.3342C11.6538 18.6668 12.3462 18.6668 12.9004 18.3342L16.9004 15.9342C17.4275 15.618 17.75 15.0483 17.75 14.4336V10.566C17.75 9.95131 17.4275 9.38167 16.9004 9.0654L12.9004 6.6654ZM9.3642 10.6785C9.00209 10.4773 8.5455 10.6078 8.34437 10.9699C8.14324 11.332 8.27373 11.7886 8.63583 11.9898L11.25 13.4418V16.0001C11.25 16.4144 11.5858 16.7501 12 16.7501C12.4142 16.7501 12.75 16.4144 12.75 16.0001V13.4456C12.9152 13.3554 13.1243 13.241 13.3607 13.1115C13.9447 12.7916 14.6961 12.3787 15.3642 12.0077C15.7263 11.8066 15.8568 11.35 15.6557 10.9879C15.4546 10.6257 14.998 10.4952 14.6359 10.6964C13.9716 11.0653 13.223 11.4766 12.6401 11.796C12.3908 11.9325 12.172 12.0521 12.0032 12.1443L9.3642 10.6785Z",
304
+ fill: "#fff"
305
+ })]
306
+ });
307
+ // Main Component
308
+ const ReceiveScreen = ({
26
309
  amount,
27
310
  currency = 'NGN',
28
311
  user,
312
+ account,
29
313
  onClose,
30
314
  onPaymentReceived,
31
315
  onError
32
- }) {
33
- const [channel, setChannel] = useState(null);
34
- const myWallet = {
35
- accountName: user?.accountName ?? '',
36
- accountNumber: user?.accountNumber ?? '',
37
- bankName: user?.bankName ?? '',
38
- bankCode: user?.bankCode ?? ''
39
- };
40
- if (channel === 'nqr') return /*#__PURE__*/_jsx(NQRSubScreen, {
41
- mode: "receive",
42
- amount: amount,
43
- currency: currency,
44
- onDone: onClose,
45
- onError: onError
46
- });
47
- if (channel === 'nfc') return /*#__PURE__*/_jsx(NFCSubScreen, {
48
- mode: "receive",
49
- myWallet: myWallet,
50
- onDone: onClose,
51
- onError: onError
52
- });
53
-
54
- // Transfer — just show account details inline
55
- if (channel === 'transfer') return /*#__PURE__*/_jsxs(View, {
56
- style: styles.container,
57
- children: [/*#__PURE__*/_jsx(TouchableOpacity, {
58
- onPress: () => setChannel(null),
59
- style: styles.back,
60
- children: /*#__PURE__*/_jsx(Text, {
61
- style: styles.backText,
62
- children: "\u2039 Back"
63
- })
64
- }), /*#__PURE__*/_jsx(Text, {
65
- style: styles.sectionTitle,
66
- children: "Your Account Details"
67
- }), /*#__PURE__*/_jsxs(View, {
68
- style: styles.accountCard,
69
- children: [/*#__PURE__*/_jsx(Row, {
70
- label: "Account Name",
71
- value: user?.accountName ?? ''
72
- }), /*#__PURE__*/_jsx(Row, {
73
- label: "Account Number",
74
- value: user?.accountNumber ?? '',
75
- large: true,
76
- copyable: true
77
- }), /*#__PURE__*/_jsx(Row, {
78
- label: "Bank",
79
- value: user?.bankName ?? ''
80
- }), amount && /*#__PURE__*/_jsx(Row, {
81
- label: "Expected Amount",
82
- value: `${currency} ${amount.toLocaleString('en-NG', {
83
- minimumFractionDigits: 2
84
- })}`,
85
- highlight: true
86
- })]
87
- }), /*#__PURE__*/_jsx(Text, {
88
- style: styles.hint,
89
- children: "Share these details with whoever is paying you"
90
- })]
91
- });
92
- return /*#__PURE__*/_jsxs(View, {
93
- style: styles.container,
94
- children: [amount && /*#__PURE__*/_jsxs(View, {
95
- style: styles.amountBanner,
96
- children: [/*#__PURE__*/_jsx(Text, {
97
- style: styles.amountLabel,
98
- children: "Receiving"
99
- }), /*#__PURE__*/_jsxs(Text, {
100
- style: styles.amountValue,
101
- children: [currency, " ", amount.toLocaleString('en-NG', {
102
- minimumFractionDigits: 2
103
- })]
104
- })]
105
- }), /*#__PURE__*/_jsx(Text, {
106
- style: styles.sectionTitle,
107
- children: "How do you want to receive?"
108
- }), /*#__PURE__*/_jsx(ScrollView, {
109
- showsVerticalScrollIndicator: false,
110
- contentContainerStyle: styles.list,
111
- children: CHANNELS.map(ch => /*#__PURE__*/_jsxs(TouchableOpacity, {
112
- style: styles.card,
113
- onPress: () => setChannel(ch.id),
114
- activeOpacity: 0.8,
115
- children: [/*#__PURE__*/_jsx(View, {
116
- style: styles.cardIcon,
117
- children: /*#__PURE__*/_jsx(Text, {
118
- style: styles.cardEmoji,
119
- children: ch.emoji
120
- })
121
- }), /*#__PURE__*/_jsxs(View, {
122
- style: styles.cardText,
123
- children: [/*#__PURE__*/_jsx(Text, {
124
- style: styles.cardTitle,
125
- children: ch.title
126
- }), /*#__PURE__*/_jsx(Text, {
127
- style: styles.cardDesc,
128
- children: ch.desc
316
+ }) => {
317
+ const [mode, setMode] = useState('TRANSFER');
318
+ return /*#__PURE__*/_jsxs(Container, {
319
+ children: [mode === 'TRANSFER' && /*#__PURE__*/_jsx(Transfer, {
320
+ amount: amount,
321
+ description: "",
322
+ user: user,
323
+ recipient: account,
324
+ onClose: onClose,
325
+ onPaymentReceived: onPaymentReceived
326
+ }), mode === 'QRCODE' && /*#__PURE__*/_jsx(Qr, {
327
+ amount: amount,
328
+ description: "",
329
+ onClose: onClose,
330
+ onPaymentReceived: onPaymentReceived
331
+ }), mode === 'NFC' && /*#__PURE__*/_jsx(Nfc, {
332
+ amount: amount,
333
+ description: "",
334
+ onClose: onClose,
335
+ onPaymentReceived: onPaymentReceived
336
+ }), /*#__PURE__*/_jsxs(BottomSheet, {
337
+ children: [/*#__PURE__*/_jsx(SheetHandle, {}), /*#__PURE__*/_jsxs(SheetScrollView, {
338
+ showsVerticalScrollIndicator: false,
339
+ children: [/*#__PURE__*/_jsx(SectionTitle, {
340
+ children: "Receive with"
341
+ }), /*#__PURE__*/_jsxs(ActionsRow, {
342
+ children: [/*#__PURE__*/_jsxs(ActionButton, {
343
+ onPress: () => setMode('TRANSFER'),
344
+ children: [/*#__PURE__*/_jsx(ActionIconContainer, {
345
+ color: "#0a3d2e",
346
+ children: /*#__PURE__*/_jsx(Ionicons, {
347
+ name: "business-sharp",
348
+ size: 26,
349
+ color: "#ffffff"
350
+ })
351
+ }), /*#__PURE__*/_jsxs(ActionLabel, {
352
+ children: ["With", '\n', "transfer"]
353
+ })]
354
+ }), /*#__PURE__*/_jsxs(ActionButton, {
355
+ onPress: () => setMode('QRCODE'),
356
+ children: [/*#__PURE__*/_jsx(ActionIconContainer, {
357
+ color: "#0a3d2e",
358
+ children: /*#__PURE__*/_jsx(QRIcon, {
359
+ color: "#FFF",
360
+ size: 22
361
+ })
362
+ }), /*#__PURE__*/_jsxs(ActionLabel, {
363
+ children: ["With", '\n', "QR"]
364
+ })]
365
+ }), /*#__PURE__*/_jsxs(ActionButton, {
366
+ onPress: () => setMode('NFC'),
367
+ children: [/*#__PURE__*/_jsx(ActionIconContainer, {
368
+ color: "#0a3d2e",
369
+ children: /*#__PURE__*/_jsx(NFCIcon, {
370
+ size: 26,
371
+ color: "#ffffff"
372
+ })
373
+ }), /*#__PURE__*/_jsxs(ActionLabel, {
374
+ children: ["With", '\n', "NFC"]
375
+ })]
376
+ }), /*#__PURE__*/_jsxs(ActionButton, {
377
+ onPress: () => setMode('BTH'),
378
+ children: [/*#__PURE__*/_jsx(ActionIconContainer, {
379
+ color: "#0a3d2e",
380
+ children: /*#__PURE__*/_jsx(BluetoothIcon, {
381
+ size: 26,
382
+ color: "#ffffff"
383
+ })
384
+ }), /*#__PURE__*/_jsxs(ActionLabel, {
385
+ children: ["With", '\n', "Bluetooth"]
386
+ })]
129
387
  })]
130
- }), /*#__PURE__*/_jsx(Text, {
131
- style: styles.arrow,
132
- children: "\u203A"
133
388
  })]
134
- }, ch.id))
135
- })]
136
- });
137
- }
138
- function Row({
139
- label,
140
- value,
141
- large,
142
- copyable,
143
- highlight
144
- }) {
145
- const [copied, setCopied] = React.useState(false);
146
- return /*#__PURE__*/_jsxs(View, {
147
- style: rowStyles.row,
148
- children: [/*#__PURE__*/_jsx(Text, {
149
- style: rowStyles.label,
150
- children: label
151
- }), /*#__PURE__*/_jsx(TouchableOpacity, {
152
- onPress: copyable ? () => {
153
- require('react-native').Clipboard.setString(value);
154
- setCopied(true);
155
- setTimeout(() => setCopied(false), 2000);
156
- } : undefined,
157
- children: /*#__PURE__*/_jsxs(Text, {
158
- style: [rowStyles.value, large && rowStyles.large, highlight && rowStyles.highlight],
159
- children: [value, copyable && /*#__PURE__*/_jsxs(Text, {
160
- style: rowStyles.copy,
161
- children: [" ", copied ? '✓' : 'Copy']
162
- })]
163
- })
389
+ })]
164
390
  })]
165
391
  });
166
- }
167
- const rowStyles = StyleSheet.create({
168
- row: {
169
- paddingVertical: S.sm,
170
- borderBottomWidth: 1,
171
- borderBottomColor: C.border
172
- },
173
- label: {
174
- fontSize: F.xs,
175
- color: C.muted,
176
- marginBottom: 2
177
- },
178
- value: {
179
- fontSize: F.md,
180
- color: C.ink,
181
- fontWeight: '600'
182
- },
183
- large: {
184
- fontSize: F.xl,
185
- fontWeight: '800',
186
- letterSpacing: 2
187
- },
188
- highlight: {
189
- color: C.green,
190
- fontWeight: '800'
191
- },
192
- copy: {
193
- fontSize: F.sm,
194
- color: C.brand,
195
- fontWeight: '700'
196
- }
197
- });
198
- const styles = StyleSheet.create({
199
- container: {
200
- flex: 1,
201
- padding: S.lg
202
- },
203
- back: {
204
- marginBottom: S.md
205
- },
206
- backText: {
207
- color: C.brand,
208
- fontSize: F.md,
209
- fontWeight: '600'
210
- },
211
- amountBanner: {
212
- backgroundColor: C.greenLight,
213
- borderRadius: R.xl,
214
- padding: S.lg,
215
- alignItems: 'center',
216
- marginBottom: S.lg
217
- },
218
- amountLabel: {
219
- color: C.green,
220
- fontSize: F.sm,
221
- marginBottom: 4
222
- },
223
- amountValue: {
224
- color: C.green,
225
- fontSize: F.hero,
226
- fontWeight: '800'
227
- },
228
- sectionTitle: {
229
- fontSize: F.sm,
230
- color: C.muted,
231
- fontWeight: '600',
232
- letterSpacing: 0.6,
233
- textTransform: 'uppercase',
234
- marginBottom: S.md
235
- },
236
- list: {
237
- paddingBottom: S.xl
238
- },
239
- card: {
240
- flexDirection: 'row',
241
- alignItems: 'center',
242
- backgroundColor: C.surface,
243
- borderRadius: R.lg,
244
- padding: S.md,
245
- marginBottom: S.sm,
246
- ...shadow.sm
247
- },
248
- cardIcon: {
249
- width: 48,
250
- height: 48,
251
- borderRadius: R.md,
252
- backgroundColor: C.white,
253
- justifyContent: 'center',
254
- alignItems: 'center',
255
- marginRight: S.md
256
- },
257
- cardEmoji: {
258
- fontSize: 24
259
- },
260
- cardText: {
261
- flex: 1
262
- },
263
- cardTitle: {
264
- fontSize: F.md,
265
- fontWeight: '700',
266
- color: C.ink
267
- },
268
- cardDesc: {
269
- fontSize: F.sm,
270
- color: C.muted,
271
- marginTop: 2
272
- },
273
- arrow: {
274
- fontSize: F.xl,
275
- color: C.ghost
276
- },
277
- accountCard: {
278
- backgroundColor: C.surface,
279
- borderRadius: R.lg,
280
- padding: S.md,
281
- marginBottom: S.md
282
- },
283
- hint: {
284
- fontSize: F.sm,
285
- color: C.muted,
286
- textAlign: 'center'
287
- }
288
- });
392
+ };
393
+ export default ReceiveScreen;
289
394
  //# sourceMappingURL=ReceiveScreen.js.map