Skip to content

Commit 701be84

Browse files
Merge pull request #24 from Flutterwave/fix-update-react-version
update react version and fix closePaymentModal issues
2 parents a4acd46 + 9a46a1d commit 701be84

10 files changed

+12278
-7870
lines changed

dist/index.es.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,10 @@ var FlutterWaveButton = function (_a) {
216216
* function to be called when you want to close payment
217217
*/
218218
function closePaymentModal() {
219-
document.getElementsByName('checkout')[0].setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;');
220-
document.body.style.overflow = '';
219+
document.getElementsByName('checkout').forEach(function (item) {
220+
item.setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;');
221+
document.body.style.overflow = '';
222+
});
221223
}
222224

223225
export { FlutterWaveButton, types as FlutterWaveTypes, closePaymentModal, useFlutterwave };

dist/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,10 @@ var FlutterWaveButton = function (_a) {
220220
* function to be called when you want to close payment
221221
*/
222222
function closePaymentModal() {
223-
document.getElementsByName('checkout')[0].setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;');
224-
document.body.style.overflow = '';
223+
document.getElementsByName('checkout').forEach(function (item) {
224+
item.setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;');
225+
document.body.style.overflow = '';
226+
});
225227
}
226228

227229
exports.FlutterWaveButton = FlutterWaveButton;

example/package-lock.json

+11,818-7,762
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"@testing-library/jest-dom": "^4.2.4",
77
"@testing-library/react": "^9.3.2",
88
"@testing-library/user-event": "^7.1.2",
9-
"react": "^16.13.1",
10-
"react-dom": "^16.13.1",
11-
"react-scripts": "3.4.1"
9+
"react": "^17.0.2",
10+
"react-dom": "^17.0.2",
11+
"react-scripts": "4.0.3"
1212
},
1313
"scripts": {
1414
"start": "react-scripts start",

example/src/App.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default function App() {
2626

2727
const fwConfig = {
2828
...config,
29-
text: 'Pay with Flutterwave!',
29+
text: 'Pay with Flutterwave btn',
3030
callback: (response) => {
3131
console.log(response);
3232
closePaymentModal()

example/src/dist/index.es.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,10 @@ var FlutterWaveButton = function (_a) {
216216
* function to be called when you want to close payment
217217
*/
218218
function closePaymentModal() {
219-
document.getElementsByName('checkout')[0].setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;');
220-
document.body.style.overflow = '';
219+
document.getElementsByName('checkout').forEach(function (item) {
220+
item.setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;');
221+
document.body.style.overflow = '';
222+
});
221223
}
222224

223225
export { FlutterWaveButton, types as FlutterWaveTypes, closePaymentModal, useFlutterwave };

example/src/dist/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,10 @@ var FlutterWaveButton = function (_a) {
220220
* function to be called when you want to close payment
221221
*/
222222
function closePaymentModal() {
223-
document.getElementsByName('checkout')[0].setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;');
224-
document.body.style.overflow = '';
223+
document.getElementsByName('checkout').forEach(function (item) {
224+
item.setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;');
225+
document.body.style.overflow = '';
226+
});
225227
}
226228

227229
exports.FlutterWaveButton = FlutterWaveButton;

0 commit comments

Comments
 (0)