react-native-fpay 0.2.7 → 0.2.9
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.
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// renders the appropriate full-screen sheet.
|
|
8
8
|
// ─────────────────────────────────────────────
|
|
9
9
|
import React, { useEffect, useState, useRef } from 'react';
|
|
10
|
-
import { View,
|
|
10
|
+
import { View, StyleSheet, Animated, Dimensions, StatusBar, Platform } from 'react-native';
|
|
11
11
|
import { _onEvent } from "../../engine/FPEngine.js";
|
|
12
12
|
import SendScreen from "../screens/SendScreen.js";
|
|
13
13
|
import { ReceiveScreen } from "../screens/ReceiveScreen.js";
|
|
@@ -72,80 +72,32 @@ export function FPShell() {
|
|
|
72
72
|
const title = sheet.mode === 'send' ? 'Send Money' : 'Receive Money';
|
|
73
73
|
const accentColor = sheet.mode === 'send' ? C.brand : C.green;
|
|
74
74
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
75
|
-
children: [/*#__PURE__*/_jsx(FPPaymentRequestModal, {}), visible && /*#__PURE__*/
|
|
75
|
+
children: [/*#__PURE__*/_jsx(FPPaymentRequestModal, {}), visible && /*#__PURE__*/_jsx(Animated.View, {
|
|
76
76
|
style: [st.fullscreen, {
|
|
77
77
|
transform: [{
|
|
78
78
|
translateY: slide
|
|
79
79
|
}]
|
|
80
80
|
}],
|
|
81
|
-
children:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
style: st.closeIcon,
|
|
100
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
101
|
-
style: [st.closeLine, {
|
|
102
|
-
transform: [{
|
|
103
|
-
rotate: '45deg'
|
|
104
|
-
}]
|
|
105
|
-
}]
|
|
106
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
107
|
-
style: [st.closeLine, {
|
|
108
|
-
transform: [{
|
|
109
|
-
rotate: '-45deg'
|
|
110
|
-
}],
|
|
111
|
-
position: 'absolute'
|
|
112
|
-
}]
|
|
113
|
-
})]
|
|
114
|
-
})
|
|
115
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
116
|
-
style: st.titleWrap,
|
|
117
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
118
|
-
style: st.title,
|
|
119
|
-
children: title
|
|
120
|
-
})
|
|
121
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
122
|
-
style: [st.dot, {
|
|
123
|
-
backgroundColor: accentColor
|
|
124
|
-
}]
|
|
125
|
-
})]
|
|
126
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
127
|
-
style: st.divider
|
|
128
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
129
|
-
style: st.content,
|
|
130
|
-
children: [sheet.mode === 'send' && /*#__PURE__*/_jsx(SendScreen, {
|
|
131
|
-
amount: sheet.amount ?? 0,
|
|
132
|
-
currency: sheet.currency ?? 'NGN',
|
|
133
|
-
onClose: close,
|
|
134
|
-
onPaymentSent: tx => {
|
|
135
|
-
FPEngine.getCallbacks().onPaymentSent?.(tx);
|
|
136
|
-
close();
|
|
137
|
-
},
|
|
138
|
-
onError: FPEngine.getCallbacks().onError
|
|
139
|
-
}), sheet.mode === 'receive' && /*#__PURE__*/_jsx(ReceiveScreen, {
|
|
140
|
-
amount: sheet.amount,
|
|
141
|
-
currency: sheet.currency,
|
|
142
|
-
user: FPEngine.getUser() ?? undefined,
|
|
143
|
-
onClose: close,
|
|
144
|
-
onPaymentReceived: FPEngine.getCallbacks().onPaymentReceived,
|
|
145
|
-
onError: FPEngine.getCallbacks().onError
|
|
146
|
-
})]
|
|
81
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
82
|
+
style: st.content,
|
|
83
|
+
children: [sheet.mode === 'send' && /*#__PURE__*/_jsx(SendScreen, {
|
|
84
|
+
amount: sheet.amount ?? 0,
|
|
85
|
+
currency: sheet.currency ?? 'NGN',
|
|
86
|
+
onClose: close,
|
|
87
|
+
onPaymentSent: tx => {
|
|
88
|
+
FPEngine.getCallbacks().onPaymentSent?.(tx);
|
|
89
|
+
close();
|
|
90
|
+
},
|
|
91
|
+
onError: FPEngine.getCallbacks().onError
|
|
92
|
+
}), sheet.mode === 'receive' && /*#__PURE__*/_jsx(ReceiveScreen, {
|
|
93
|
+
amount: sheet.amount,
|
|
94
|
+
currency: sheet.currency,
|
|
95
|
+
user: FPEngine.getUser() ?? undefined,
|
|
96
|
+
onClose: close,
|
|
97
|
+
onPaymentReceived: FPEngine.getCallbacks().onPaymentReceived,
|
|
98
|
+
onError: FPEngine.getCallbacks().onError
|
|
147
99
|
})]
|
|
148
|
-
})
|
|
100
|
+
})
|
|
149
101
|
})]
|
|
150
102
|
});
|
|
151
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useState","useRef","View","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","useRef","View","StyleSheet","Animated","Dimensions","StatusBar","Platform","_onEvent","SendScreen","ReceiveScreen","FPPaymentRequestModal","FPEngine","C","S","F","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","width","SCREEN_W","height","SCREEN_H","get","FPShell","sheet","setSheet","mode","visible","setVisible","slide","Value","current","open","state","spring","toValue","useNativeDriver","tension","friction","start","close","timing","duration","unsubSend","d","data","amount","currency","unsubReceive","title","accentColor","brand","green","children","style","st","fullscreen","transform","translateY","content","onClose","onPaymentSent","tx","getCallbacks","onError","user","getUser","undefined","onPaymentReceived","create","position","top","left","backgroundColor","white","zIndex","elevation","safeArea","flex","header","flexDirection","alignItems","justifyContent","paddingHorizontal","lg","paddingTop","OS","currentHeight","sm","md","paddingBottom","closeBtn","borderRadius","surface","closeIcon","closeLine","ink","titleWrap","fontSize","fontWeight","color","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;IACTwE,YAAY,EAAE,CAAC;IACfnB,eAAe,EAAEhE,CAAC,CAACuF;EACrB,CAAC;EACDC,SAAS,EAAE;IACTnB,IAAI,EAAE,CAAC;IACPG,UAAU,EAAE;EACd,CAAC;EACDhC,KAAK,EAAE;IACLiD,QAAQ,EAAEvF,CAAC,CAACyE,EAAE;IACde,UAAU,EAAE,KAAK;IACjBC,KAAK,EAAE3F,CAAC,CAACuF,GAAG;IACZK,aAAa,EAAE,CAAC;EAClB,CAAC;EACDC,GAAG,EAAE;IACHpF,KAAK,EAAE,CAAC;IACRE,MAAM,EAAE,CAAC;IACTwE,YAAY,EAAE,CAAC;IACfW,WAAW,EAAE,EAAE,CAAI;EACrB,CAAC;EACDC,OAAO,EAAE;IACPpF,MAAM,EAAE,CAAC;IACTqD,eAAe,EAAEhE,CAAC,CAACgG,MAAM;IACzBC,gBAAgB,EAAE;EACpB,CAAC;EACD/C,OAAO,EAAE;IACPmB,IAAI,EAAE,CAAC;IACPL,eAAe,EAAEhE,CAAC,CAACoF;EACrB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FPShell.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/FPShell.tsx"],"names":[],"mappings":"AA0BA,wBAAgB,OAAO,
|
|
1
|
+
{"version":3,"file":"FPShell.d.ts","sourceRoot":"","sources":["../../../../../src/ui/modals/FPShell.tsx"],"names":[],"mappings":"AA0BA,wBAAgB,OAAO,4CAgFtB"}
|
package/package.json
CHANGED
|
@@ -76,32 +76,6 @@ export function FPShell() {
|
|
|
76
76
|
<Animated.View
|
|
77
77
|
style={[st.fullscreen, { transform: [{ translateY: slide }] }]}
|
|
78
78
|
>
|
|
79
|
-
<StatusBar barStyle="dark-content" backgroundColor={C.white} />
|
|
80
|
-
|
|
81
|
-
<SafeAreaView style={st.safeArea}>
|
|
82
|
-
{/* ── Header ───────────────────────────────────────── */}
|
|
83
|
-
<View style={st.header}>
|
|
84
|
-
{/* Close button — left side */}
|
|
85
|
-
<TouchableOpacity onPress={close} style={st.closeBtn} activeOpacity={0.7} hitSlop={{ top: 12, bottom: 12, left: 12, right: 12 }}>
|
|
86
|
-
<View style={st.closeIcon}>
|
|
87
|
-
<View style={[st.closeLine, { transform: [{ rotate: '45deg' }] }]} />
|
|
88
|
-
<View style={[st.closeLine, { transform: [{ rotate: '-45deg' }], position: 'absolute' }]} />
|
|
89
|
-
</View>
|
|
90
|
-
</TouchableOpacity>
|
|
91
|
-
|
|
92
|
-
{/* Title — center */}
|
|
93
|
-
<View style={st.titleWrap}>
|
|
94
|
-
<Text style={st.title}>{title}</Text>
|
|
95
|
-
</View>
|
|
96
|
-
|
|
97
|
-
{/* Accent dot — right side (balances the close button visually) */}
|
|
98
|
-
<View style={[st.dot, { backgroundColor: accentColor }]} />
|
|
99
|
-
</View>
|
|
100
|
-
|
|
101
|
-
{/* ── Divider ───────────────────────────────────────── */}
|
|
102
|
-
<View style={st.divider} />
|
|
103
|
-
|
|
104
|
-
{/* ── Content ───────────────────────────────────────── */}
|
|
105
79
|
<View style={st.content}>
|
|
106
80
|
{sheet.mode === 'send' && (
|
|
107
81
|
<SendScreen
|
|
@@ -126,7 +100,6 @@ export function FPShell() {
|
|
|
126
100
|
/>
|
|
127
101
|
)}
|
|
128
102
|
</View>
|
|
129
|
-
</SafeAreaView>
|
|
130
103
|
</Animated.View>
|
|
131
104
|
)}
|
|
132
105
|
</>
|
package/ios/Fpay.h
DELETED
package/ios/Fpay.mm
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#import "Fpay.h"
|
|
2
|
-
|
|
3
|
-
@implementation Fpay
|
|
4
|
-
- (NSNumber *)multiply:(double)a b:(double)b {
|
|
5
|
-
NSNumber *result = @(a * b);
|
|
6
|
-
|
|
7
|
-
return result;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
11
|
-
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
12
|
-
{
|
|
13
|
-
return std::make_shared<facebook::react::NativeFpaySpecJSI>(params);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
+ (NSString *)moduleName
|
|
17
|
-
{
|
|
18
|
-
return @"Fpay";
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
@end
|