boxpay-checkout-reactnative-sdk
Version:
Boxpay Payment Gateway
34 lines (33 loc) • 669 B
JavaScript
;
import React from 'react';
import { WebView } from 'react-native-webview';
import { jsx as _jsx } from "react/jsx-runtime";
const WebViewScreen = ({
url,
html,
onBackPress,
...props
}) => {
const source = html ? {
html: html
} : url ? {
uri: url
} : {
html: '<h1>No content provided</h1>'
};
return /*#__PURE__*/_jsx(WebView, {
source: source,
...props,
style: {
flex: 1
},
javaScriptEnabled: true,
onNavigationStateChange: event => {
if (event.url.includes('boxpay')) {
onBackPress();
}
}
});
};
export default WebViewScreen;
//# sourceMappingURL=webViewScreen.js.map