react-native-bootpay-api 13.13.4 → 13.13.41

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.
package/src/Bootpay.tsx CHANGED
@@ -1,479 +1,338 @@
1
-
2
-
3
1
  import React, { Component } from 'react';
4
- import { SafeAreaView, Modal, TouchableOpacity, Image, StyleSheet, Platform } from 'react-native';
5
- // import { StyleSheet, Platform } from 'react-native';
6
- // import { Platform, StyleSheet, Dimensions } from 'react-native';
7
- import WebView, {WebViewMessageEvent} from 'react-native-webview-bootpay';
8
- import { BootpayTypesProps, Payload, Extra, Item, User } from './BootpayTypes';
9
- import {debounce} from 'lodash';
10
- import UserInfo from './UserInfo'
11
-
12
-
2
+ import {
3
+ SafeAreaView,
4
+ Modal,
5
+ TouchableOpacity,
6
+ Image,
7
+ StyleSheet,
8
+ Platform,
9
+ } from 'react-native';
10
+ import WebView, { WebViewMessageEvent } from 'react-native-webview-bootpay';
11
+ import { BootpayTypesProps, Payload, Item, User, Extra } from './BootpayTypes';
12
+ import { debounce } from 'lodash';
13
+ import UserInfo from './UserInfo';
14
+
15
+ const SDK_VERSION = '13.13.4';
16
+ const DEBUG_MODE = false;
13
17
 
14
18
  export class Bootpay extends Component<BootpayTypesProps> {
15
- // webView = useRef<WebView>(null);
16
-
17
- webView: React.RefObject<WebView>;
18
-
19
- constructor(props: BootpayTypesProps) {
20
- super(props);
21
-
22
- this.webView = React.createRef();
23
- }
24
-
25
- payload?: Payload
26
-
27
- state = {
28
- visibility: false,
29
- script: '',
30
- firstLoad: false,
31
- showCloseButton: false,
32
- isShowProgress: false
33
- }
34
- // _payload = {}
35
- _VERSION = "13.13.4"
36
- _DEBUG = false;
37
-
38
-
39
- dismiss = () => {
40
- this.setState(
41
- {
42
- visibility: false
43
- }
44
- )
45
- }
46
-
47
-
48
- showProgressBar = (isShow: boolean) => {
49
- this.setState(
50
- {
51
- isShowProgress: isShow
52
- }
53
- )
54
- }
55
-
56
-
57
- closeDismiss = () => {
58
- if(this.props.onClose != undefined) this.props.onClose();
59
- this.dismiss();
60
- }
61
-
62
-
63
-
64
- onMessage = async (event: WebViewMessageEvent) => {
65
-
66
- if (event == undefined) return;
67
- console.log(event.nativeEvent.data);
68
-
69
- const res = JSON.parse(JSON.stringify(event.nativeEvent.data));
70
-
71
- console.log(res);
72
-
73
-
74
- if(res == 'close') {
75
- this.showProgressBar(false);
76
- this.closeDismiss();
77
- return;
78
- }
79
-
80
-
81
- const data = JSON.parse(res);
82
- // console.log(`redirect: ${JSON.stringify(data)}`);
83
-
84
- var redirect = false
85
- let show_success = false
86
- let show_error = false
87
-
88
-
89
- if(this.payload?.extra != undefined) {
90
- if(this.payload.extra?.open_type == 'redirect') {
91
- redirect = true;
92
- }
93
- if(this.payload.extra?.display_error_result == true) {
94
- show_error = true;
95
- }
96
- if(this.payload.extra?.display_success_result == true) {
97
- show_success = true;
98
- }
99
-
100
- }
101
-
102
- if(redirect === true) {
103
- switch (data.event) {
104
- case 'cancel':
105
- this.showProgressBar(false);
106
- if(this.props.onCancel != undefined) this.props.onCancel(data);
107
- this.closeDismiss();
108
- break;
109
- case 'error':
110
- this.showProgressBar(false);
111
- if(this.props.onError != undefined) this.props.onError(data);
112
- if(show_error == false) {
113
- this.closeDismiss();
114
- }
115
- break;
116
- case 'issued':
117
- this.showProgressBar(false);
118
- if(this.props.onIssued != undefined) this.props.onIssued(data);
119
- if(show_success == false) {
120
- this.closeDismiss();
121
- }
122
- break;
123
- case 'confirm':
124
- this.showProgressBar(true);
125
- // if(this.props.onConfirm != undefined) this.props.onConfirm(data);
126
- if(this.props.onConfirm != undefined) {
127
- if(this.props.onConfirm(data)) {
128
- this.transactionConfirm();
129
- }
130
- }
131
- break;
132
- case 'done':
133
- this.showProgressBar(false);
134
- if(this.props.onDone != undefined) this.props.onDone(data);
135
- if(show_success == false) {
136
- this.closeDismiss();
137
- }
138
- break;
139
- case 'close':
140
- this.showProgressBar(false);
141
- this.closeDismiss();
142
- break;
143
- }
144
- } else {
145
- switch (data.event) {
146
- case 'cancel':
147
- this.showProgressBar(false);
148
- if(this.props.onCancel != undefined) this.props.onCancel(data);
149
- break;
150
- case 'error':
151
- this.showProgressBar(false);
152
- if(this.props.onError != undefined) this.props.onError(data);
153
- break;
154
- case 'issued':
155
- this.showProgressBar(false);
156
- if(this.props.onIssued != undefined) this.props.onIssued(data);
157
- break;
158
- case 'confirm':
159
- this.showProgressBar(true);
160
- if(this.props.onConfirm != undefined) {
161
- if(this.props.onConfirm(data)) {
162
- this.transactionConfirm();
163
- }
164
- }
165
- break;
166
- case 'done':
167
- this.showProgressBar(false);
168
- if(this.props.onDone != undefined) this.props.onDone(data);
169
- break;
170
- case 'close':
171
- this.showProgressBar(false);
172
- this.closeDismiss();
173
- break;
174
- }
175
- }
176
- }
177
-
178
- onShouldStartLoadWithRequest = (_ : string) => {
179
- return true;
180
- }
181
-
182
- getSDKVersion = () => {
183
- if(Platform.OS == 'ios') {
184
- return "Bootpay.setVersion('" + this._VERSION + "', 'ios_react_native')"
185
- // return "Bootpay.setDevice('IOS');";
186
- } else if(Platform.OS == 'android'){
187
- return "Bootpay.setVersion('" + this._VERSION + "', 'android_react_native')"
188
- // return "Bootpay.setDevice('ANDROID');";
189
- } else {
190
- return ""
191
- }
192
- }
193
-
194
- getEnvironmentMode = () => {
195
- if(this._DEBUG) {
196
- return "Bootpay.setEnvironmentMode('development');";
197
-
198
- }
199
- return "";
200
- }
201
-
202
- getBootpayPlatform = () => {
203
- if(Platform.OS == 'ios') {
204
- return "Bootpay.setDevice('IOS');";
205
- } else if(Platform.OS == 'android'){
206
- return "Bootpay.setDevice('ANDROID');";
207
- } else {
208
- return ""
209
- }
210
- }
211
-
212
- // setPayScript = () => {
213
- // const fullScript = this.generateScript(this.state.script);
214
- // this.injectJavaScript(fullScript);
215
- // if(this.state.showCloseButton == true) {
216
- // if(this.webView == null || this.webView == undefined) return;
217
- // this.webView.showCloseButton( );
218
- // }
219
- // }
220
-
221
- transactionConfirm = () => {
222
- const script = "Bootpay.confirm()"
223
- +
224
- ".then( function (res) {" +
225
- this.confirm() +
226
- this.issued() +
227
- this.done() +
228
- "}, function (res) {" +
229
- this.error() +
230
- this.cancel() +
231
- "})";
232
-
233
- this.callJavaScript(script);
234
- }
235
-
236
- removePaymentWindow = () => {
237
- this.dismiss();
238
- // this.callJavaScript(`
239
- // Bootpay.removePaymentWindow();
240
- // `);
241
- }
242
-
243
- callJavaScript = (script: string) => {
244
- if(this.webView == null || this.webView == undefined) return
245
-
246
- this.webView.current?.injectJavaScript(`
247
- setTimeout(function() { ${script} }, 30);
248
- `)
249
- }
250
-
251
- getAnalyticsData = async () => {
252
- const uuid = await UserInfo.getBootpayUUID();
253
- // const bootpaySK = await UserInfo.getBootpaySK();
254
- const bootLastTime = await UserInfo.getBootpayLastTime();
255
-
256
-
257
- const elaspedTime = Date.now() - bootLastTime;
258
- return `window.Bootpay.$analytics.setAnalyticsData({uuid:'${uuid}', time:${elaspedTime}});`;
259
- // this.callJavaScript(`window.BootPay.setAnalyticsData({uuid:'${uuid}',sk:'${bootpaySK}',sk_time:${bootLastTime},time:${elaspedTime}});`);
260
- }
261
-
262
- confirm = () => {
263
- return "if (res.event === 'confirm') { window.BootpayRNWebView.postMessage( JSON.stringify(res) ); }";
264
- }
265
-
266
- done = () => {
267
- return "else if (res.event === 'done') { window.BootpayRNWebView.postMessage( JSON.stringify(res) ); }";
268
- }
269
-
270
- issued = () => {
271
- return "else if (res.event === 'issued') { window.BootpayRNWebView.postMessage( JSON.stringify(res) ); }";
272
- }
273
-
274
- error = () => {
275
- return "if (res.event === 'error') { window.BootpayRNWebView.postMessage( JSON.stringify(res) ); }";
276
- }
277
-
278
- cancel = () => {
279
- return "else if (res.event === 'cancel') { window.BootpayRNWebView.postMessage( JSON.stringify(res) ); }";
280
- }
281
-
282
- close = () => {
283
- return "document.addEventListener('bootpayclose', function (e) { window.BootpayRNWebView.postMessage('close'); });";
284
- }
285
-
286
-
287
-
288
- async componentWillUnmount() {
289
- this.setState(
290
- {
291
- visibility: false,
292
- firstLoad: false,
293
- showCloseButton: false
294
- }
295
- )
296
- UserInfo.setBootpayLastTime(Date.now());
297
- }
298
-
299
-
300
- componentDidMount() {
301
- this.closeDismiss = debounce(this.closeDismiss, 30);
302
- }
303
-
304
- render() {
305
- return (
306
- <Modal
307
- animationType={'slide'}
308
- transparent={false}
309
- onRequestClose={()=> {
310
- this.closeDismiss();
311
- // console.log(1234);
312
- // this.dismiss();
313
- }}
314
-
315
- visible={this.state.visibility}>
316
- <SafeAreaView style={{ flex: 1 }}>
317
- {
318
- this.state.showCloseButton &&
319
- <TouchableOpacity
320
- onPress={() => {
321
- var cancelData = {
322
- action: 'BootpayCancel',
323
- message: '사용자에 의해 취소되었습니다'
324
- }
325
-
326
- if(this.props.onCancel != undefined) this.props.onCancel(cancelData);
327
- if(this.props.onClose != undefined) this.props.onClose();
328
-
329
- this.setState({visibility: false})
330
-
331
- // this.showProgressBar(true);
332
-
333
- } }>
334
- <Image
335
- style={[styles.overlay]}
336
- source={require('../images/close.png')} />
337
- </TouchableOpacity>
338
- }
339
-
340
- <WebView
341
- ref={this.webView}
342
- originWhitelist={['*']}
343
- source={{
344
- uri: 'https://webview.bootpay.co.kr/5.1.0'
345
- }}
346
- injectedJavaScript={this.state.script}
347
- javaScriptEnabled={true}
348
- javaScriptCanOpenWindowsAutomatically={true}
349
- // scalesPageToFit={true}
350
- onMessage={this.onMessage}
351
- onError={(syntheticEvent) => {
352
- const { nativeEvent } = syntheticEvent;
353
- if(nativeEvent.code == 3) {
354
- this.showProgressBar(false);
355
- if(this.props.onError != undefined) this.props.onError({
356
- code: nativeEvent.code,
357
- message: nativeEvent.description
358
- });
359
- this.closeDismiss();
360
- }
361
- }}
362
- // onError={ error => {
363
- // if(error.code == 3) {
364
- // console.log()
365
- // }
366
- // }}
367
- // onError={syntheticEvent => {
368
- // const { nativeEvent } = syntheticEvent;
369
- // console.warn('WebView error: ', nativeEvent);
370
- // }}
371
- // onError={}
372
- />
373
- </SafeAreaView>
374
-
375
-
376
- </Modal>
377
- )
378
- }
379
-
380
- // onMessage = async (event: WebViewMessageEvent) => {
381
-
382
-
383
-
384
-
385
- requestPayment = async (payload: Payload, items: [Item], user: User, extra: Extra) => {
386
-
387
- this.bootpayRequest(payload, items, user, extra, "requestPayment");
388
- }
389
-
390
- requestSubscription = async (payload: Payload, items: [Item], user: User, extra: Extra) => {
391
- this.bootpayRequest(payload, items, user, extra, "requestSubscription");
392
- }
393
-
394
- requestAuthentication = async (payload: Payload, items: [Item], user: User, extra: Extra) => {
395
- this.bootpayRequest(payload, items, user, extra, "requestAuthentication");
396
- }
397
-
398
- bootpayRequest = async (payload: Payload, items: [Item], user: User, extra: Extra, requestMethod: string) => {
399
-
400
- payload.application_id = Platform.OS == 'ios' ? this.props.ios_application_id : this.props.android_application_id;
401
- payload.items = items;
402
- payload.user = user;
403
-
404
-
405
- payload.user = Object.assign(new User(), user); //set default value from class optional parameter value
406
- payload.extra = Object.assign(new Extra(), extra); //set default value from class optional parameter value
407
-
408
-
409
- this.payload = payload
410
-
411
- this.setState(
412
- {
413
- visibility: true,
414
- script: `
415
- ${await this.getMountJavascript()}
416
- ${this.generateScript(payload, requestMethod)}
417
- `,
418
- firstLoad: false,
419
- showCloseButton: extra.show_close_button || false,
420
- spinner: false
421
- }
422
- )
423
-
424
-
425
- UserInfo.updateInfo();
426
- }
427
-
428
-
429
- getMountJavascript = async () => {
430
- return `
19
+ getMountJavascript = async () => {
20
+ return `
431
21
  ${this.getSDKVersion()}
432
22
  ${this.getEnvironmentMode()}
433
23
  ${this.getBootpayPlatform()}
434
24
  ${this.close()}
435
25
  ${await this.getAnalyticsData()}
436
- `;
26
+ `;
27
+ };
28
+
29
+ webView: React.RefObject<WebView>;
30
+ payload?: Payload;
31
+
32
+ constructor(props: BootpayTypesProps) {
33
+ super(props);
34
+ this.webView = React.createRef();
35
+ }
36
+
37
+ state = {
38
+ visibility: false,
39
+ script: '',
40
+ firstLoad: false,
41
+ showCloseButton: false,
42
+ isShowProgress: false,
43
+ };
44
+
45
+ dismiss = () => {
46
+ this.setState({ visibility: false });
47
+ };
48
+
49
+ showProgressBar = (isShow: boolean) => {
50
+ this.setState({ isShowProgress: isShow });
51
+ };
52
+
53
+ closeDismiss = () => {
54
+ if (this.props.onClose) this.props.onClose();
55
+ this.dismiss();
56
+ };
57
+
58
+ callJavaScript = (script: string) => {
59
+ this.webView.current?.injectJavaScript(
60
+ `setTimeout(function() { ${script} }, 30);`
61
+ );
62
+ };
63
+
64
+ transactionConfirm = () => {
65
+ const script = `
66
+ Bootpay.confirm()
67
+ .then(res => {
68
+ ${this.confirm()}
69
+ ${this.issued()}
70
+ ${this.done()}
71
+ }, res => {
72
+ ${this.error()}
73
+ ${this.cancel()}
74
+ });
75
+ `;
76
+ this.callJavaScript(script);
77
+ };
78
+
79
+ confirm = () => {
80
+ return "if (res.event === 'confirm') { window.BootpayRNWebView.postMessage( JSON.stringify(res) ); }";
81
+ };
82
+
83
+ done = () => {
84
+ return "else if (res.event === 'done') { window.BootpayRNWebView.postMessage( JSON.stringify(res) ); }";
85
+ };
86
+
87
+ issued = () => {
88
+ return "else if (res.event === 'issued') { window.BootpayRNWebView.postMessage( JSON.stringify(res) ); }";
89
+ };
90
+
91
+ error = () => {
92
+ return "if (res.event === 'error') { window.BootpayRNWebView.postMessage( JSON.stringify(res) ); }";
93
+ };
94
+
95
+ cancel = () => {
96
+ return "else if (res.event === 'cancel') { window.BootpayRNWebView.postMessage( JSON.stringify(res) ); }";
97
+ };
98
+
99
+ close = () => {
100
+ return "document.addEventListener('bootpayclose', function (e) { window.BootpayRNWebView.postMessage('close'); });";
101
+ };
102
+
103
+ onMessage = async (event: WebViewMessageEvent) => {
104
+ if (!event) return;
105
+
106
+ try {
107
+ const res = JSON.parse(event.nativeEvent.data);
108
+ // console.log(res);
109
+
110
+ if (res === 'close') {
111
+ this.showProgressBar(false);
112
+ this.closeDismiss();
113
+ return;
114
+ }
115
+
116
+ const data = typeof res === 'string' ? JSON.parse(res) : res;
117
+
118
+ // let redirect = false;
119
+ let show_success = false;
120
+ let show_error = false;
121
+
122
+ if (this.payload?.extra) {
123
+ // redirect = this.payload.extra?.open_type === 'redirect';
124
+ show_error = !!this.payload.extra?.display_error_result;
125
+ show_success = !!this.payload.extra?.display_success_result;
126
+ }
127
+
128
+ const handleEvent = (_eventName, callback, showResult) => {
129
+ this.showProgressBar(false);
130
+ if (callback) callback(data);
131
+ if (!showResult) this.closeDismiss();
132
+ };
133
+
134
+ switch (data.event) {
135
+ case 'cancel':
136
+ handleEvent('cancel', this.props.onCancel, false);
137
+ break;
138
+ case 'error':
139
+ handleEvent('error', this.props.onError, show_error);
140
+ break;
141
+ case 'issued':
142
+ handleEvent('issued', this.props.onIssued, show_success);
143
+ break;
144
+ case 'confirm':
145
+ this.showProgressBar(true);
146
+ if (this.props.onConfirm && this.props.onConfirm(data)) {
147
+ this.transactionConfirm();
148
+ }
149
+ break;
150
+ case 'done':
151
+ handleEvent('done', this.props.onDone, show_success);
152
+ break;
153
+ case 'close':
154
+ this.showProgressBar(false);
155
+ this.closeDismiss();
156
+ break;
157
+ default:
158
+ console.warn(`Unknown event type: ${data.event}`);
159
+ break;
160
+ }
161
+ } catch (error) {
162
+ console.error('Error processing message:', error);
437
163
  }
438
-
439
-
440
- generateScript= (payload: Payload, requestMethod: string) => {
441
- const script = "Bootpay." + requestMethod +
442
- `(${JSON.stringify(payload)})` +
443
- ".then( function (res) {" +
444
- this.confirm() +
445
- this.issued() +
446
- this.done() +
447
- "}, function (res) {" +
448
- this.error() +
449
- this.cancel() +
450
- "}); void(0);";
451
-
452
- return script;
453
- }
454
-
164
+ };
165
+
166
+ generateScript = (payload: Payload, requestMethod: string) => {
167
+ return `
168
+ Bootpay.${requestMethod}(${JSON.stringify(payload)})
169
+ .then(res => {
170
+ ${this.confirm()}
171
+ ${this.issued()}
172
+ ${this.done()}
173
+ }, res => {
174
+ ${this.error()}
175
+ ${this.cancel()}
176
+ });
177
+ `;
178
+ };
179
+
180
+ getSDKVersion = () => {
181
+ const os = Platform.OS;
182
+ return `Bootpay.setVersion('${SDK_VERSION}', '${os}_react_native')`;
183
+ };
184
+
185
+ getEnvironmentMode = () => {
186
+ return DEBUG_MODE ? "Bootpay.setEnvironmentMode('development');" : '';
187
+ };
188
+
189
+ getBootpayPlatform = () => {
190
+ return Platform.OS === 'ios'
191
+ ? "Bootpay.setDevice('IOS');"
192
+ : "Bootpay.setDevice('ANDROID');";
193
+ };
194
+
195
+ async componentWillUnmount() {
196
+ this.setState({
197
+ visibility: false,
198
+ firstLoad: false,
199
+ showCloseButton: false,
200
+ });
201
+ UserInfo.setBootpayLastTime(Date.now());
202
+ }
203
+
204
+ componentDidMount() {
205
+ this.closeDismiss = debounce(this.closeDismiss, 30);
206
+ }
207
+
208
+ removePaymentWindow = () => {
209
+ this.dismiss();
210
+ // this.callJavaScript(`
211
+ // Bootpay.removePaymentWindow();
212
+ // `);
213
+ };
214
+
215
+ getAnalyticsData = async () => {
216
+ const uuid = await UserInfo.getBootpayUUID();
217
+ const bootpaySK = await UserInfo.getBootpaySK();
218
+ const bootLastTime = await UserInfo.getBootpayLastTime();
219
+
220
+ const elaspedTime = Date.now() - bootLastTime;
221
+
222
+ console.log(uuid, bootpaySK, bootLastTime);
223
+
224
+ return `window.Bootpay.$analytics.setAnalyticsData({uuid:'${uuid}',sk:'${bootpaySK}',time:${elaspedTime}});`;
225
+ };
226
+
227
+ requestPayment = async (
228
+ payload: Payload,
229
+ items: [Item],
230
+ user: User,
231
+ extra: Extra
232
+ ) => {
233
+ this.bootpayRequest(payload, items, user, extra, 'requestPayment');
234
+ };
235
+
236
+ requestSubscription = async (
237
+ payload: Payload,
238
+ items: [Item],
239
+ user: User,
240
+ extra: Extra
241
+ ) => {
242
+ this.bootpayRequest(payload, items, user, extra, 'requestSubscription');
243
+ };
244
+
245
+ requestAuthentication = async (
246
+ payload: Payload,
247
+ items: [Item],
248
+ user: User,
249
+ extra: Extra
250
+ ) => {
251
+ this.bootpayRequest(payload, items, user, extra, 'requestAuthentication');
252
+ };
253
+
254
+ bootpayRequest = async (
255
+ payload: Payload,
256
+ items: [Item],
257
+ user: User,
258
+ extra: Extra,
259
+ requestMethod: string
260
+ ) => {
261
+ payload.application_id =
262
+ Platform.OS === 'ios'
263
+ ? this.props.ios_application_id
264
+ : this.props.android_application_id;
265
+ payload.items = items;
266
+ payload.user = user;
267
+
268
+ payload.user = Object.assign(new User(), user); //set default value from class optional parameter value
269
+ payload.extra = Object.assign(new Extra(), extra); //set default value from class optional parameter value
270
+
271
+ this.payload = payload;
272
+
273
+ this.setState({
274
+ visibility: true,
275
+ script: `
276
+ ${await this.getMountJavascript()}
277
+ ${this.generateScript(payload, requestMethod)}
278
+ `,
279
+ firstLoad: false,
280
+ showCloseButton: extra.show_close_button || false,
281
+ spinner: false,
282
+ });
283
+
284
+ UserInfo.updateInfo();
285
+ };
286
+
287
+ render() {
288
+ return (
289
+ <Modal
290
+ animationType="slide"
291
+ transparent={false}
292
+ visible={this.state.visibility}
293
+ onRequestClose={this.closeDismiss}
294
+ >
295
+ <SafeAreaView style={{ flex: 1 }}>
296
+ {this.state.showCloseButton && (
297
+ <TouchableOpacity onPress={this.closeDismiss}>
298
+ <Image
299
+ style={styles.overlay}
300
+ source={require('../images/close.png')}
301
+ />
302
+ </TouchableOpacity>
303
+ )}
304
+ <WebView
305
+ ref={this.webView}
306
+ originWhitelist={['*']}
307
+ source={{ uri: 'https://webview.bootpay.co.kr/5.1.0' }}
308
+ injectedJavaScript={this.state.script}
309
+ javaScriptEnabled
310
+ javaScriptCanOpenWindowsAutomatically
311
+ onMessage={this.onMessage}
312
+ onError={(syntheticEvent) => {
313
+ const { nativeEvent } = syntheticEvent;
314
+ if (nativeEvent.code === 3) {
315
+ this.showProgressBar(false);
316
+ if (this.props.onError)
317
+ this.props.onError({
318
+ code: nativeEvent.code,
319
+ message: nativeEvent.description,
320
+ });
321
+ this.closeDismiss();
322
+ }
323
+ }}
324
+ />
325
+ </SafeAreaView>
326
+ </Modal>
327
+ );
328
+ }
455
329
  }
456
330
 
457
-
458
- var styles = StyleSheet.create({
459
- container: {
460
- flex: 1,
461
- justifyContent: 'center',
462
- alignItems: 'center',
463
- backgroundColor: '#F5FCFF',
464
- },
465
- welcome: {
466
- fontSize: 20,
467
- textAlign: 'center',
468
- margin: 10,
469
- },
470
- // Flex to fill, position absolute,
471
- // Fixed left/top, and the width set to the window width
472
- overlay: {
473
- width: 25,
474
- height: 25,
475
- right: 5,
476
- alignSelf: 'flex-end'
477
- }
331
+ const styles = StyleSheet.create({
332
+ overlay: {
333
+ width: 25,
334
+ height: 25,
335
+ right: 5,
336
+ alignSelf: 'flex-end',
337
+ },
478
338
  });
479
-