tf-checkout-react 1.3.2 → 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/billing-info-container/utils.d.ts +2 -2
- package/dist/components/common/PhoneNumberField.d.ts +1 -1
- package/dist/components/confirmationContainer/index.d.ts +7 -1
- package/dist/components/ticketsContainer/index.d.ts +2 -1
- package/dist/tf-checkout-react.cjs.development.js +136 -63
- 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 +136 -63
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/billing-info-container/index.tsx +13 -7
- package/src/components/billing-info-container/utils.ts +11 -2
- package/src/components/common/DatePickerField.tsx +7 -1
- package/src/components/common/PhoneNumberField.tsx +14 -2
- package/src/components/confirmationContainer/index.tsx +27 -11
- package/src/components/ticketsContainer/index.tsx +42 -28
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IGroupItem } from '../../types';
|
|
2
|
-
import { FormikValues } from 'formik';
|
|
2
|
+
import { FormikErrors, FormikValues } from 'formik';
|
|
3
3
|
export interface ILoggedInValues {
|
|
4
4
|
emailLogged?: string;
|
|
5
5
|
firstNameLogged?: string;
|
|
@@ -50,6 +50,6 @@ export declare const setLoggedUserData: (data: IUserData) => {
|
|
|
50
50
|
export declare const createCheckoutDataBody: (ticketsQuantity: number, values?: IValues, logedInValues?: ILoggedInValues, includeDob?: boolean) => ICheckoutBody;
|
|
51
51
|
export declare const getValidateFunctions: (element: IGroupItem, states: {
|
|
52
52
|
[key: string]: any;
|
|
53
|
-
}[], values: FormikValues) => (...value: any) => any;
|
|
53
|
+
}[], values: FormikValues, errors: FormikErrors<any>) => (...value: any) => any;
|
|
54
54
|
export declare const assingUniqueIds: (data: any) => any;
|
|
55
55
|
export {};
|
|
@@ -9,4 +9,4 @@ export interface IPhoneNumberField {
|
|
|
9
9
|
fill: boolean;
|
|
10
10
|
setPhoneValidationIsLoading: (isLoading: boolean) => void;
|
|
11
11
|
}
|
|
12
|
-
export declare const PhoneNumberField: ({ label, field, form: { errors, touched, setFieldError, values, initialValues, setFieldValue, setFieldTouched, }, disableDropdown, fill, setPhoneValidationIsLoading, }: IPhoneNumberField) => JSX.Element;
|
|
12
|
+
export declare const PhoneNumberField: ({ label, field, form: { errors, touched, setFieldError, values, initialValues, setFieldValue, setFieldTouched, setErrors, }, disableDropdown, fill, setPhoneValidationIsLoading, }: IPhoneNumberField) => JSX.Element;
|
|
@@ -7,6 +7,11 @@ export interface IShareButton {
|
|
|
7
7
|
platform: string;
|
|
8
8
|
shareData: any;
|
|
9
9
|
}
|
|
10
|
+
export interface IConfirmationLabels {
|
|
11
|
+
confirmationTitle?: string;
|
|
12
|
+
confirmationMain?: string;
|
|
13
|
+
confirmationHelper?: string;
|
|
14
|
+
}
|
|
10
15
|
export interface IConfirmationPage {
|
|
11
16
|
hasCopyIcon?: boolean;
|
|
12
17
|
isReferralEnabled: boolean;
|
|
@@ -17,5 +22,6 @@ export interface IConfirmationPage {
|
|
|
17
22
|
onGetConfirmationDataError: (e: AxiosError) => void;
|
|
18
23
|
onLinkCopied: () => void;
|
|
19
24
|
orderHash?: string;
|
|
25
|
+
confirmationLabels: IConfirmationLabels;
|
|
20
26
|
}
|
|
21
|
-
export declare const ConfirmationContainer: ({ hasCopyIcon, isReferralEnabled, showDefaultShareButtons, messengerAppId, shareButtons, onGetConfirmationDataSuccess, onGetConfirmationDataError, orderHash, onLinkCopied }: IConfirmationPage) => JSX.Element;
|
|
27
|
+
export declare const ConfirmationContainer: ({ confirmationLabels, hasCopyIcon, isReferralEnabled, showDefaultShareButtons, messengerAppId, shareButtons, onGetConfirmationDataSuccess, onGetConfirmationDataError, orderHash, onLinkCopied }: IConfirmationPage) => JSX.Element;
|
|
@@ -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 {};
|
|
@@ -1720,7 +1720,13 @@ var DatePickerField = function DatePickerField(_ref) {
|
|
|
1720
1720
|
placeholder: 'dd/mm/yyyy'
|
|
1721
1721
|
}),
|
|
1722
1722
|
theme: theme,
|
|
1723
|
-
field: field,
|
|
1723
|
+
field: _extends({}, field, {
|
|
1724
|
+
onChange: function onChange(evt) {
|
|
1725
|
+
if (params.inputProps && params.inputProps.onChange) {
|
|
1726
|
+
params.inputProps.onChange(evt);
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
}),
|
|
1724
1730
|
form: form,
|
|
1725
1731
|
label: label,
|
|
1726
1732
|
type: "tel"
|
|
@@ -1760,6 +1766,7 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
1760
1766
|
initialValues = _ref$form.initialValues,
|
|
1761
1767
|
setFieldValue = _ref$form.setFieldValue,
|
|
1762
1768
|
setFieldTouched = _ref$form.setFieldTouched,
|
|
1769
|
+
setErrors = _ref$form.setErrors,
|
|
1763
1770
|
_ref$disableDropdown = _ref.disableDropdown,
|
|
1764
1771
|
disableDropdown = _ref$disableDropdown === void 0 ? true : _ref$disableDropdown,
|
|
1765
1772
|
_ref$fill = _ref.fill,
|
|
@@ -1779,46 +1786,63 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
1779
1786
|
}
|
|
1780
1787
|
|
|
1781
1788
|
debounceCb( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
1782
|
-
var message;
|
|
1789
|
+
var newErrors, _newErrors, message;
|
|
1790
|
+
|
|
1783
1791
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1784
1792
|
while (1) {
|
|
1785
1793
|
switch (_context.prev = _context.next) {
|
|
1786
1794
|
case 0:
|
|
1787
1795
|
_context.prev = 0;
|
|
1788
1796
|
|
|
1797
|
+
if (values[field.name]) {
|
|
1798
|
+
_context.next = 6;
|
|
1799
|
+
break;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
newErrors = _extends({}, errors);
|
|
1803
|
+
delete newErrors[field.name];
|
|
1804
|
+
setErrors(newErrors);
|
|
1805
|
+
return _context.abrupt("return");
|
|
1806
|
+
|
|
1807
|
+
case 6:
|
|
1789
1808
|
if (!values[field.name]) {
|
|
1790
|
-
_context.next =
|
|
1809
|
+
_context.next = 9;
|
|
1791
1810
|
break;
|
|
1792
1811
|
}
|
|
1793
1812
|
|
|
1794
|
-
_context.next =
|
|
1813
|
+
_context.next = 9;
|
|
1795
1814
|
return validatePhoneNumber(values[field.name]);
|
|
1796
1815
|
|
|
1797
|
-
case
|
|
1798
|
-
|
|
1799
|
-
|
|
1816
|
+
case 9:
|
|
1817
|
+
if (errors[field.name]) {
|
|
1818
|
+
_newErrors = _extends({}, errors);
|
|
1819
|
+
delete _newErrors[field.name];
|
|
1820
|
+
setErrors(_newErrors);
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
_context.next = 16;
|
|
1800
1824
|
break;
|
|
1801
1825
|
|
|
1802
|
-
case
|
|
1803
|
-
_context.prev =
|
|
1826
|
+
case 12:
|
|
1827
|
+
_context.prev = 12;
|
|
1804
1828
|
_context.t0 = _context["catch"](0);
|
|
1805
1829
|
message = _get(_context.t0, 'response.data.message', 'Invalid phone number');
|
|
1806
1830
|
|
|
1807
|
-
if (values[field.name]) {
|
|
1831
|
+
if (values[field.name] && errors[field.name] !== message) {
|
|
1808
1832
|
setFieldError(field.name, message);
|
|
1809
1833
|
}
|
|
1810
1834
|
|
|
1811
|
-
case
|
|
1812
|
-
_context.prev =
|
|
1835
|
+
case 16:
|
|
1836
|
+
_context.prev = 16;
|
|
1813
1837
|
setPhoneValidationIsLoading(false);
|
|
1814
|
-
return _context.finish(
|
|
1838
|
+
return _context.finish(16);
|
|
1815
1839
|
|
|
1816
|
-
case
|
|
1840
|
+
case 19:
|
|
1817
1841
|
case "end":
|
|
1818
1842
|
return _context.stop();
|
|
1819
1843
|
}
|
|
1820
1844
|
}
|
|
1821
|
-
}, _callee, null, [[0,
|
|
1845
|
+
}, _callee, null, [[0, 12, 16, 19]]);
|
|
1822
1846
|
}))); // eslint-disable-next-line
|
|
1823
1847
|
}, [field.value]);
|
|
1824
1848
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement(MuiPhoneNumber, {
|
|
@@ -1841,7 +1865,8 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
1841
1865
|
helperText: (isTouched || fill) && error,
|
|
1842
1866
|
fullWidth: true,
|
|
1843
1867
|
autoFormat: false,
|
|
1844
|
-
disableAreaCodes: true
|
|
1868
|
+
disableAreaCodes: true,
|
|
1869
|
+
countryCodeEditable: false
|
|
1845
1870
|
}));
|
|
1846
1871
|
};
|
|
1847
1872
|
|
|
@@ -2688,7 +2713,7 @@ var createCheckoutDataBody = function createCheckoutDataBody(ticketsQuantity, va
|
|
|
2688
2713
|
|
|
2689
2714
|
return body;
|
|
2690
2715
|
};
|
|
2691
|
-
var getValidateFunctions = function getValidateFunctions(element, states, values) {
|
|
2716
|
+
var getValidateFunctions = function getValidateFunctions(element, states, values, errors) {
|
|
2692
2717
|
var validationFunctions = [];
|
|
2693
2718
|
|
|
2694
2719
|
if (element.required) {
|
|
@@ -2701,6 +2726,14 @@ var getValidateFunctions = function getValidateFunctions(element, states, values
|
|
|
2701
2726
|
validationFunctions.push(element.onValidate);
|
|
2702
2727
|
}
|
|
2703
2728
|
|
|
2729
|
+
if (element.name === 'phone') {
|
|
2730
|
+
var invalidPhone = function invalidPhone() {
|
|
2731
|
+
return errors.phone === 'Invalid phone number' ? 'Invalid phone number' : null;
|
|
2732
|
+
};
|
|
2733
|
+
|
|
2734
|
+
validationFunctions.push(invalidPhone);
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2704
2737
|
if (element.name === 'confirmEmail') {
|
|
2705
2738
|
var isSameEmail = function isSameEmail(confirmEmail) {
|
|
2706
2739
|
return values.email !== confirmEmail ? 'Please confirm your email address correctly' : null;
|
|
@@ -3587,7 +3620,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
|
|
|
3587
3620
|
label: element.name === 'phone' ? "" + element.label + (flagRequirePhone ? '' : ' (optional)') + " " : element.label,
|
|
3588
3621
|
type: element.type,
|
|
3589
3622
|
fill: element.fill,
|
|
3590
|
-
validate: getValidateFunctions(element, states, props.values),
|
|
3623
|
+
validate: getValidateFunctions(element, states, props.values, props.errors),
|
|
3591
3624
|
setFieldValue: props.setFieldValue,
|
|
3592
3625
|
onBlur: props.handleBlur,
|
|
3593
3626
|
component: element.type === 'checkbox' ? CheckboxField : element.type === 'select' ? SelectField : element.type === 'phone' ? PhoneNumberField : element.type === 'date' ? DatePickerField : CustomField,
|
|
@@ -3610,12 +3643,16 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
|
|
|
3610
3643
|
}, React__default.createElement("div", {
|
|
3611
3644
|
className: groupClassname
|
|
3612
3645
|
}, _map(groupItems, function (element) {
|
|
3646
|
+
if (_includes(['holderFirstName', 'holderLastName'], element.name)) {
|
|
3647
|
+
element.required = showTicketHolders;
|
|
3648
|
+
}
|
|
3649
|
+
|
|
3613
3650
|
return React__default.createElement("div", {
|
|
3614
3651
|
className: element.className,
|
|
3615
3652
|
key: element.name
|
|
3616
3653
|
}, React__default.createElement(formik.Field, {
|
|
3617
3654
|
name: element.name + "-" + index,
|
|
3618
|
-
label: element.label,
|
|
3655
|
+
label: "" + element.label + (element.required ? '' : ' (optional)'),
|
|
3619
3656
|
type: element.type,
|
|
3620
3657
|
component: element.type === 'checkbox' ? CheckboxField : element.type === 'phone' ? PhoneNumberField : CustomField,
|
|
3621
3658
|
validate: combineValidators(element.required ? requiredValidator : function () {
|
|
@@ -4571,7 +4608,8 @@ var SocialButtons = function SocialButtons(_ref2) {
|
|
|
4571
4608
|
};
|
|
4572
4609
|
|
|
4573
4610
|
var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
4574
|
-
var
|
|
4611
|
+
var confirmationLabels = _ref.confirmationLabels,
|
|
4612
|
+
_ref$hasCopyIcon = _ref.hasCopyIcon,
|
|
4575
4613
|
hasCopyIcon = _ref$hasCopyIcon === void 0 ? true : _ref$hasCopyIcon,
|
|
4576
4614
|
isReferralEnabled = _ref.isReferralEnabled,
|
|
4577
4615
|
showDefaultShareButtons = _ref.showDefaultShareButtons,
|
|
@@ -4670,6 +4708,12 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4670
4708
|
setData(newData);
|
|
4671
4709
|
};
|
|
4672
4710
|
|
|
4711
|
+
var _confirmationLabels$c = confirmationLabels.confirmationTitle,
|
|
4712
|
+
confirmationTitle = _confirmationLabels$c === void 0 ? 'Your Tickets are Confirmed!' : _confirmationLabels$c,
|
|
4713
|
+
_confirmationLabels$c2 = confirmationLabels.confirmationMain,
|
|
4714
|
+
confirmationMain = _confirmationLabels$c2 === void 0 ? 'Your tickets are available in My Tickets section' : _confirmationLabels$c2,
|
|
4715
|
+
_confirmationLabels$c3 = confirmationLabels.confirmationHelper,
|
|
4716
|
+
confirmationHelper = _confirmationLabels$c3 === void 0 ? 'Please bring them with you to the event' : _confirmationLabels$c3;
|
|
4673
4717
|
return React__default.createElement("div", {
|
|
4674
4718
|
className: "confirmation-page"
|
|
4675
4719
|
}, data && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
@@ -4683,15 +4727,15 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4683
4727
|
className: "header-product-text"
|
|
4684
4728
|
}, React__default.createElement("p", {
|
|
4685
4729
|
className: "title"
|
|
4686
|
-
},
|
|
4730
|
+
}, confirmationTitle), React__default.createElement("div", {
|
|
4687
4731
|
className: "share-message-section"
|
|
4688
4732
|
}, data.attach_tickets ? React__default.createElement("span", {
|
|
4689
4733
|
className: "main"
|
|
4690
4734
|
}, "Your tickets have been emailed to you") : React__default.createElement("span", {
|
|
4691
4735
|
className: "main"
|
|
4692
|
-
},
|
|
4736
|
+
}, confirmationMain), React__default.createElement("span", {
|
|
4693
4737
|
className: "helper"
|
|
4694
|
-
},
|
|
4738
|
+
}, data.attach_tickets ? 'Please bring them with you to the event' : confirmationHelper)))), data.disable_referral === false && isReferralEnabled && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
4695
4739
|
className: "referral_text_image_section"
|
|
4696
4740
|
}, React__default.createElement("div", {
|
|
4697
4741
|
className: "referral_text_section"
|
|
@@ -5334,7 +5378,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5334
5378
|
_ref$hideTicketsHeade = _ref.hideTicketsHeader,
|
|
5335
5379
|
hideTicketsHeader = _ref$hideTicketsHeade === void 0 ? false : _ref$hideTicketsHeade,
|
|
5336
5380
|
_ref$enableInfluencer = _ref.enableInfluencersSection,
|
|
5337
|
-
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;
|
|
5338
5384
|
|
|
5339
5385
|
var _useState = React.useState({}),
|
|
5340
5386
|
selectedTickets = _useState[0],
|
|
@@ -5607,14 +5653,30 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5607
5653
|
|
|
5608
5654
|
case 9:
|
|
5609
5655
|
result = _context2.sent;
|
|
5610
|
-
|
|
5656
|
+
|
|
5657
|
+
if (!enableAddOns) {
|
|
5658
|
+
_context2.next = 16;
|
|
5659
|
+
break;
|
|
5660
|
+
}
|
|
5661
|
+
|
|
5662
|
+
_context2.next = 13;
|
|
5611
5663
|
return getCheckoutPageConfigs();
|
|
5612
5664
|
|
|
5613
|
-
case
|
|
5614
|
-
|
|
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;
|
|
5615
5677
|
|
|
5616
5678
|
if (!(result.status === 200 && pageConfigsDataResponse.status === 200)) {
|
|
5617
|
-
_context2.next =
|
|
5679
|
+
_context2.next = 44;
|
|
5618
5680
|
break;
|
|
5619
5681
|
}
|
|
5620
5682
|
|
|
@@ -5630,7 +5692,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5630
5692
|
_isWindowDefined && window.localStorage.removeItem('add_ons');
|
|
5631
5693
|
|
|
5632
5694
|
if (!(skipBillingPage && !hasAddOn)) {
|
|
5633
|
-
_context2.next =
|
|
5695
|
+
_context2.next = 43;
|
|
5634
5696
|
break;
|
|
5635
5697
|
}
|
|
5636
5698
|
|
|
@@ -5640,27 +5702,27 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5640
5702
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
5641
5703
|
|
|
5642
5704
|
if (!enableBillingInfoAutoCreate) {
|
|
5643
|
-
_context2.next =
|
|
5705
|
+
_context2.next = 39;
|
|
5644
5706
|
break;
|
|
5645
5707
|
}
|
|
5646
5708
|
|
|
5647
|
-
_context2.next =
|
|
5709
|
+
_context2.next = 36;
|
|
5648
5710
|
return postOnCheckout(checkoutBody, access_token);
|
|
5649
5711
|
|
|
5650
|
-
case
|
|
5651
|
-
_context2.
|
|
5652
|
-
_context2.next =
|
|
5712
|
+
case 36:
|
|
5713
|
+
_context2.t1 = _context2.sent;
|
|
5714
|
+
_context2.next = 40;
|
|
5653
5715
|
break;
|
|
5654
5716
|
|
|
5655
|
-
case
|
|
5656
|
-
_context2.
|
|
5717
|
+
case 39:
|
|
5718
|
+
_context2.t1 = null;
|
|
5657
5719
|
|
|
5658
|
-
case
|
|
5659
|
-
checkoutResult = _context2.
|
|
5720
|
+
case 40:
|
|
5721
|
+
checkoutResult = _context2.t1;
|
|
5660
5722
|
hash = _get(checkoutResult, 'data.data.attributes.hash');
|
|
5661
5723
|
total = _get(checkoutResult, 'data.data.attributes.total');
|
|
5662
5724
|
|
|
5663
|
-
case
|
|
5725
|
+
case 43:
|
|
5664
5726
|
onAddToCartSuccess({
|
|
5665
5727
|
skip_billing_page: skipBillingPage,
|
|
5666
5728
|
names_required: nameIsRequired,
|
|
@@ -5672,30 +5734,30 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5672
5734
|
hasAddOn: hasAddOn
|
|
5673
5735
|
});
|
|
5674
5736
|
|
|
5675
|
-
case
|
|
5676
|
-
_context2.next =
|
|
5737
|
+
case 44:
|
|
5738
|
+
_context2.next = 49;
|
|
5677
5739
|
break;
|
|
5678
5740
|
|
|
5679
|
-
case
|
|
5680
|
-
_context2.prev =
|
|
5681
|
-
_context2.
|
|
5741
|
+
case 46:
|
|
5742
|
+
_context2.prev = 46;
|
|
5743
|
+
_context2.t2 = _context2["catch"](6);
|
|
5682
5744
|
|
|
5683
|
-
if (axios.isAxiosError(_context2.
|
|
5684
|
-
onAddToCartError(_context2.
|
|
5685
|
-
setError(_get(_context2.
|
|
5745
|
+
if (axios.isAxiosError(_context2.t2)) {
|
|
5746
|
+
onAddToCartError(_context2.t2);
|
|
5747
|
+
setError(_get(_context2.t2, 'response.data.message'));
|
|
5686
5748
|
}
|
|
5687
5749
|
|
|
5688
|
-
case
|
|
5689
|
-
_context2.prev =
|
|
5750
|
+
case 49:
|
|
5751
|
+
_context2.prev = 49;
|
|
5690
5752
|
setHandleBookIsLoading(false);
|
|
5691
|
-
return _context2.finish(
|
|
5753
|
+
return _context2.finish(49);
|
|
5692
5754
|
|
|
5693
|
-
case
|
|
5755
|
+
case 52:
|
|
5694
5756
|
case "end":
|
|
5695
5757
|
return _context2.stop();
|
|
5696
5758
|
}
|
|
5697
5759
|
}
|
|
5698
|
-
}, _callee2, null, [[6,
|
|
5760
|
+
}, _callee2, null, [[6, 46, 49, 52]]);
|
|
5699
5761
|
}));
|
|
5700
5762
|
|
|
5701
5763
|
return function handleBook() {
|
|
@@ -5715,15 +5777,11 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5715
5777
|
var isSalesClosed = event == null ? void 0 : event.salesEnded;
|
|
5716
5778
|
var themeMui = material.createTheme(themeOptions);
|
|
5717
5779
|
React.useEffect(function () {
|
|
5718
|
-
|
|
5780
|
+
window.document.addEventListener('custom-login', handleExternalLogin);
|
|
5781
|
+
window.document.addEventListener('custom-logout', handleLogout);
|
|
5719
5782
|
return function () {
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
}, []);
|
|
5723
|
-
React.useEffect(function () {
|
|
5724
|
-
isWindowDefined && window.document.addEventListener('custom-login', handleExternalLogin);
|
|
5725
|
-
return function () {
|
|
5726
|
-
isWindowDefined && window.document.removeEventListener('custom-login', handleExternalLogin);
|
|
5783
|
+
window.document.removeEventListener('custom-login', handleExternalLogin);
|
|
5784
|
+
window.document.removeEventListener('custom-logout', handleLogout);
|
|
5727
5785
|
};
|
|
5728
5786
|
}, []);
|
|
5729
5787
|
|
|
@@ -5742,14 +5800,29 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5742
5800
|
};
|
|
5743
5801
|
|
|
5744
5802
|
var bookButtonIsDisabled = handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0;
|
|
5803
|
+
|
|
5804
|
+
var isTicketAvailable = _some(tickets, function (ticket) {
|
|
5805
|
+
return ticket.displayTicket && !ticket.soldOut && ticket.salesStarted;
|
|
5806
|
+
});
|
|
5807
|
+
|
|
5745
5808
|
var wrappedActionsSectionComponent = React__default.isValidElement(ActionsSectionComponent) ? React__default.cloneElement(ActionsSectionComponent, {
|
|
5746
5809
|
handleGetTicketClick: handleGetTicketClick,
|
|
5747
|
-
isTicketOnSale: isTicketOnSale
|
|
5810
|
+
isTicketOnSale: isTicketOnSale,
|
|
5811
|
+
isTicketAvailable: isTicketAvailable
|
|
5748
5812
|
}) : null;
|
|
5749
5813
|
var externalUrl = event == null ? void 0 : event.redirectUrl;
|
|
5750
|
-
var eventSaleIsNotStarted = !(event != null && event.salesStarted) && (event == null ? void 0 : event.salesStart);
|
|
5814
|
+
var eventSaleIsNotStarted = !(event != null && event.salesStarted) && (event == null ? void 0 : event.salesStart) && !isTicketAvailable;
|
|
5751
5815
|
var influencers = event != null && event.referralsEnabled ? event == null ? void 0 : event.referrals : [];
|
|
5752
5816
|
var previewKey = getQueryVariable('pk') || undefined;
|
|
5817
|
+
|
|
5818
|
+
var canShowGetTicketBtn = function canShowGetTicketBtn() {
|
|
5819
|
+
if (!wrappedActionsSectionComponent && !eventSaleIsNotStarted && isTicketOnSale && !(event != null && event.salesEnded) && !externalUrl && !previewKey) {
|
|
5820
|
+
return true;
|
|
5821
|
+
}
|
|
5822
|
+
|
|
5823
|
+
return false;
|
|
5824
|
+
};
|
|
5825
|
+
|
|
5753
5826
|
return React__default.createElement(privateTheming.ThemeProvider, {
|
|
5754
5827
|
theme: themeMui
|
|
5755
5828
|
}, !isLoading && React__default.createElement(ReferralLogic, {
|
|
@@ -5799,7 +5872,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5799
5872
|
setShowPromoInput: setShowPromoInput,
|
|
5800
5873
|
setCode: setCode,
|
|
5801
5874
|
updateTickets: updateTickets
|
|
5802
|
-
}) : null, wrappedActionsSectionComponent,
|
|
5875
|
+
}) : null, wrappedActionsSectionComponent, canShowGetTicketBtn() && React__default.createElement(Button$1, {
|
|
5803
5876
|
"aria-hidden": true,
|
|
5804
5877
|
className: "book-button \n " + (bookButtonIsDisabled ? 'disabled' : '') + " \n " + (isButtonScrollable ? 'is-scrollable' : '') + "\n " + (!isLoggedIn ? 'on-bottom' : '') + "\n ",
|
|
5805
5878
|
onClick: handleGetTicketClick
|