tf-checkout-react 1.3.3 → 1.3.5

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.
@@ -43,6 +43,7 @@ export interface IGetTickets {
43
43
  ticketsHeaderComponent?: ReactNode;
44
44
  hideTicketsHeader?: boolean;
45
45
  enableInfluencersSection?: boolean;
46
+ enableAddOns?: boolean;
46
47
  }
47
48
  export interface ITicket {
48
49
  id: string | number;
@@ -51,5 +52,5 @@ export interface ITicket {
51
52
  export interface ISelectedTickets {
52
53
  [key: string]: string | number;
53
54
  }
54
- export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, onLogoutSuccess, onLogoutError, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons, hideWaitingList, enableBillingInfoAutoCreate, isButtonScrollable, sortBySoldOut, disableCountdownLeadingZero, isLoggedIn, actionsSectionComponent: ActionsSectionComponent, ticketsHeaderComponent, hideTicketsHeader, enableInfluencersSection, }: IGetTickets) => JSX.Element;
55
+ export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, onLogoutSuccess, onLogoutError, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons, hideWaitingList, enableBillingInfoAutoCreate, isButtonScrollable, sortBySoldOut, disableCountdownLeadingZero, isLoggedIn, actionsSectionComponent: ActionsSectionComponent, ticketsHeaderComponent, hideTicketsHeader, enableInfluencersSection, enableAddOns, }: IGetTickets) => JSX.Element;
55
56
  export {};
@@ -5378,7 +5378,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
5378
5378
  _ref$hideTicketsHeade = _ref.hideTicketsHeader,
5379
5379
  hideTicketsHeader = _ref$hideTicketsHeade === void 0 ? false : _ref$hideTicketsHeade,
5380
5380
  _ref$enableInfluencer = _ref.enableInfluencersSection,
5381
- enableInfluencersSection = _ref$enableInfluencer === void 0 ? true : _ref$enableInfluencer;
5381
+ enableInfluencersSection = _ref$enableInfluencer === void 0 ? true : _ref$enableInfluencer,
5382
+ _ref$enableAddOns = _ref.enableAddOns,
5383
+ enableAddOns = _ref$enableAddOns === void 0 ? true : _ref$enableAddOns;
5382
5384
 
5383
5385
  var _useState = React.useState({}),
5384
5386
  selectedTickets = _useState[0],
@@ -5651,14 +5653,33 @@ var TicketsContainer = function TicketsContainer(_ref) {
5651
5653
 
5652
5654
  case 9:
5653
5655
  result = _context2.sent;
5654
- _context2.next = 12;
5656
+
5657
+ if (!enableAddOns) {
5658
+ _context2.next = 16;
5659
+ break;
5660
+ }
5661
+
5662
+ _context2.next = 13;
5655
5663
  return getCheckoutPageConfigs();
5656
5664
 
5657
- case 12:
5658
- pageConfigsDataResponse = _context2.sent;
5665
+ case 13:
5666
+ _context2.t0 = _context2.sent;
5667
+ _context2.next = 17;
5668
+ break;
5669
+
5670
+ case 16:
5671
+ _context2.t0 = {
5672
+ status: 200,
5673
+ data: {
5674
+ attributes: _get(result, 'data.data.attributes')
5675
+ }
5676
+ };
5677
+
5678
+ case 17:
5679
+ pageConfigsDataResponse = _context2.t0;
5659
5680
 
5660
5681
  if (!(result.status === 200 && pageConfigsDataResponse.status === 200)) {
5661
- _context2.next = 39;
5682
+ _context2.next = 44;
5662
5683
  break;
5663
5684
  }
5664
5685
 
@@ -5674,7 +5695,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
5674
5695
  _isWindowDefined && window.localStorage.removeItem('add_ons');
5675
5696
 
5676
5697
  if (!(skipBillingPage && !hasAddOn)) {
5677
- _context2.next = 38;
5698
+ _context2.next = 43;
5678
5699
  break;
5679
5700
  }
5680
5701
 
@@ -5684,27 +5705,27 @@ var TicketsContainer = function TicketsContainer(_ref) {
5684
5705
  checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
5685
5706
 
5686
5707
  if (!enableBillingInfoAutoCreate) {
5687
- _context2.next = 34;
5708
+ _context2.next = 39;
5688
5709
  break;
5689
5710
  }
5690
5711
 
5691
- _context2.next = 31;
5712
+ _context2.next = 36;
5692
5713
  return postOnCheckout(checkoutBody, access_token);
5693
5714
 
5694
- case 31:
5695
- _context2.t0 = _context2.sent;
5696
- _context2.next = 35;
5715
+ case 36:
5716
+ _context2.t1 = _context2.sent;
5717
+ _context2.next = 40;
5697
5718
  break;
5698
5719
 
5699
- case 34:
5700
- _context2.t0 = null;
5720
+ case 39:
5721
+ _context2.t1 = null;
5701
5722
 
5702
- case 35:
5703
- checkoutResult = _context2.t0;
5723
+ case 40:
5724
+ checkoutResult = _context2.t1;
5704
5725
  hash = _get(checkoutResult, 'data.data.attributes.hash');
5705
5726
  total = _get(checkoutResult, 'data.data.attributes.total');
5706
5727
 
5707
- case 38:
5728
+ case 43:
5708
5729
  onAddToCartSuccess({
5709
5730
  skip_billing_page: skipBillingPage,
5710
5731
  names_required: nameIsRequired,
@@ -5716,30 +5737,30 @@ var TicketsContainer = function TicketsContainer(_ref) {
5716
5737
  hasAddOn: hasAddOn
5717
5738
  });
5718
5739
 
5719
- case 39:
5720
- _context2.next = 44;
5740
+ case 44:
5741
+ _context2.next = 49;
5721
5742
  break;
5722
5743
 
5723
- case 41:
5724
- _context2.prev = 41;
5725
- _context2.t1 = _context2["catch"](6);
5744
+ case 46:
5745
+ _context2.prev = 46;
5746
+ _context2.t2 = _context2["catch"](6);
5726
5747
 
5727
- if (axios.isAxiosError(_context2.t1)) {
5728
- onAddToCartError(_context2.t1);
5729
- setError(_get(_context2.t1, 'response.data.message'));
5748
+ if (axios.isAxiosError(_context2.t2)) {
5749
+ onAddToCartError(_context2.t2);
5750
+ setError(_get(_context2.t2, 'response.data.message'));
5730
5751
  }
5731
5752
 
5732
- case 44:
5733
- _context2.prev = 44;
5753
+ case 49:
5754
+ _context2.prev = 49;
5734
5755
  setHandleBookIsLoading(false);
5735
- return _context2.finish(44);
5756
+ return _context2.finish(49);
5736
5757
 
5737
- case 47:
5758
+ case 52:
5738
5759
  case "end":
5739
5760
  return _context2.stop();
5740
5761
  }
5741
5762
  }
5742
- }, _callee2, null, [[6, 41, 44, 47]]);
5763
+ }, _callee2, null, [[6, 46, 49, 52]]);
5743
5764
  }));
5744
5765
 
5745
5766
  return function handleBook() {