Skip to content

Commit

Permalink
lib update
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmyAina committed Nov 24, 2022
1 parent 4910727 commit 4a65763
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 22 deletions.
Binary file modified .DS_Store
Binary file not shown.
5 changes: 4 additions & 1 deletion lib/rave/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ interface RavePropInterface {
buttonText: string;
customButton: boolean;
subaccount?: any;
submitPendingTrx?: any;
}
declare function Rave(props: RavePropInterface): any;
declare function Rave(props: RavePropInterface, { children }: {
children: any;
}): any;
declare namespace Rave {
var defaultProps: {
buttonText: string;
Expand Down
45 changes: 24 additions & 21 deletions lib/rave/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const react_native_1 = require("react-native");
const react_native_autoheight_webview_1 = __importDefault(require("react-native-autoheight-webview"));
const utils_1 = require("../utils");
const HtmlRave_1 = require("./HtmlRave");
function Rave(props) {
const { FLW_PUBLIC_KEY, tx_ref, amount, currency, country, payment_options, redirect_url, consumer_id, consumer_mac, email, phone_number, name, title, description, logo, colour, buttonText, customButton, subaccount } = props;
function Rave(props, {}) {
const { FLW_PUBLIC_KEY, tx_ref, amount, currency, country, payment_options, redirect_url, consumer_id, consumer_mac, email, phone_number, name, title, description, logo, colour, buttonText, customButton, subaccount, submitPendingTrx } = props;
const meta = {
consumer_id,
consumer_mac,
Expand Down Expand Up @@ -149,15 +149,15 @@ function Rave(props) {
logo,
};
return (<react_native_1.View style={styles.container}>
<react_native_1.Modal style={styles.modalView} visible={visible} animationType="slide" transparent={true}>
<react_native_autoheight_webview_1.default source={{ html: (0, HtmlRave_1.HtmlRave)(payLoad) }} style={styles.wevView} onMessage={e => { messageRecived(e.nativeEvent.data); }} onLoadStart={() => setvalue(Object.assign(Object.assign({}, value), { loading: true }))} onLoadEnd={() => setvalue(Object.assign(Object.assign({}, value), { loading: false }))} javaScriptEnabled viewportContent={'width=device-width, user-scalable=no'}/>
{loading && <react_native_1.ActivityIndicator size="large" color={colour}/>}
</react_native_1.Modal>
<>
{verify ?
<react_native_1.Modal style={styles.modalView} visible={visible} animationType="slide" transparent={true}>
<react_native_autoheight_webview_1.default source={{ html: (0, HtmlRave_1.HtmlRave)(payLoad) }} style={styles.wevView} onMessage={e => { messageRecived(e.nativeEvent.data); }} onLoadStart={() => setvalue(Object.assign(Object.assign({}, value), { loading: true }))} onLoadEnd={() => setvalue(Object.assign(Object.assign({}, value), { loading: false }))} javaScriptEnabled viewportContent={'width=device-width, user-scalable=no'}/>
{loading && <react_native_1.ActivityIndicator size="large" color={colour}/>}
</react_native_1.Modal>
<>
{verify ?
<>
<react_native_1.Modal style={styles.modalView} visible={verify} animationType="slide" transparent={false}>
<react_native_1.View style={{
<react_native_1.Modal style={styles.modalView} visible={verify} animationType="slide" transparent={false}>
<react_native_1.View style={{
flex: 1,
height,
width,
Expand All @@ -166,22 +166,25 @@ function Rave(props) {
alignContent: 'center',
alignItems: 'center'
}}>
<react_native_1.Text>Wait !, verifying your payment </react_native_1.Text>
<react_native_1.ActivityIndicator size="large" color={colour}/>
</react_native_1.View>
</react_native_1.Modal>
</>
<react_native_1.Text>Wait !, verifying your payment </react_native_1.Text>
<react_native_1.ActivityIndicator size="large" color={colour}/>
</react_native_1.View>
</react_native_1.Modal>
</>
:
<>
{customButton ? (<react_native_1.TouchableOpacity disabled={loading} onPress={() => setvalue(Object.assign(Object.assign({}, value), { visible: true }))} style={{
{customButton ? (<react_native_1.TouchableOpacity disabled={loading} onPress={() => {
submitPendingTrx();
setvalue(Object.assign(Object.assign({}, value), { visible: true }));
}} style={{
height: '100%',
width: '100%',
backgroundColor: 'transparent',
}}/>) : (<react_native_1.Button color={colour} disabled={loading} title={buttonText} onPress={() => setvalue(Object.assign(Object.assign({}, value), { visible: true }))}/>)}
</>}
</>
</react_native_1.View>);
}}>{props.children}</react_native_1.TouchableOpacity>) : (<react_native_1.Button color={colour} disabled={loading} title={buttonText} onPress={() => setvalue(Object.assign(Object.assign({}, value), { visible: true }))}/>)}

</>}
</>
</react_native_1.View>);
}
exports.default = Rave;
const { height, width } = react_native_1.Dimensions.get('screen');
Expand Down

0 comments on commit 4a65763

Please sign in to comment.