tf-checkout-react-native 1.0.13 → 1.0.16

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.
Files changed (78) hide show
  1. package/README.md +375 -170
  2. package/android/build.gradle +3 -3
  3. package/lib/api/ApiClient.d.ts +13 -21
  4. package/lib/api/ApiClient.js +124 -51
  5. package/lib/api/ApiClient.js.map +1 -1
  6. package/lib/api/types.d.ts +23 -11
  7. package/lib/components/login/Login.d.ts +1 -1
  8. package/lib/components/login/Login.js +21 -9
  9. package/lib/components/login/Login.js.map +1 -1
  10. package/lib/components/login/LoginView.js +11 -11
  11. package/lib/components/login/LoginView.js.map +1 -1
  12. package/lib/components/login/types.d.ts +12 -7
  13. package/lib/components/waitingList/WaitingList.d.ts +1 -1
  14. package/lib/components/waitingList/WaitingList.js +20 -3
  15. package/lib/components/waitingList/WaitingList.js.map +1 -1
  16. package/lib/components/waitingList/WaitingListView.js +19 -7
  17. package/lib/components/waitingList/WaitingListView.js.map +1 -1
  18. package/lib/components/waitingList/types.d.ts +10 -0
  19. package/lib/containers/billingInfo/Billing.d.ts +2 -1
  20. package/lib/containers/billingInfo/Billing.js +125 -65
  21. package/lib/containers/billingInfo/Billing.js.map +1 -1
  22. package/lib/containers/billingInfo/types.d.ts +24 -12
  23. package/lib/containers/checkout/Checkout.d.ts +1 -1
  24. package/lib/containers/checkout/Checkout.js +90 -49
  25. package/lib/containers/checkout/Checkout.js.map +1 -1
  26. package/lib/containers/checkout/components/styles.js +1 -1
  27. package/lib/containers/checkout/components/styles.js.map +1 -1
  28. package/lib/containers/checkout/styles.d.ts +2 -0
  29. package/lib/containers/checkout/styles.js +3 -1
  30. package/lib/containers/checkout/styles.js.map +1 -1
  31. package/lib/containers/checkout/types.d.ts +36 -7
  32. package/lib/containers/myOrderDetails/MyOrderDetails.js +21 -3
  33. package/lib/containers/myOrderDetails/MyOrderDetails.js.map +1 -1
  34. package/lib/containers/myOrderDetails/MyOrderDetailsView.js +18 -10
  35. package/lib/containers/myOrderDetails/MyOrderDetailsView.js.map +1 -1
  36. package/lib/containers/myOrderDetails/components/Notification.d.ts +10 -2
  37. package/lib/containers/myOrderDetails/components/Notification.js +5 -7
  38. package/lib/containers/myOrderDetails/components/Notification.js.map +1 -1
  39. package/lib/containers/myOrderDetails/types.d.ts +22 -0
  40. package/lib/containers/myOrders/MyOrders.js +36 -8
  41. package/lib/containers/myOrders/MyOrders.js.map +1 -1
  42. package/lib/containers/myOrders/MyOrdersView.d.ts +1 -1
  43. package/lib/containers/myOrders/MyOrdersView.js +4 -4
  44. package/lib/containers/myOrders/MyOrdersView.js.map +1 -1
  45. package/lib/containers/myOrders/types.d.ts +14 -1
  46. package/lib/containers/purchaseConfirmation/PurchaseConfirmation.d.ts +1 -1
  47. package/lib/containers/purchaseConfirmation/PurchaseConfirmation.js +21 -5
  48. package/lib/containers/purchaseConfirmation/PurchaseConfirmation.js.map +1 -1
  49. package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.d.ts +1 -1
  50. package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.js +4 -3
  51. package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.js.map +1 -1
  52. package/lib/containers/purchaseConfirmation/types.d.ts +8 -0
  53. package/lib/containers/tickets/Tickets.d.ts +1 -1
  54. package/lib/containers/tickets/Tickets.js +46 -9
  55. package/lib/containers/tickets/Tickets.js.map +1 -1
  56. package/lib/containers/tickets/TicketsView.d.ts +1 -1
  57. package/lib/containers/tickets/TicketsView.js +11 -8
  58. package/lib/containers/tickets/TicketsView.js.map +1 -1
  59. package/lib/containers/tickets/components/TicketListItem.js +14 -7
  60. package/lib/containers/tickets/components/TicketListItem.js.map +1 -1
  61. package/lib/containers/tickets/components/types.d.ts +6 -0
  62. package/lib/containers/tickets/types.d.ts +20 -18
  63. package/lib/helpers/LocalStorage.d.ts +1 -1
  64. package/lib/helpers/LocalStorage.js +1 -3
  65. package/lib/helpers/LocalStorage.js.map +1 -1
  66. package/lib/index.d.ts +4 -4
  67. package/lib/index.js.map +1 -1
  68. package/lib/res/colors.d.ts +2 -2
  69. package/lib/res/colors.js +2 -18
  70. package/lib/res/colors.js.map +1 -1
  71. package/lib/types/IError.d.ts +5 -0
  72. package/lib/types/IError.js +2 -0
  73. package/lib/types/IError.js.map +1 -0
  74. package/lib/types/ITicket.d.ts +12 -0
  75. package/lib/types/index.d.ts +1 -0
  76. package/lib/types/index.js +1 -0
  77. package/lib/types/index.js.map +1 -1
  78. 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
- - Minimum Gradle plugin version `4.2.2`
19
- - Minimum Gradle version `6.7.1`
20
- - Compile Sdk Version and Target Sdk Version `31`
21
- - Build Tools Version `30.0.3`
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={handleOnLoginDialogSuccess}
201
- isLoginDialogVisible={isLoginDialogVisible}
202
- showLoginDialog={() => setIsLoginDialogVisible(true)}
203
- hideLoginDialog={() => setIsLoginDialogVisible(false)}
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
 
@@ -283,6 +296,7 @@ interface ILoginViewStyles {
283
296
  dialog?: {
284
297
  loginButton?: string
285
298
  message?: string
299
+ title?: string
286
300
  }
287
301
  logoutDialog?: {
288
302
  title?: string
@@ -290,11 +304,15 @@ interface ILoginViewStyles {
290
304
  confirm?: string
291
305
  cancel?: string
292
306
  }
293
- ```
307
+ loggedIn?: {
308
+ loggedAs?: string
309
+ notYou?: string
310
+ }
294
311
 
295
- # Tickets
312
+ ```
313
+ ---
296
314
 
297
- ![image](https://user-images.githubusercontent.com/66479719/151049068-450a52d9-dfc8-40bf-b12a-f2555a832c8d.png)
315
+ ## Tickets
298
316
 
299
317
  Import the component from the library
300
318
 
@@ -308,15 +326,34 @@ Then add it to the render function.
308
326
  <Tickets eventId={EVENT_ID} onAddToCartSuccess={handleOnAddToCartSuccess} />
309
327
  ```
310
328
 
311
- ## Props
329
+ ### Props
312
330
 
313
331
  ```js
314
332
  {
315
333
  eventId: number
316
334
 
317
- onAddToCartSuccess: (data: IAddToCartSuccess) => void
318
- onAddToCartError?: (error: any) => void
319
- onFetchTicketsError?: (error: any) => void
335
+ // Callbacks for when user taps on GET Tickets button
336
+ onAddToCartSuccess: (data: {
337
+ isBillingRequired: boolean
338
+ isPhoneRequired?: boolean
339
+ isAgeRequired?: boolean
340
+ minimumAge?: number
341
+ isNameRequired?: boolean
342
+ }) => void
343
+ onAddToCartError?: (error: {
344
+ code: number
345
+ message: string
346
+ extraData?: any
347
+ }) => void
348
+
349
+ // Callbacks for fetching the tickets
350
+ onFetchTicketsError?: (error: {
351
+ code: number
352
+ message: string
353
+ extraData?: any
354
+ }) => void
355
+
356
+ // Callbacks for fetching the Event base on the eventId prop
320
357
  onFetchTicketsSuccess?: (data: {
321
358
  tickets: ITicket[]
322
359
  promoCodeResponse: {
@@ -326,7 +363,19 @@ Then add it to the render function.
326
363
  isInWaitingList: boolean
327
364
  isAccessCodeRequired: boolean
328
365
  }) => void
329
- onFetchEventError?: (error: string) => void
366
+ onFetchEventError?: (error: {
367
+ code: number
368
+ message: string
369
+ extraData?: any
370
+ }) => void
371
+
372
+ // Callbacks for Waiting list
373
+ onAddToWaitingListSuccess?: (data: any) => void
374
+ onAddToWaitingListError?: (error: {
375
+ code: number
376
+ message: string
377
+ extraData?: any
378
+ }) => void
330
379
 
331
380
  styles?: ITicketsViewStyles
332
381
  texts?: ITicketsViewTexts
@@ -336,6 +385,11 @@ Then add it to the render function.
336
385
 
337
386
  onPressMyOrders: () => void
338
387
  onPressLogout?: () => void
388
+
389
+ // With the following 3 props you can control the visibility of the stock loading indicators and alerts, so you can use your own.
390
+ onLoadingChange?: (isLoading: boolean) => void
391
+ areAlertsEnabled?: boolean
392
+ areLoadingIndicatorsEnabled?: boolean
339
393
  }
340
394
  ```
341
395
 
@@ -345,8 +399,10 @@ Then add it to the render function.
345
399
  ```js
346
400
  {
347
401
  isBillingRequired: boolean
348
- isNameRequired: boolean
349
- isAgeRequired: boolean
402
+ isPhoneRequired?: boolean
403
+ isAgeRequired?: boolean
404
+ minimumAge?: number
405
+ isNameRequired?: boolean
350
406
  }
351
407
  ```
352
408
 
@@ -354,10 +410,7 @@ You can then call the `BillingInfo` component and pass them as props in the `car
354
410
 
355
411
  `onFetchTicketsSuccess` When tickets fetching was successful, will return fetched data, including `promoCodeResponse`.
356
412
 
357
- ## styles
358
-
359
- Receives several props to style its sub-components.
360
-
413
+ ### styles
361
414
  ```js
362
415
  {
363
416
  rootContainer?: ViewStyle
@@ -365,22 +418,109 @@ Receives several props to style its sub-components.
365
418
  title?: TextStyle
366
419
  getTicketsButtonDisabled?: IButtonStyles
367
420
  getTicketsButtonActive?: IButtonStyles
368
- promoCode?: IPromoCodeStyles
369
- ticketList?: ITicketListStyles
370
- loading?: ILoadingStyles
371
- waitingList?: IWaitingListStyles
372
- loggedIn?: ILoggedInStyles
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">
421
+ promoCode?: {
422
+ rootContainer?: StyleProp<ViewStyle>
423
+ contentWrapper?: StyleProp<ViewStyle>
424
+ content?: StyleProp<ViewStyle>
425
+ input?: TextInputProps['style']
426
+ inputPlaceholderColor?: string
427
+ title?: StyleProp<TextStyle>
379
428
 
380
- <img width="682" alt="image" src="https://user-images.githubusercontent.com/66479719/154126406-101af4ca-7586-4686-9a93-88ef0375968e.png">
429
+ mainButton?: IButtonStyles
430
+ cancelButton?: IButtonStyles
431
+ applyButton?: IButtonStyles
432
+ applyDisabledButton?: IButtonStyles
381
433
 
434
+ messageContainer?: StyleProp<ViewStyle>
435
+ message?: StyleProp<TextStyle>
436
+ }
437
+ ticketList?: {
438
+ listContainer?: ViewStyle
439
+ item?: {
440
+ container?: ViewStyle
441
+ ticketName?: TextStyle
442
+ price?: TextStyle
443
+ oldPrice?: TextStyle
444
+ fees?: TextStyle
445
+ soldOutText?: TextStyle
446
+ soldOutContainer?: ViewStyle
447
+ dropdown?: IDropdownStyles
448
+ pricesContainer?: StyleProp<ViewStyle>
449
+ }
450
+ }
451
+ loading?: {
452
+ animation?: {
453
+ color?: ActivityIndicatorProps['color']
454
+ size?: ActivityIndicatorProps['size']
455
+ }
456
+ content?: ViewStyle
457
+ text?: TextStyle
458
+ }
459
+ waitingList?: {
460
+ rootContainer?: StyleProp<ViewStyle>
461
+ title?: StyleProp<TextStyle>
462
+ button?: IButtonStyles
463
+ input?: IInputStyles
464
+ buttonDisabled?: IButtonStyles
465
+ success?: {
466
+ container?: StyleProp<ViewStyle>
467
+ title?: StyleProp<ViewStyle>
468
+ message?: StyleProp<ViewStyle>
469
+ }
470
+ }
471
+ loggedIn?: {
472
+ rootContainer?: StyleProp<ViewStyle>
473
+ myOrdersButton?: IButtonStyles
474
+ logOutButton?: IButtonStyles
475
+ }
476
+ }
477
+ ```
382
478
 
383
- # BillingInfo
479
+ ### texts
480
+ ```js
481
+ {
482
+ promoCode?: {
483
+ promoCodeButton?: string
484
+ inputPlaceHolder?: string
485
+ apply?: string
486
+ cancel?: string
487
+ mainButton?: string
488
+ title?: string
489
+ }
490
+ getTicketsButton?: string
491
+ title?: string
492
+ waitingList?: {
493
+ title?: string
494
+ firstName?: string
495
+ lastName?: string
496
+ email?: string
497
+ button?: string
498
+ successTitle?: string
499
+ successMessage?: string
500
+ }
501
+ loggedInTexts?: {
502
+ logoutDialog?: {
503
+ title?: string
504
+ message?: string
505
+ confirmButton?: string
506
+ cancelButton?: string
507
+ }
508
+ myOrderButtonText?: string
509
+ logOutButtonText?: string
510
+ }
511
+ listItem?: {
512
+ soldOut?: string
513
+ salesNotStarted?: string
514
+ salesEnded?: string
515
+ inclFees?: string
516
+ exclFees?: string
517
+ free?: string
518
+ ticket?: string
519
+ }
520
+ }
521
+ ```
522
+ ---
523
+ ## BillingInfo
384
524
 
385
525
  Import the component from the library
386
526
 
@@ -399,8 +539,9 @@ Add it to the render function.
399
539
  isPhoneRequired: boolean
400
540
  minimumAge: number
401
541
  }
542
+ // registerNewUser
402
543
  onRegisterSuccess?: (tokens: ITokens) => void
403
- onRegisterFail?: (error: string) => void
544
+ onRegisterError?: (error: string) => void
404
545
 
405
546
  onCheckoutSuccess: (data: {
406
547
  id: string
@@ -408,23 +549,33 @@ Add it to the render function.
408
549
  total: string
409
550
  status: string
410
551
  }) => void
411
- onCheckoutFail?: (error: string) => void
552
+ onCheckoutError?: (error: IError) => void
412
553
 
413
554
  onLoginSuccess: (data: any) => void
414
- onLoginFail?: (error: string) => void
555
+ onLoginError?: (error: IError) => void
556
+
415
557
 
416
558
  onFetchUserProfileSuccess?: (data: any) => void
417
- onFetchUserProfileFail?: (error: any) => void
559
+ onFetchUserProfileError?: (error: IError) => void
418
560
 
419
- onFetchCartError?: (error: string) => void
561
+ //fetchCart
562
+ onFetchCartError?: (error: IError) => void
563
+ onFetchCartSuccess?: () => void
420
564
 
421
- styles?: IBillingInfoViewStyles
422
- texts?: IBillingInfoViewTexts
565
+ // fetchCountries
566
+ onFetchCountriesError?: (error: IError) => void
567
+ onFetchCountriesSuccess?: () => void
423
568
 
424
- privacyPolicyLinkStyle?: StyleProp<TextStyle>
569
+ // fetchState
570
+ onFetchStatesError?: (error: IError) => void
571
+ onFetchStatesSuccess?: () => void
572
+
573
+ // fetch Token
574
+ onFetchAccessTokenError?: (error: IError) => void
575
+ onFetchAccessTokenSuccess?: () => void
425
576
 
426
- onFetchUserProfileFailure?: (error: string) => void
427
- onFetchAccessTokenFailure?: (error: string) => void
577
+ styles?: IBillingInfoViewStyles
578
+ texts?: IBillingInfoViewTexts
428
579
 
429
580
  styles?: IBillingInfoViewStyles
430
581
  texts?: IBillingInfoViewTexts
@@ -462,12 +613,11 @@ Add it to the render function.
462
613
  | onCheckoutSuccess | Will return Order data from the Checkout action |
463
614
  | loginBrandImages | Receives styles and images sources to show in the `Login` component |
464
615
  | skipBillingConfig | Configure the skipping component, visible when `isBillingRequired` is set to false |
465
- ### texts
466
616
 
617
+ ### texts
467
618
  ```js
468
619
  interface IBillingInfoViewTexts {
469
620
  loginTexts?: ILoginViewTexts
470
- loginButton?: string
471
621
  checkoutButton?: string
472
622
  skippingMessage?: string
473
623
  form?: {
@@ -484,7 +634,7 @@ interface IBillingInfoViewTexts {
484
634
  state?: string
485
635
  zipCode?: string
486
636
  dateOfBirth?: string
487
- isSubToBrand?: string
637
+ isSubToBrand?: string // your brand's checkbox label
488
638
  ticketHoldersTitle?: string
489
639
  ticketHolderItem?: string
490
640
  holderFirstName?: string
@@ -494,7 +644,7 @@ interface IBillingInfoViewTexts {
494
644
  getYourTicketsTitle?: string
495
645
  emailsAdvice?: string
496
646
  choosePassword?: string
497
- checkbox?: string // your brand's checkbox label
647
+ optional?: string
498
648
  }
499
649
  }
500
650
  ```
@@ -521,6 +671,8 @@ interface IBillingInfoViewStyles {
521
671
  customCheckbox?: ICheckboxStyles
522
672
 
523
673
  datePicker?: IDatePickerStyles
674
+
675
+ privacyPolicyLinkStyle?: StyleProp<TextStyle>
524
676
  }
525
677
  ```
526
678
 
@@ -536,6 +688,19 @@ import { Checkout } from 'tf-checkout-react-native'
536
688
 
537
689
  Add it to the render function.
538
690
 
691
+ ```js
692
+ <Checkout
693
+ eventId={EVENT_ID}
694
+ hash={hash}
695
+ total={total}
696
+ onPaymentSuccess={handleOnPaymentSuccess}
697
+ onPressExit={handleStripeError}
698
+ areLoadingIndicatorsEnabled={false}
699
+ styles={styles}
700
+ {...props}
701
+ />
702
+ ```
703
+
539
704
  ### Props
540
705
 
541
706
  ```js
@@ -544,17 +709,17 @@ Add it to the render function.
544
709
  hash: string
545
710
  total: string
546
711
 
547
- onFetchOrderReviewFail?: (error: string) => void
712
+ onFetchOrderReviewError?: (error: IError) => void
548
713
  onFetchOrderReviewSuccess?: (data: any) => void
549
714
 
550
- onFetchEventConditionsFail?: (error: string) => void
715
+ onFetchEventConditionsError?: (error: IError) => void
551
716
  onFetchEventConditionsSuccess?: (data: any) => void
552
717
 
553
718
  onCheckoutCompletedSuccess?: (data: any) => void
554
- onCheckoutCompletedFail?: (error: string) => void
719
+ onCheckoutCompletedError?: (error: IError) => void
555
720
 
556
721
  onPaymentSuccess: (data: any) => void
557
- onPaymentError?: (error: string) => void
722
+ onPaymentError?: (error: IError) => void
558
723
 
559
724
  onStripeInitializeError?: (error: string) => void
560
725
 
@@ -567,6 +732,14 @@ Add it to the render function.
567
732
  exitButton?: string
568
733
  payButton?: string
569
734
  freeRegistrationButton?: string
735
+ providePaymentInfo?: string
736
+ orderReviewItems?: {
737
+ event?: string
738
+ ticketType?: string
739
+ numberOfTickets?: string
740
+ price?: string
741
+ total?: string
742
+ }
570
743
  }
571
744
 
572
745
  styles?: ICheckoutStyles
@@ -604,6 +777,7 @@ Add it to the render function.
604
777
  payment?: {
605
778
  container?: StyleProp<ViewStyle>
606
779
  title?: StyleProp<TextStyle>
780
+ cardBackgroundColor?: string
607
781
  cardContainer?: StyleProp<ViewStyle>
608
782
  button?: IButtonStyles
609
783
  buttonDisabled?: IButtonStyles
@@ -620,7 +794,7 @@ Currently, Stripe card is not customizable. Please see the open issues in their
620
794
 
621
795
  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
796
 
623
-
797
+ ---
624
798
  ## Purchase Confirmation
625
799
 
626
800
  Import the component from the library
@@ -669,12 +843,10 @@ Add it to the render function.
669
843
  | onComplete | To handle the completion of the flow. Here you can handle the unmount of the component or navigate to another screen |
670
844
  | styles | Styles for the component |
671
845
  | texts | Texts for the component |
672
- ---
673
-
674
- ## MyOrders
675
846
 
676
- ![image](https://user-images.githubusercontent.com/66479719/151049211-5faebe6b-df3b-4785-ac0d-3adb7a3d6699.png)
677
847
 
848
+ ---
849
+ ## My Orders
678
850
  If there is a valid session, there will appear a button to access `MyOrders` in the `Tickets` component.
679
851
 
680
852
  Import the component from the library.
@@ -683,80 +855,123 @@ Import the component from the library.
683
855
  import { MyOrders } from 'tf-checkout-react-native'
684
856
  ```
685
857
 
686
- There is no need to pass any data prop to it.
687
858
 
688
859
  ### Props
689
860
 
690
- `config` has properties to hide components.
861
+ ```js
862
+ {
863
+ onSelectOrder: (order: {
864
+ order: {
865
+ header: {
866
+ isReferralDisabled: boolean
867
+ shareLink: string
868
+ total: string
869
+ salesReferred: string
870
+ },
871
+ items: [
872
+ {
873
+ name: string
874
+ currency: string
875
+ price: string
876
+ discount: string
877
+ quantity: string
878
+ total: string
879
+ },
880
+ {...}
881
+ ],
882
+ tickets: [
883
+ {
884
+ hash: string
885
+ ticketType: string
886
+ holderName?: string
887
+ holderEmail?: string
888
+ holderPhone?: string
889
+ status: string
890
+ pdfLink?: string
891
+ qrData?: string
892
+ isSellable?: boolean
893
+ description?: string
894
+ descriptionPlain?: string
895
+ },
896
+ {...}
897
+ ]
898
+ }
899
+ }) => void
691
900
 
692
- `isEventsDropdownHidden` if the Events dropdown should be hidden.
901
+ onFetchMyOrdersSuccess?: () => void
902
+ onFetchMyOrdersError?: (error: IError) => void
693
903
 
694
- ```js
695
- config={{
696
- isEventsDropdownHidden: true,
697
- }}
698
- ```
904
+ onFetchOrderDetailsSuccess?: () => void
905
+ onFetchOrderDetailsError?: (error: IError) => void
699
906
 
700
- `onSelectOrder` handler to know which order the user has selected. Will return an object with following structure:
907
+ onLoadingChange?: (isLoading: boolean) => void
701
908
 
702
- ```js
703
- order: {
704
- header: {
705
- isReferralDisabled: boolean
706
- shareLink: string
707
- total: string
708
- salesReferred: string
709
- },
710
- items: [
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
- ]
909
+ styles?: IMyOrdersStyles
910
+ config?: {
911
+ isEventsDropdownHidden?: boolean
912
+ areActivityIndicatorsEnabled?: boolean
913
+ areAlertsEnabled?: boolean
914
+ }
915
+ texts?: {
916
+ selectEventPlaceholder?: string
917
+ title?: string
918
+ }
731
919
  }
732
920
  ```
733
921
 
734
- `styles` to customize the component look & feel.
735
-
922
+ ### styles
736
923
  ```js
737
- export interface IMyOrdersStyles {
738
- orderListItem?: IOrderListItemStyles
924
+ {
925
+ orderListItem?: {
926
+ rootContainer?: StyleProp<ViewStyle>
927
+ contentContainer?: StyleProp<ViewStyle>
928
+ infoContainer?: StyleProp<ViewStyle>
929
+ infoTopContainer?: StyleProp<ViewStyle>
930
+ infoBottomContainer?: StyleProp<ViewStyle>
931
+ imageContainer?: StyleProp<ViewStyle>
932
+ image?: StyleProp<ImageStyle>
933
+ infoRootContainer?: StyleProp<ViewStyle>
934
+ iconNextContainer?: StyleProp<ViewStyle>
935
+ iconNext?: StyleProp<ImageStyle>
936
+ orderId?: StyleProp<TextStyle>
937
+ orderDate?: StyleProp<TextStyle>
938
+ eventName?: StyleProp<TextStyle>
939
+ priceContainer?: StyleProp<ViewStyle>
940
+ price?: StyleProp<TextStyle>
941
+ currency?: StyleProp<TextStyle>
942
+ }
739
943
  safeArea?: StyleProp<ViewStyle>
740
944
  listContainer?: StyleProp<ViewStyle>
741
945
  eventsContainer?: StyleProp<ViewStyle>
742
946
  eventsTitle?: StyleProp<TextStyle>
743
947
  refreshControlColor?: ColorValue
744
- eventsDropdown?: IDropdownStyles
948
+ eventsDropdown?: {
949
+ container?: StyleProp<ViewStyle>
950
+ button?: StyleProp<ViewStyle>
951
+ icon?: StyleProp<ImageStyle>
952
+ label?: StyleProp<TextStyle>
953
+ dialog?: StyleProp<ViewStyle>
954
+ flatListContainer?: StyleProp<ViewStyle>
955
+ listItem?: {
956
+ container?: StyleProp<ViewStyle>
957
+ button?: StyleProp<ViewStyle>
958
+ buttonSelected?: StyleProp<ViewStyle>
959
+ text?: StyleProp<TextStyle>
960
+ textSelected?: StyleProp<TextStyle>
961
+ }
962
+
963
+ }
745
964
  rootContainer?: StyleProp<ViewStyle>
746
965
  eventsSelectionContainer?: StyleProp<ViewStyle>
747
966
  clearEventSelectionIcon?: StyleProp<ImageStyle>
748
967
  }
749
968
  ```
750
969
 
751
- `onFetchOrderDetailsFail` if the fetching fails, you can use this to know what happened.
752
-
753
970
  ---
754
971
 
755
- ## MyOrderDetails
972
+ ## MyOrder Details
756
973
 
757
- ![image](https://user-images.githubusercontent.com/66479719/151049265-ebaabb75-58b1-4b22-bf99-83b1375b1a70.png)
758
-
759
- When user selects an order from the `MyOrders`component, will show it details.
974
+ When user selects an order from the `MyOrders` component, will show it details.
760
975
 
761
976
  Import the component from the library.
762
977
 
@@ -766,44 +981,25 @@ import { MyOrderDetails } from 'tf-checkout-react-native'
766
981
 
767
982
  ### Props
768
983
 
769
- `data` receives same data as the one of the object received from the `onSelectOrder` handler in `MyOrders`component:
770
-
771
984
  ```js
772
- order: {
773
- header: {
774
- isReferralDisabled: boolean
775
- shareLink: string
776
- total: string
777
- salesReferred: string
778
- },
779
- items: [
780
- {
781
- name: string
782
- currency: string
783
- price: string
784
- discount: string
785
- quantity: string
786
- total: string
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?: {
985
+ {
986
+ data: IMyOrderDetailsResponse
987
+ config?: {
988
+ areActivityIndicatorsEnabled?: boolean
989
+ areAlertsEnabled?: boolean
990
+ }
991
+ onDownloadStatusChange?: (status?:
992
+ 'downloading' |
993
+ 'downloaded' |
994
+ 'failed'
995
+ ) => void
996
+ downloadStatusIcons?: {
997
+ success?: ImageSourcePropType
998
+ error?: ImageSourcePropType
999
+ }
1000
+ onAndroidWritePermission?: (permission?: boolean) => void
1001
+ onLinkCopied?: (copied?: boolean) => void
1002
+ styles?: {
807
1003
  rootContainer?: StyleProp<ViewStyle>
808
1004
  header?: {
809
1005
  container?: StyleProp<ViewStyle>
@@ -847,29 +1043,38 @@ styles?: {
847
1043
  }
848
1044
  downloadButton?: IButtonStyles
849
1045
  }
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?: {
1046
+ texts?: {
867
1047
  title?: string
868
- ticketId?: string
869
- ticketType?: string
870
- ticketHolder?: string
871
- status?: string
872
- download?: string
1048
+ subTitle?: string
1049
+ referralLink?: string
1050
+ referral?: {
1051
+ soFar?: string
1052
+ tickets?: string
1053
+ }
1054
+ listItem?: {
1055
+ title?: string
1056
+ ticketType?: string
1057
+ price?: string
1058
+ quantity?: string
1059
+ total?: string
1060
+ }
1061
+ ticketItem?: {
1062
+ title?: string
1063
+ ticketId?: string
1064
+ ticketType?: string
1065
+ ticketHolder?: string
1066
+ status?: string
1067
+ download?: string
1068
+ }
1069
+ downloadNotification?: {
1070
+ successMessage?: string
1071
+ errorMessage?: string
1072
+ }
1073
+ copyText?: {
1074
+ copy?: string
1075
+ copied?: string
1076
+ }
873
1077
  }
874
1078
  }
875
1079
  ```
1080
+