tf-checkout-react 1.3.3 → 1.3.4
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/dist/components/ticketsContainer/index.d.ts +2 -1
- package/dist/tf-checkout-react.cjs.development.js +47 -29
- package/dist/tf-checkout-react.cjs.development.js.map +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
- package/dist/tf-checkout-react.esm.js +47 -29
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ticketsContainer/index.tsx +6 -1
|
@@ -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,30 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5651
5653
|
|
|
5652
5654
|
case 9:
|
|
5653
5655
|
result = _context2.sent;
|
|
5654
|
-
|
|
5656
|
+
|
|
5657
|
+
if (!enableAddOns) {
|
|
5658
|
+
_context2.next = 16;
|
|
5659
|
+
break;
|
|
5660
|
+
}
|
|
5661
|
+
|
|
5662
|
+
_context2.next = 13;
|
|
5655
5663
|
return getCheckoutPageConfigs();
|
|
5656
5664
|
|
|
5657
|
-
case
|
|
5658
|
-
|
|
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
|
+
};
|
|
5674
|
+
|
|
5675
|
+
case 17:
|
|
5676
|
+
pageConfigsDataResponse = _context2.t0;
|
|
5659
5677
|
|
|
5660
5678
|
if (!(result.status === 200 && pageConfigsDataResponse.status === 200)) {
|
|
5661
|
-
_context2.next =
|
|
5679
|
+
_context2.next = 44;
|
|
5662
5680
|
break;
|
|
5663
5681
|
}
|
|
5664
5682
|
|
|
@@ -5674,7 +5692,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5674
5692
|
_isWindowDefined && window.localStorage.removeItem('add_ons');
|
|
5675
5693
|
|
|
5676
5694
|
if (!(skipBillingPage && !hasAddOn)) {
|
|
5677
|
-
_context2.next =
|
|
5695
|
+
_context2.next = 43;
|
|
5678
5696
|
break;
|
|
5679
5697
|
}
|
|
5680
5698
|
|
|
@@ -5684,27 +5702,27 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5684
5702
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
5685
5703
|
|
|
5686
5704
|
if (!enableBillingInfoAutoCreate) {
|
|
5687
|
-
_context2.next =
|
|
5705
|
+
_context2.next = 39;
|
|
5688
5706
|
break;
|
|
5689
5707
|
}
|
|
5690
5708
|
|
|
5691
|
-
_context2.next =
|
|
5709
|
+
_context2.next = 36;
|
|
5692
5710
|
return postOnCheckout(checkoutBody, access_token);
|
|
5693
5711
|
|
|
5694
|
-
case
|
|
5695
|
-
_context2.
|
|
5696
|
-
_context2.next =
|
|
5712
|
+
case 36:
|
|
5713
|
+
_context2.t1 = _context2.sent;
|
|
5714
|
+
_context2.next = 40;
|
|
5697
5715
|
break;
|
|
5698
5716
|
|
|
5699
|
-
case
|
|
5700
|
-
_context2.
|
|
5717
|
+
case 39:
|
|
5718
|
+
_context2.t1 = null;
|
|
5701
5719
|
|
|
5702
|
-
case
|
|
5703
|
-
checkoutResult = _context2.
|
|
5720
|
+
case 40:
|
|
5721
|
+
checkoutResult = _context2.t1;
|
|
5704
5722
|
hash = _get(checkoutResult, 'data.data.attributes.hash');
|
|
5705
5723
|
total = _get(checkoutResult, 'data.data.attributes.total');
|
|
5706
5724
|
|
|
5707
|
-
case
|
|
5725
|
+
case 43:
|
|
5708
5726
|
onAddToCartSuccess({
|
|
5709
5727
|
skip_billing_page: skipBillingPage,
|
|
5710
5728
|
names_required: nameIsRequired,
|
|
@@ -5716,30 +5734,30 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5716
5734
|
hasAddOn: hasAddOn
|
|
5717
5735
|
});
|
|
5718
5736
|
|
|
5719
|
-
case
|
|
5720
|
-
_context2.next =
|
|
5737
|
+
case 44:
|
|
5738
|
+
_context2.next = 49;
|
|
5721
5739
|
break;
|
|
5722
5740
|
|
|
5723
|
-
case
|
|
5724
|
-
_context2.prev =
|
|
5725
|
-
_context2.
|
|
5741
|
+
case 46:
|
|
5742
|
+
_context2.prev = 46;
|
|
5743
|
+
_context2.t2 = _context2["catch"](6);
|
|
5726
5744
|
|
|
5727
|
-
if (axios.isAxiosError(_context2.
|
|
5728
|
-
onAddToCartError(_context2.
|
|
5729
|
-
setError(_get(_context2.
|
|
5745
|
+
if (axios.isAxiosError(_context2.t2)) {
|
|
5746
|
+
onAddToCartError(_context2.t2);
|
|
5747
|
+
setError(_get(_context2.t2, 'response.data.message'));
|
|
5730
5748
|
}
|
|
5731
5749
|
|
|
5732
|
-
case
|
|
5733
|
-
_context2.prev =
|
|
5750
|
+
case 49:
|
|
5751
|
+
_context2.prev = 49;
|
|
5734
5752
|
setHandleBookIsLoading(false);
|
|
5735
|
-
return _context2.finish(
|
|
5753
|
+
return _context2.finish(49);
|
|
5736
5754
|
|
|
5737
|
-
case
|
|
5755
|
+
case 52:
|
|
5738
5756
|
case "end":
|
|
5739
5757
|
return _context2.stop();
|
|
5740
5758
|
}
|
|
5741
5759
|
}
|
|
5742
|
-
}, _callee2, null, [[6,
|
|
5760
|
+
}, _callee2, null, [[6, 46, 49, 52]]);
|
|
5743
5761
|
}));
|
|
5744
5762
|
|
|
5745
5763
|
return function handleBook() {
|