react-native-fpay 0.2.4 → 0.2.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 (39) hide show
  1. package/lib/module/ui/modals/FPShell.js +120 -76
  2. package/lib/module/ui/modals/FPShell.js.map +1 -1
  3. package/lib/module/ui/screens/ReceiveScreen.js +0 -2
  4. package/lib/module/ui/screens/ReceiveScreen.js.map +1 -1
  5. package/lib/module/ui/screens/SendScreen.js +454 -168
  6. package/lib/module/ui/screens/SendScreen.js.map +1 -1
  7. package/lib/module/ui/screens/sub/BluetoothSubScreen.js +0 -1
  8. package/lib/module/ui/screens/sub/BluetoothSubScreen.js.map +1 -1
  9. package/lib/module/ui/screens/sub/NFCSubScreen.js +2 -7
  10. package/lib/module/ui/screens/sub/NFCSubScreen.js.map +1 -1
  11. package/lib/module/ui/screens/sub/NQRSubScreen.js +0 -5
  12. package/lib/module/ui/screens/sub/NQRSubScreen.js.map +1 -1
  13. package/lib/module/ui/screens/sub/ProximitySubScreen.js.map +1 -1
  14. package/lib/module/ui/screens/sub/TransferSubScreen.js +1 -9
  15. package/lib/module/ui/screens/sub/TransferSubScreen.js.map +1 -1
  16. package/lib/typescript/src/ui/modals/FPShell.d.ts.map +1 -1
  17. package/lib/typescript/src/ui/screens/SendScreen.d.ts +2 -2
  18. package/lib/typescript/src/ui/screens/SendScreen.d.ts.map +1 -1
  19. package/lib/typescript/src/ui/screens/sub/BluetoothSubScreen.d.ts +1 -2
  20. package/lib/typescript/src/ui/screens/sub/BluetoothSubScreen.d.ts.map +1 -1
  21. package/lib/typescript/src/ui/screens/sub/NFCSubScreen.d.ts +1 -2
  22. package/lib/typescript/src/ui/screens/sub/NFCSubScreen.d.ts.map +1 -1
  23. package/lib/typescript/src/ui/screens/sub/NQRSubScreen.d.ts +1 -2
  24. package/lib/typescript/src/ui/screens/sub/NQRSubScreen.d.ts.map +1 -1
  25. package/lib/typescript/src/ui/screens/sub/ProximitySubScreen.d.ts +0 -1
  26. package/lib/typescript/src/ui/screens/sub/ProximitySubScreen.d.ts.map +1 -1
  27. package/lib/typescript/src/ui/screens/sub/TransferSubScreen.d.ts +1 -2
  28. package/lib/typescript/src/ui/screens/sub/TransferSubScreen.d.ts.map +1 -1
  29. package/package.json +2 -2
  30. package/src/ui/modals/FPShell.tsx +149 -49
  31. package/src/ui/screens/ReceiveScreen.tsx +2 -2
  32. package/src/ui/screens/SendScreen.tsx +266 -53
  33. package/src/ui/screens/sub/BluetoothSubScreen.tsx +6 -3
  34. package/src/ui/screens/sub/NFCSubScreen.tsx +7 -4
  35. package/src/ui/screens/sub/NQRSubScreen.tsx +6 -5
  36. package/src/ui/screens/sub/ProximitySubScreen.tsx +5 -3
  37. package/src/ui/screens/sub/TransferSubScreen.tsx +6 -5
  38. package/android/src/main/java/com/fpay/FpayModule.kt +0 -15
  39. package/android/src/main/java/com/fpay/FpayPackage.kt +0 -31
@@ -9,14 +9,18 @@ import type { FPCurrency, FPError, FPTransaction } from '../../../core/types';
9
9
  interface Props {
10
10
  mode: 'send' | 'receive';
11
11
  amount?: number; currency?: FPCurrency;
12
- myWallet?: { accountName: string; accountNumber: string; bankCode: string; bankName: string };
13
- onBack: () => void; onDone: () => void;
12
+ myWallet?: { accountName: string;
13
+ accountNumber: string;
14
+ bankCode: string;
15
+ bankName: string
16
+ };
17
+ onDone: () => void;
14
18
  onSuccess?: (tx: FPTransaction) => void; onError?: (err: FPError) => void;
15
19
  }
16
20
 
17
21
  type Phase = 'idle' | 'active' | 'success' | 'error';
18
22
 
19
- export function NFCSubScreen({ mode, amount, currency = 'NGN', myWallet, onBack, onDone, onSuccess, onError }: Props) {
23
+ export function NFCSubScreen({ mode, amount, currency = 'NGN', myWallet, onDone, onSuccess, onError }: Props) {
20
24
  const [phase, setPhase] = useState<Phase>('idle');
21
25
  const [msg, setMsg] = useState('');
22
26
 
@@ -52,7 +56,6 @@ export function NFCSubScreen({ mode, amount, currency = 'NGN', myWallet, onBack,
52
56
 
53
57
  return (
54
58
  <View style={st.wrap}>
55
- <Text onPress={onBack} style={st.back}>Back</Text>
56
59
  <Text style={st.title}>NFC {mode === 'send' ? 'Payment' : 'Receive'}</Text>
57
60
  <View style={[st.tapZone, phase === 'active' && st.tapActive, phase === 'success' && st.tapSuccess, phase === 'error' && st.tapError]}>
58
61
  <Text style={st.tapEmoji}>{phase === 'success' ? 'OK' : phase === 'error' ? 'ERR' : 'NFC'}</Text>
@@ -7,12 +7,14 @@ import type { FPCurrency, FPError } from '../../../core/types';
7
7
 
8
8
  interface Props {
9
9
  mode: 'send' | 'receive';
10
- amount?: number; currency?: FPCurrency;
11
- onBack: () => void; onDone: () => void;
12
- onSuccess?: (tx: any) => void; onError?: (err: FPError) => void;
10
+ amount?: number;
11
+ currency?: FPCurrency;
12
+ onDone: () => void;
13
+ onSuccess?: (tx: any) => void;
14
+ onError?: (err: FPError) => void;
13
15
  }
14
16
 
15
- export function NQRSubScreen({ mode, amount, currency = 'NGN', onBack, onDone, onError }: Props) {
17
+ export function NQRSubScreen({ mode, amount, currency = 'NGN', onDone, onError }: Props) {
16
18
  const [qr, setQr] = useState<{ qrCodeImageBase64: string; reference: string; expiresAt?: string } | null>(null);
17
19
  const [loading, setLoading] = useState(false);
18
20
 
@@ -26,7 +28,6 @@ export function NQRSubScreen({ mode, amount, currency = 'NGN', onBack, onDone, o
26
28
 
27
29
  return (
28
30
  <View style={st.wrap}>
29
- <Text onPress={onBack} style={st.back}>Back</Text>
30
31
  <Text style={st.title}>{mode === 'receive' ? 'Your QR Code' : 'Scan QR Code'}</Text>
31
32
  {loading && <ActivityIndicator size="large" color={C.brand} style={{ marginTop: S.xl }} />}
32
33
  {qr && (
@@ -222,9 +222,11 @@ const ProximityIcon =({ color = "#111", size = 22 })=>(
222
222
  )
223
223
 
224
224
  interface Props {
225
- amount: number; currency: FPCurrency;
226
- onBack: () => void; onDone: () => void;
227
- onSuccess?: (tx: FPTransaction) => void; onError?: (err: FPError) => void;
225
+ amount: number;
226
+ currency: FPCurrency;
227
+ onDone: () => void;
228
+ onSuccess?: (tx: FPTransaction) => void;
229
+ onError?: (err: FPError) => void;
228
230
  }
229
231
 
230
232
  export function ProximitySubScreen({ amount, currency, onDone, onSuccess, onError }: Props) {
@@ -8,12 +8,14 @@ import type { FPCurrency, FPTransaction, FPError } from '../../../core/types';
8
8
  type Step = 'bank' | 'account' | 'confirm' | 'processing' | 'done';
9
9
 
10
10
  interface Props {
11
- amount: number; currency: FPCurrency;
12
- onBack: () => void; onDone: () => void;
13
- onSuccess?: (tx: FPTransaction) => void; onError?: (err: FPError) => void;
11
+ amount: number;
12
+ currency: FPCurrency;
13
+ onDone: () => void;
14
+ onSuccess?: (tx: FPTransaction) => void;
15
+ onError?: (err: FPError) => void;
14
16
  }
15
17
 
16
- export function TransferSubScreen({ amount, currency, onBack, onDone, onSuccess, onError }: Props) {
18
+ export function TransferSubScreen({ amount, currency, onDone, onSuccess, onError }: Props) {
17
19
  const [step, setStep] = useState<Step>('bank');
18
20
  const [banks, setBanks] = useState<{ name: string; code: string }[]>([]);
19
21
  const [search, setSearch] = useState('');
@@ -54,7 +56,6 @@ export function TransferSubScreen({ amount, currency, onBack, onDone, onSuccess,
54
56
 
55
57
  if (step === 'bank') return (
56
58
  <View style={st.wrap}>
57
- <TouchableOpacity onPress={onBack} style={st.back}><Text style={st.backText}>Back</Text></TouchableOpacity>
58
59
  <Text style={st.title}>Select Bank</Text>
59
60
  <TextInput style={st.input} placeholder="Search..." value={search} onChangeText={setSearch} placeholderTextColor={C.ghost} />
60
61
  <FlatList data={filtered} keyExtractor={i => i.code}
@@ -1,15 +0,0 @@
1
- package com.fpay
2
-
3
- import com.facebook.react.bridge.ReactApplicationContext
4
-
5
- class FpayModule(reactContext: ReactApplicationContext) :
6
- NativeFpaySpec(reactContext) {
7
-
8
- override fun multiply(a: Double, b: Double): Double {
9
- return a * b
10
- }
11
-
12
- companion object {
13
- const val NAME = NativeFpaySpec.NAME
14
- }
15
- }
@@ -1,31 +0,0 @@
1
- package com.fpay
2
-
3
- import com.facebook.react.BaseReactPackage
4
- import com.facebook.react.bridge.NativeModule
5
- import com.facebook.react.bridge.ReactApplicationContext
6
- import com.facebook.react.module.model.ReactModuleInfo
7
- import com.facebook.react.module.model.ReactModuleInfoProvider
8
- import java.util.HashMap
9
-
10
- class FpayPackage : BaseReactPackage() {
11
- override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
12
- return if (name == FpayModule.NAME) {
13
- FpayModule(reactContext)
14
- } else {
15
- null
16
- }
17
- }
18
-
19
- override fun getReactModuleInfoProvider() = ReactModuleInfoProvider {
20
- mapOf(
21
- FpayModule.NAME to ReactModuleInfo(
22
- name = FpayModule.NAME,
23
- className = FpayModule.NAME,
24
- canOverrideExistingModule = false,
25
- needsEagerInit = false,
26
- isCxxModule = false,
27
- isTurboModule = true
28
- )
29
- )
30
- }
31
- }