tf-checkout-react-native 1.0.13 → 1.0.14
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/README.md +346 -166
- package/android/build.gradle +3 -3
- package/lib/api/ApiClient.d.ts +13 -21
- package/lib/api/ApiClient.js +122 -51
- package/lib/api/ApiClient.js.map +1 -1
- package/lib/api/types.d.ts +21 -11
- package/lib/components/login/Login.d.ts +1 -1
- package/lib/components/login/Login.js +21 -9
- package/lib/components/login/Login.js.map +1 -1
- package/lib/components/login/types.d.ts +7 -7
- package/lib/components/waitingList/WaitingList.d.ts +1 -1
- package/lib/components/waitingList/WaitingList.js +20 -3
- package/lib/components/waitingList/WaitingList.js.map +1 -1
- package/lib/components/waitingList/WaitingListView.js +19 -7
- package/lib/components/waitingList/WaitingListView.js.map +1 -1
- package/lib/components/waitingList/types.d.ts +10 -0
- package/lib/containers/billingInfo/Billing.d.ts +2 -1
- package/lib/containers/billingInfo/Billing.js +92 -52
- package/lib/containers/billingInfo/Billing.js.map +1 -1
- package/lib/containers/billingInfo/types.d.ts +21 -10
- package/lib/containers/checkout/Checkout.d.ts +1 -1
- package/lib/containers/checkout/Checkout.js +83 -48
- package/lib/containers/checkout/Checkout.js.map +1 -1
- package/lib/containers/checkout/styles.d.ts +2 -0
- package/lib/containers/checkout/styles.js +3 -1
- package/lib/containers/checkout/styles.js.map +1 -1
- package/lib/containers/checkout/types.d.ts +26 -7
- package/lib/containers/myOrderDetails/MyOrderDetails.js +21 -3
- package/lib/containers/myOrderDetails/MyOrderDetails.js.map +1 -1
- package/lib/containers/myOrderDetails/MyOrderDetailsView.js +10 -7
- package/lib/containers/myOrderDetails/MyOrderDetailsView.js.map +1 -1
- package/lib/containers/myOrderDetails/components/Notification.d.ts +10 -2
- package/lib/containers/myOrderDetails/components/Notification.js +5 -7
- package/lib/containers/myOrderDetails/components/Notification.js.map +1 -1
- package/lib/containers/myOrderDetails/types.d.ts +18 -0
- package/lib/containers/myOrders/MyOrders.js +36 -8
- package/lib/containers/myOrders/MyOrders.js.map +1 -1
- package/lib/containers/myOrders/MyOrdersView.d.ts +1 -1
- package/lib/containers/myOrders/MyOrdersView.js +3 -3
- package/lib/containers/myOrders/MyOrdersView.js.map +1 -1
- package/lib/containers/myOrders/types.d.ts +13 -1
- package/lib/containers/purchaseConfirmation/PurchaseConfirmation.d.ts +1 -1
- package/lib/containers/purchaseConfirmation/PurchaseConfirmation.js +21 -5
- package/lib/containers/purchaseConfirmation/PurchaseConfirmation.js.map +1 -1
- package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.d.ts +1 -1
- package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.js +4 -3
- package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.js.map +1 -1
- package/lib/containers/purchaseConfirmation/types.d.ts +8 -0
- package/lib/containers/tickets/Tickets.d.ts +1 -1
- package/lib/containers/tickets/Tickets.js +37 -9
- package/lib/containers/tickets/Tickets.js.map +1 -1
- package/lib/containers/tickets/TicketsView.d.ts +1 -1
- package/lib/containers/tickets/TicketsView.js +5 -4
- package/lib/containers/tickets/TicketsView.js.map +1 -1
- package/lib/containers/tickets/components/TicketListItem.js +14 -7
- package/lib/containers/tickets/components/TicketListItem.js.map +1 -1
- package/lib/containers/tickets/components/types.d.ts +6 -0
- package/lib/containers/tickets/types.d.ts +18 -11
- package/lib/helpers/LocalStorage.d.ts +1 -1
- package/lib/helpers/LocalStorage.js +1 -3
- package/lib/helpers/LocalStorage.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/res/colors.d.ts +2 -2
- package/lib/res/colors.js +2 -18
- package/lib/res/colors.js.map +1 -1
- package/lib/types/IError.d.ts +5 -0
- package/lib/types/IError.js +2 -0
- package/lib/types/IError.js.map +1 -0
- package/lib/types/ITicket.d.ts +12 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -15,17 +15,15 @@ Configure [ReactNative environment](https://reactnative.dev/docs/environment-set
|
|
|
15
15
|
### Android
|
|
16
16
|
|
|
17
17
|
- Android 5.0 (API level 21) and above
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
- Compile Sdk Version and Target Sdk Version `
|
|
21
|
-
- Build Tools Version `30.0.
|
|
18
|
+
- Gradle plugin version `4.2.2`
|
|
19
|
+
- Gradle version `6.7.1`
|
|
20
|
+
- Compile Sdk Version and Target Sdk Version `30`
|
|
21
|
+
- Build Tools Version `30.0.2`
|
|
22
|
+
- Java version `1.8`
|
|
23
|
+
- Kotlin version `1.5.31`
|
|
22
24
|
|
|
23
25
|
Add the following to your Android Manifest as activity property.
|
|
24
26
|
|
|
25
|
-
```
|
|
26
|
-
android:exported="true"
|
|
27
|
-
```
|
|
28
|
-
|
|
29
27
|
To download the PDFs, add the `WRITE_EXTERNAL_STORAGE` permission to the Android's Manifest file.
|
|
30
28
|
|
|
31
29
|
```xml
|
|
@@ -197,10 +195,23 @@ Then add it to the render function.
|
|
|
197
195
|
|
|
198
196
|
```js
|
|
199
197
|
<Login
|
|
200
|
-
onLoginSuccessful
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
198
|
+
onLoginSuccessful: (userProfile: IUserProfile, accessToken: string) => void
|
|
199
|
+
onLoginError?: (error: IError) => void
|
|
200
|
+
|
|
201
|
+
onFetchUserProfileError?: (error: IError) => void
|
|
202
|
+
onFetchUserProfileSuccess?: (data: any) => void
|
|
203
|
+
|
|
204
|
+
onFetchAccessTokenError?: (error: IError) => void
|
|
205
|
+
onFetchAccessTokenSuccess?: () => void
|
|
206
|
+
|
|
207
|
+
isLoginDialogVisible: boolean
|
|
208
|
+
showLoginDialog: () => void
|
|
209
|
+
hideLoginDialog: () => void
|
|
210
|
+
|
|
211
|
+
//Logout
|
|
212
|
+
onLogoutSuccess?: () => void
|
|
213
|
+
onLogoutError?: () => void
|
|
214
|
+
|
|
204
215
|
userFirstName={loggedUserName}
|
|
205
216
|
refs={{
|
|
206
217
|
inputs?: {
|
|
@@ -221,6 +232,8 @@ Then add it to the render function.
|
|
|
221
232
|
image2?: ImageSourcePropType
|
|
222
233
|
image2Style?: StyleProp<ImageStyle>
|
|
223
234
|
}
|
|
235
|
+
styles?: ILoginViewStyles
|
|
236
|
+
texts?: ILoginViewTexts
|
|
224
237
|
/>
|
|
225
238
|
```
|
|
226
239
|
|
|
@@ -291,10 +304,9 @@ interface ILoginViewStyles {
|
|
|
291
304
|
cancel?: string
|
|
292
305
|
}
|
|
293
306
|
```
|
|
307
|
+
---
|
|
294
308
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-

|
|
309
|
+
## Tickets
|
|
298
310
|
|
|
299
311
|
Import the component from the library
|
|
300
312
|
|
|
@@ -308,15 +320,34 @@ Then add it to the render function.
|
|
|
308
320
|
<Tickets eventId={EVENT_ID} onAddToCartSuccess={handleOnAddToCartSuccess} />
|
|
309
321
|
```
|
|
310
322
|
|
|
311
|
-
|
|
323
|
+
### Props
|
|
312
324
|
|
|
313
325
|
```js
|
|
314
326
|
{
|
|
315
327
|
eventId: number
|
|
316
328
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
329
|
+
// Callbacks for when user taps on GET Tickets button
|
|
330
|
+
onAddToCartSuccess: (data: {
|
|
331
|
+
isBillingRequired: boolean
|
|
332
|
+
isPhoneRequired?: boolean
|
|
333
|
+
isAgeRequired?: boolean
|
|
334
|
+
minimumAge?: number
|
|
335
|
+
isNameRequired?: boolean
|
|
336
|
+
}) => void
|
|
337
|
+
onAddToCartError?: (error: {
|
|
338
|
+
code: number
|
|
339
|
+
message: string
|
|
340
|
+
extraData?: any
|
|
341
|
+
}) => void
|
|
342
|
+
|
|
343
|
+
// Callbacks for fetching the tickets
|
|
344
|
+
onFetchTicketsError?: (error: {
|
|
345
|
+
code: number
|
|
346
|
+
message: string
|
|
347
|
+
extraData?: any
|
|
348
|
+
}) => void
|
|
349
|
+
|
|
350
|
+
// Callbacks for fetching the Event base on the eventId prop
|
|
320
351
|
onFetchTicketsSuccess?: (data: {
|
|
321
352
|
tickets: ITicket[]
|
|
322
353
|
promoCodeResponse: {
|
|
@@ -326,7 +357,19 @@ Then add it to the render function.
|
|
|
326
357
|
isInWaitingList: boolean
|
|
327
358
|
isAccessCodeRequired: boolean
|
|
328
359
|
}) => void
|
|
329
|
-
onFetchEventError?: (error:
|
|
360
|
+
onFetchEventError?: (error: {
|
|
361
|
+
code: number
|
|
362
|
+
message: string
|
|
363
|
+
extraData?: any
|
|
364
|
+
}) => void
|
|
365
|
+
|
|
366
|
+
// Callbacks for Waiting list
|
|
367
|
+
onAddToWaitingListSuccess?: (data: any) => void
|
|
368
|
+
onAddToWaitingListError?: (error: {
|
|
369
|
+
code: number
|
|
370
|
+
message: string
|
|
371
|
+
extraData?: any
|
|
372
|
+
}) => void
|
|
330
373
|
|
|
331
374
|
styles?: ITicketsViewStyles
|
|
332
375
|
texts?: ITicketsViewTexts
|
|
@@ -336,6 +379,11 @@ Then add it to the render function.
|
|
|
336
379
|
|
|
337
380
|
onPressMyOrders: () => void
|
|
338
381
|
onPressLogout?: () => void
|
|
382
|
+
|
|
383
|
+
// With the following 3 props you can control the visibility of the stock loading indicators and alerts, so you can use your own.
|
|
384
|
+
onLoadingChange?: (isLoading: boolean) => void
|
|
385
|
+
areAlertsEnabled?: boolean
|
|
386
|
+
areLoadingIndicatorsEnabled?: boolean
|
|
339
387
|
}
|
|
340
388
|
```
|
|
341
389
|
|
|
@@ -345,8 +393,10 @@ Then add it to the render function.
|
|
|
345
393
|
```js
|
|
346
394
|
{
|
|
347
395
|
isBillingRequired: boolean
|
|
348
|
-
|
|
349
|
-
isAgeRequired
|
|
396
|
+
isPhoneRequired?: boolean
|
|
397
|
+
isAgeRequired?: boolean
|
|
398
|
+
minimumAge?: number
|
|
399
|
+
isNameRequired?: boolean
|
|
350
400
|
}
|
|
351
401
|
```
|
|
352
402
|
|
|
@@ -354,10 +404,7 @@ You can then call the `BillingInfo` component and pass them as props in the `car
|
|
|
354
404
|
|
|
355
405
|
`onFetchTicketsSuccess` When tickets fetching was successful, will return fetched data, including `promoCodeResponse`.
|
|
356
406
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
Receives several props to style its sub-components.
|
|
360
|
-
|
|
407
|
+
### styles
|
|
361
408
|
```js
|
|
362
409
|
{
|
|
363
410
|
rootContainer?: ViewStyle
|
|
@@ -365,22 +412,109 @@ Receives several props to style its sub-components.
|
|
|
365
412
|
title?: TextStyle
|
|
366
413
|
getTicketsButtonDisabled?: IButtonStyles
|
|
367
414
|
getTicketsButtonActive?: IButtonStyles
|
|
368
|
-
promoCode?:
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
<img width="790" alt="props" src="https://user-images.githubusercontent.com/66479719/153976200-4bd6b254-6e80-49d6-bacc-076c59873434.png">
|
|
377
|
-
|
|
378
|
-
<img width="675" alt="Screen Shot 2022-02-14 at 19 37 40" src="https://user-images.githubusercontent.com/66479719/153976314-9b4431bd-ea2f-49db-87ab-fb7d68b02a0c.png">
|
|
415
|
+
promoCode?: {
|
|
416
|
+
rootContainer?: StyleProp<ViewStyle>
|
|
417
|
+
contentWrapper?: StyleProp<ViewStyle>
|
|
418
|
+
content?: StyleProp<ViewStyle>
|
|
419
|
+
input?: TextInputProps['style']
|
|
420
|
+
inputPlaceholderColor?: string
|
|
421
|
+
title?: StyleProp<TextStyle>
|
|
379
422
|
|
|
380
|
-
|
|
423
|
+
mainButton?: IButtonStyles
|
|
424
|
+
cancelButton?: IButtonStyles
|
|
425
|
+
applyButton?: IButtonStyles
|
|
426
|
+
applyDisabledButton?: IButtonStyles
|
|
381
427
|
|
|
428
|
+
messageContainer?: StyleProp<ViewStyle>
|
|
429
|
+
message?: StyleProp<TextStyle>
|
|
430
|
+
}
|
|
431
|
+
ticketList?: {
|
|
432
|
+
listContainer?: ViewStyle
|
|
433
|
+
item?: {
|
|
434
|
+
container?: ViewStyle
|
|
435
|
+
ticketName?: TextStyle
|
|
436
|
+
price?: TextStyle
|
|
437
|
+
oldPrice?: TextStyle
|
|
438
|
+
fees?: TextStyle
|
|
439
|
+
soldOutText?: TextStyle
|
|
440
|
+
soldOutContainer?: ViewStyle
|
|
441
|
+
dropdown?: IDropdownStyles
|
|
442
|
+
pricesContainer?: StyleProp<ViewStyle>
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
loading?: {
|
|
446
|
+
animation?: {
|
|
447
|
+
color?: ActivityIndicatorProps['color']
|
|
448
|
+
size?: ActivityIndicatorProps['size']
|
|
449
|
+
}
|
|
450
|
+
content?: ViewStyle
|
|
451
|
+
text?: TextStyle
|
|
452
|
+
}
|
|
453
|
+
waitingList?: {
|
|
454
|
+
rootContainer?: StyleProp<ViewStyle>
|
|
455
|
+
title?: StyleProp<TextStyle>
|
|
456
|
+
button?: IButtonStyles
|
|
457
|
+
input?: IInputStyles
|
|
458
|
+
buttonDisabled?: IButtonStyles
|
|
459
|
+
success?: {
|
|
460
|
+
container?: StyleProp<ViewStyle>
|
|
461
|
+
title?: StyleProp<ViewStyle>
|
|
462
|
+
message?: StyleProp<ViewStyle>
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
loggedIn?: {
|
|
466
|
+
rootContainer?: StyleProp<ViewStyle>
|
|
467
|
+
myOrdersButton?: IButtonStyles
|
|
468
|
+
logOutButton?: IButtonStyles
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
```
|
|
382
472
|
|
|
383
|
-
|
|
473
|
+
### texts
|
|
474
|
+
```js
|
|
475
|
+
{
|
|
476
|
+
promoCode?: {
|
|
477
|
+
promoCodeButton?: string
|
|
478
|
+
inputPlaceHolder?: string
|
|
479
|
+
apply?: string
|
|
480
|
+
cancel?: string
|
|
481
|
+
mainButton?: string
|
|
482
|
+
title?: string
|
|
483
|
+
}
|
|
484
|
+
getTicketsButton?: string
|
|
485
|
+
title?: string
|
|
486
|
+
waitingList?: {
|
|
487
|
+
title?: string
|
|
488
|
+
firstName?: string
|
|
489
|
+
lastName?: string
|
|
490
|
+
email?: string
|
|
491
|
+
button?: string
|
|
492
|
+
successTitle?: string
|
|
493
|
+
successMessage?: string
|
|
494
|
+
}
|
|
495
|
+
loggedInTexts?: {
|
|
496
|
+
logoutDialog?: {
|
|
497
|
+
title?: string
|
|
498
|
+
message?: string
|
|
499
|
+
confirmButton?: string
|
|
500
|
+
cancelButton?: string
|
|
501
|
+
}
|
|
502
|
+
myOrderButtonText?: string
|
|
503
|
+
logOutButtonText?: string
|
|
504
|
+
}
|
|
505
|
+
listItem?: {
|
|
506
|
+
soldOut?: string
|
|
507
|
+
salesNotStarted?: string
|
|
508
|
+
salesEnded?: string
|
|
509
|
+
inclFees?: string
|
|
510
|
+
exclFees?: string
|
|
511
|
+
free?: string
|
|
512
|
+
ticket?: string
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
```
|
|
516
|
+
---
|
|
517
|
+
## BillingInfo
|
|
384
518
|
|
|
385
519
|
Import the component from the library
|
|
386
520
|
|
|
@@ -399,8 +533,9 @@ Add it to the render function.
|
|
|
399
533
|
isPhoneRequired: boolean
|
|
400
534
|
minimumAge: number
|
|
401
535
|
}
|
|
536
|
+
// registerNewUser
|
|
402
537
|
onRegisterSuccess?: (tokens: ITokens) => void
|
|
403
|
-
|
|
538
|
+
onRegisterError?: (error: string) => void
|
|
404
539
|
|
|
405
540
|
onCheckoutSuccess: (data: {
|
|
406
541
|
id: string
|
|
@@ -408,23 +543,33 @@ Add it to the render function.
|
|
|
408
543
|
total: string
|
|
409
544
|
status: string
|
|
410
545
|
}) => void
|
|
411
|
-
|
|
546
|
+
onCheckoutError?: (error: IError) => void
|
|
412
547
|
|
|
413
548
|
onLoginSuccess: (data: any) => void
|
|
414
|
-
|
|
549
|
+
onLoginError?: (error: IError) => void
|
|
550
|
+
|
|
415
551
|
|
|
416
552
|
onFetchUserProfileSuccess?: (data: any) => void
|
|
417
|
-
|
|
553
|
+
onFetchUserProfileError?: (error: IError) => void
|
|
418
554
|
|
|
419
|
-
|
|
555
|
+
//fetchCart
|
|
556
|
+
onFetchCartError?: (error: IError) => void
|
|
557
|
+
onFetchCartSuccess?: () => void
|
|
420
558
|
|
|
421
|
-
|
|
422
|
-
|
|
559
|
+
// fetchCountries
|
|
560
|
+
onFetchCountriesError?: (error: IError) => void
|
|
561
|
+
onFetchCountriesSuccess?: () => void
|
|
423
562
|
|
|
424
|
-
|
|
563
|
+
// fetchState
|
|
564
|
+
onFetchStatesError?: (error: IError) => void
|
|
565
|
+
onFetchStatesSuccess?: () => void
|
|
566
|
+
|
|
567
|
+
// fetch Token
|
|
568
|
+
onFetchAccessTokenError?: (error: IError) => void
|
|
569
|
+
onFetchAccessTokenSuccess?: () => void
|
|
425
570
|
|
|
426
|
-
|
|
427
|
-
|
|
571
|
+
styles?: IBillingInfoViewStyles
|
|
572
|
+
texts?: IBillingInfoViewTexts
|
|
428
573
|
|
|
429
574
|
styles?: IBillingInfoViewStyles
|
|
430
575
|
texts?: IBillingInfoViewTexts
|
|
@@ -462,8 +607,8 @@ Add it to the render function.
|
|
|
462
607
|
| onCheckoutSuccess | Will return Order data from the Checkout action |
|
|
463
608
|
| loginBrandImages | Receives styles and images sources to show in the `Login` component |
|
|
464
609
|
| skipBillingConfig | Configure the skipping component, visible when `isBillingRequired` is set to false |
|
|
465
|
-
### texts
|
|
466
610
|
|
|
611
|
+
### texts
|
|
467
612
|
```js
|
|
468
613
|
interface IBillingInfoViewTexts {
|
|
469
614
|
loginTexts?: ILoginViewTexts
|
|
@@ -521,6 +666,8 @@ interface IBillingInfoViewStyles {
|
|
|
521
666
|
customCheckbox?: ICheckboxStyles
|
|
522
667
|
|
|
523
668
|
datePicker?: IDatePickerStyles
|
|
669
|
+
|
|
670
|
+
privacyPolicyLinkStyle?: StyleProp<TextStyle>
|
|
524
671
|
}
|
|
525
672
|
```
|
|
526
673
|
|
|
@@ -536,6 +683,19 @@ import { Checkout } from 'tf-checkout-react-native'
|
|
|
536
683
|
|
|
537
684
|
Add it to the render function.
|
|
538
685
|
|
|
686
|
+
```js
|
|
687
|
+
<Checkout
|
|
688
|
+
eventId={EVENT_ID}
|
|
689
|
+
hash={hash}
|
|
690
|
+
total={total}
|
|
691
|
+
onPaymentSuccess={handleOnPaymentSuccess}
|
|
692
|
+
onPressExit={handleStripeError}
|
|
693
|
+
areLoadingIndicatorsEnabled={false}
|
|
694
|
+
styles={styles}
|
|
695
|
+
{...props}
|
|
696
|
+
/>
|
|
697
|
+
```
|
|
698
|
+
|
|
539
699
|
### Props
|
|
540
700
|
|
|
541
701
|
```js
|
|
@@ -544,17 +704,17 @@ Add it to the render function.
|
|
|
544
704
|
hash: string
|
|
545
705
|
total: string
|
|
546
706
|
|
|
547
|
-
|
|
707
|
+
onFetchOrderReviewError?: (error: IError) => void
|
|
548
708
|
onFetchOrderReviewSuccess?: (data: any) => void
|
|
549
709
|
|
|
550
|
-
|
|
710
|
+
onFetchEventConditionsError?: (error: IError) => void
|
|
551
711
|
onFetchEventConditionsSuccess?: (data: any) => void
|
|
552
712
|
|
|
553
713
|
onCheckoutCompletedSuccess?: (data: any) => void
|
|
554
|
-
|
|
714
|
+
onCheckoutCompletedError?: (error: IError) => void
|
|
555
715
|
|
|
556
716
|
onPaymentSuccess: (data: any) => void
|
|
557
|
-
onPaymentError?: (error:
|
|
717
|
+
onPaymentError?: (error: IError) => void
|
|
558
718
|
|
|
559
719
|
onStripeInitializeError?: (error: string) => void
|
|
560
720
|
|
|
@@ -620,7 +780,7 @@ Currently, Stripe card is not customizable. Please see the open issues in their
|
|
|
620
780
|
|
|
621
781
|
Additionally, if you are encountering problems with building your project, please take a look at the [Stripe troubleshooting](https://github.com/stripe/stripe-react-native#troubleshooting).
|
|
622
782
|
|
|
623
|
-
|
|
783
|
+
---
|
|
624
784
|
## Purchase Confirmation
|
|
625
785
|
|
|
626
786
|
Import the component from the library
|
|
@@ -669,12 +829,10 @@ Add it to the render function.
|
|
|
669
829
|
| onComplete | To handle the completion of the flow. Here you can handle the unmount of the component or navigate to another screen |
|
|
670
830
|
| styles | Styles for the component |
|
|
671
831
|
| texts | Texts for the component |
|
|
672
|
-
---
|
|
673
832
|
|
|
674
|
-
## MyOrders
|
|
675
|
-
|
|
676
|
-

|
|
677
833
|
|
|
834
|
+
---
|
|
835
|
+
## My Orders
|
|
678
836
|
If there is a valid session, there will appear a button to access `MyOrders` in the `Tickets` component.
|
|
679
837
|
|
|
680
838
|
Import the component from the library.
|
|
@@ -683,80 +841,116 @@ Import the component from the library.
|
|
|
683
841
|
import { MyOrders } from 'tf-checkout-react-native'
|
|
684
842
|
```
|
|
685
843
|
|
|
686
|
-
There is no need to pass any data prop to it.
|
|
687
844
|
|
|
688
845
|
### Props
|
|
689
846
|
|
|
690
|
-
|
|
847
|
+
```js
|
|
848
|
+
{
|
|
849
|
+
onSelectOrder: (order: {
|
|
850
|
+
order: {
|
|
851
|
+
header: {
|
|
852
|
+
isReferralDisabled: boolean
|
|
853
|
+
shareLink: string
|
|
854
|
+
total: string
|
|
855
|
+
salesReferred: string
|
|
856
|
+
},
|
|
857
|
+
items: [
|
|
858
|
+
{
|
|
859
|
+
name: string
|
|
860
|
+
currency: string
|
|
861
|
+
price: string
|
|
862
|
+
discount: string
|
|
863
|
+
quantity: string
|
|
864
|
+
total: string
|
|
865
|
+
},
|
|
866
|
+
{...}
|
|
867
|
+
],
|
|
868
|
+
tickets: [
|
|
869
|
+
{
|
|
870
|
+
hash: string
|
|
871
|
+
ticketType: string
|
|
872
|
+
holderName: string
|
|
873
|
+
status: string
|
|
874
|
+
pdfLink: string
|
|
875
|
+
},
|
|
876
|
+
{...}
|
|
877
|
+
]
|
|
878
|
+
}
|
|
879
|
+
}) => void
|
|
691
880
|
|
|
692
|
-
|
|
881
|
+
onFetchMyOrdersSuccess?: () => void
|
|
882
|
+
onFetchMyOrdersError?: (error: IError) => void
|
|
693
883
|
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
isEventsDropdownHidden: true,
|
|
697
|
-
}}
|
|
698
|
-
```
|
|
884
|
+
onFetchOrderDetailsSuccess?: () => void
|
|
885
|
+
onFetchOrderDetailsError?: (error: IError) => void
|
|
699
886
|
|
|
700
|
-
|
|
887
|
+
onLoadingChange?: (isLoading: boolean) => void
|
|
701
888
|
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
{
|
|
712
|
-
name: string
|
|
713
|
-
currency: string
|
|
714
|
-
price: string
|
|
715
|
-
discount: string
|
|
716
|
-
quantity: string
|
|
717
|
-
total: string
|
|
718
|
-
},
|
|
719
|
-
{...}
|
|
720
|
-
],
|
|
721
|
-
tickets: [
|
|
722
|
-
{
|
|
723
|
-
hash: string
|
|
724
|
-
ticketType: string
|
|
725
|
-
holderName: string
|
|
726
|
-
status: string
|
|
727
|
-
pdfLink: string
|
|
728
|
-
},
|
|
729
|
-
{...}
|
|
730
|
-
]
|
|
889
|
+
styles?: IMyOrdersStyles
|
|
890
|
+
config?: {
|
|
891
|
+
isEventsDropdownHidden?: boolean
|
|
892
|
+
areActivityIndicatorsEnabled?: boolean
|
|
893
|
+
areAlertsEnabled?: boolean
|
|
894
|
+
}
|
|
895
|
+
texts?: {
|
|
896
|
+
selectEventPlaceholder?: string
|
|
897
|
+
}
|
|
731
898
|
}
|
|
732
899
|
```
|
|
733
900
|
|
|
734
|
-
|
|
735
|
-
|
|
901
|
+
### styles
|
|
736
902
|
```js
|
|
737
|
-
|
|
738
|
-
orderListItem?:
|
|
903
|
+
{
|
|
904
|
+
orderListItem?: {
|
|
905
|
+
rootContainer?: StyleProp<ViewStyle>
|
|
906
|
+
contentContainer?: StyleProp<ViewStyle>
|
|
907
|
+
infoContainer?: StyleProp<ViewStyle>
|
|
908
|
+
infoTopContainer?: StyleProp<ViewStyle>
|
|
909
|
+
infoBottomContainer?: StyleProp<ViewStyle>
|
|
910
|
+
imageContainer?: StyleProp<ViewStyle>
|
|
911
|
+
image?: StyleProp<ImageStyle>
|
|
912
|
+
infoRootContainer?: StyleProp<ViewStyle>
|
|
913
|
+
iconNextContainer?: StyleProp<ViewStyle>
|
|
914
|
+
iconNext?: StyleProp<ImageStyle>
|
|
915
|
+
orderId?: StyleProp<TextStyle>
|
|
916
|
+
orderDate?: StyleProp<TextStyle>
|
|
917
|
+
eventName?: StyleProp<TextStyle>
|
|
918
|
+
priceContainer?: StyleProp<ViewStyle>
|
|
919
|
+
price?: StyleProp<TextStyle>
|
|
920
|
+
currency?: StyleProp<TextStyle>
|
|
921
|
+
}
|
|
739
922
|
safeArea?: StyleProp<ViewStyle>
|
|
740
923
|
listContainer?: StyleProp<ViewStyle>
|
|
741
924
|
eventsContainer?: StyleProp<ViewStyle>
|
|
742
925
|
eventsTitle?: StyleProp<TextStyle>
|
|
743
926
|
refreshControlColor?: ColorValue
|
|
744
|
-
eventsDropdown?:
|
|
927
|
+
eventsDropdown?: {
|
|
928
|
+
container?: StyleProp<ViewStyle>
|
|
929
|
+
button?: StyleProp<ViewStyle>
|
|
930
|
+
icon?: StyleProp<ImageStyle>
|
|
931
|
+
label?: StyleProp<TextStyle>
|
|
932
|
+
dialog?: StyleProp<ViewStyle>
|
|
933
|
+
flatListContainer?: StyleProp<ViewStyle>
|
|
934
|
+
listItem?: {
|
|
935
|
+
container?: StyleProp<ViewStyle>
|
|
936
|
+
button?: StyleProp<ViewStyle>
|
|
937
|
+
buttonSelected?: StyleProp<ViewStyle>
|
|
938
|
+
text?: StyleProp<TextStyle>
|
|
939
|
+
textSelected?: StyleProp<TextStyle>
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
}
|
|
745
943
|
rootContainer?: StyleProp<ViewStyle>
|
|
746
944
|
eventsSelectionContainer?: StyleProp<ViewStyle>
|
|
747
945
|
clearEventSelectionIcon?: StyleProp<ImageStyle>
|
|
748
946
|
}
|
|
749
947
|
```
|
|
750
948
|
|
|
751
|
-
`onFetchOrderDetailsFail` if the fetching fails, you can use this to know what happened.
|
|
752
|
-
|
|
753
949
|
---
|
|
754
950
|
|
|
755
951
|
## MyOrderDetails
|
|
756
952
|
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
When user selects an order from the `MyOrders`component, will show it details.
|
|
953
|
+
When user selects an order from the `MyOrders` component, will show it details.
|
|
760
954
|
|
|
761
955
|
Import the component from the library.
|
|
762
956
|
|
|
@@ -766,44 +960,25 @@ import { MyOrderDetails } from 'tf-checkout-react-native'
|
|
|
766
960
|
|
|
767
961
|
### Props
|
|
768
962
|
|
|
769
|
-
`data` receives same data as the one of the object received from the `onSelectOrder` handler in `MyOrders`component:
|
|
770
|
-
|
|
771
963
|
```js
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
tickets: [
|
|
791
|
-
{
|
|
792
|
-
hash: string
|
|
793
|
-
ticketType: string
|
|
794
|
-
holderName: string
|
|
795
|
-
status: string
|
|
796
|
-
pdfLink: string
|
|
797
|
-
},
|
|
798
|
-
{...}
|
|
799
|
-
]
|
|
800
|
-
}
|
|
801
|
-
```
|
|
802
|
-
|
|
803
|
-
### styles
|
|
804
|
-
|
|
805
|
-
```
|
|
806
|
-
styles?: {
|
|
964
|
+
{
|
|
965
|
+
data: IMyOrderDetailsResponse
|
|
966
|
+
config?: {
|
|
967
|
+
areActivityIndicatorsEnabled?: boolean
|
|
968
|
+
areAlertsEnabled?: boolean
|
|
969
|
+
}
|
|
970
|
+
onDownloadStatusChange?: (status?:
|
|
971
|
+
'downloading' |
|
|
972
|
+
'downloaded' |
|
|
973
|
+
'failed'
|
|
974
|
+
) => void
|
|
975
|
+
downloadStatusIcons?: {
|
|
976
|
+
success?: ImageSourcePropType
|
|
977
|
+
error?: ImageSourcePropType
|
|
978
|
+
}
|
|
979
|
+
onAndroidWritePermission?: (permission?: boolean) => void
|
|
980
|
+
onLinkCopied?: (copied?: boolean) => void
|
|
981
|
+
styles?: {
|
|
807
982
|
rootContainer?: StyleProp<ViewStyle>
|
|
808
983
|
header?: {
|
|
809
984
|
container?: StyleProp<ViewStyle>
|
|
@@ -847,29 +1022,34 @@ styles?: {
|
|
|
847
1022
|
}
|
|
848
1023
|
downloadButton?: IButtonStyles
|
|
849
1024
|
}
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
### texts
|
|
853
|
-
|
|
854
|
-
```js
|
|
855
|
-
texts?: {
|
|
856
|
-
title?: string
|
|
857
|
-
subTitle?: string
|
|
858
|
-
referralLink?: string
|
|
859
|
-
listItem?: {
|
|
860
|
-
title?: string
|
|
861
|
-
ticketType?: string
|
|
862
|
-
price?: string
|
|
863
|
-
quantity?: string
|
|
864
|
-
total?: string
|
|
865
|
-
}
|
|
866
|
-
ticketItem?: {
|
|
1025
|
+
texts?: {
|
|
867
1026
|
title?: string
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
1027
|
+
subTitle?: string
|
|
1028
|
+
referralLink?: string
|
|
1029
|
+
listItem?: {
|
|
1030
|
+
title?: string
|
|
1031
|
+
ticketType?: string
|
|
1032
|
+
price?: string
|
|
1033
|
+
quantity?: string
|
|
1034
|
+
total?: string
|
|
1035
|
+
}
|
|
1036
|
+
ticketItem?: {
|
|
1037
|
+
title?: string
|
|
1038
|
+
ticketId?: string
|
|
1039
|
+
ticketType?: string
|
|
1040
|
+
ticketHolder?: string
|
|
1041
|
+
status?: string
|
|
1042
|
+
download?: string
|
|
1043
|
+
}
|
|
1044
|
+
downloadNotification?: {
|
|
1045
|
+
successMessage?: string
|
|
1046
|
+
errorMessage?: string
|
|
1047
|
+
}
|
|
1048
|
+
copyText?: {
|
|
1049
|
+
copy?: string
|
|
1050
|
+
copied?: string
|
|
1051
|
+
}
|
|
873
1052
|
}
|
|
874
1053
|
}
|
|
875
1054
|
```
|
|
1055
|
+
|