tf-checkout-react 1.3.14 → 1.3.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.
- package/README.md +349 -160
- package/dist/components/confirmModal/index.d.ts +1 -1
- package/dist/components/ticketsContainer/index.d.ts +5 -1
- package/dist/tf-checkout-react.cjs.development.js +155 -77
- 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 +156 -78
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/api/index.ts +3 -1
- package/src/components/.DS_Store +0 -0
- package/src/components/billing-info-container/index.tsx +29 -6
- package/src/components/common/CustomField.tsx +25 -22
- package/src/components/common/dist/PhoneNumberField.js +96 -0
- package/src/components/confirmModal/index.tsx +16 -9
- package/src/components/ticketsContainer/index.tsx +57 -3
|
@@ -14,6 +14,8 @@ interface CartSuccess {
|
|
|
14
14
|
total?: string;
|
|
15
15
|
hasAddOn?: boolean;
|
|
16
16
|
free_ticket: boolean;
|
|
17
|
+
collect_optional_wallet_address?: boolean;
|
|
18
|
+
collect_mandatory_wallet_address?: boolean;
|
|
17
19
|
}
|
|
18
20
|
export interface IGetTickets {
|
|
19
21
|
eventId: number;
|
|
@@ -26,6 +28,8 @@ export interface IGetTickets {
|
|
|
26
28
|
onLogoutSuccess: () => void;
|
|
27
29
|
onLogoutError: (e: AxiosError) => void;
|
|
28
30
|
onLoginSuccess: () => void;
|
|
31
|
+
handleNotInvitedModalClose: () => void;
|
|
32
|
+
handleInvalidLinkModalClose: () => void;
|
|
29
33
|
theme?: 'light' | 'dark';
|
|
30
34
|
queryPromoCode?: string;
|
|
31
35
|
isPromotionsEnabled?: boolean;
|
|
@@ -54,5 +58,5 @@ export interface ITicket {
|
|
|
54
58
|
export interface ISelectedTickets {
|
|
55
59
|
[key: string]: string | number;
|
|
56
60
|
}
|
|
57
|
-
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;
|
|
61
|
+
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, handleNotInvitedModalClose, handleInvalidLinkModalClose, }: IGetTickets) => JSX.Element;
|
|
58
62
|
export {};
|
|
@@ -1330,7 +1330,6 @@ function getEvent(id, pk) {
|
|
|
1330
1330
|
var referralIdlocal = '';
|
|
1331
1331
|
|
|
1332
1332
|
if (referral_key) {
|
|
1333
|
-
// eslint-disable-next-line prefer-destructuring
|
|
1334
1333
|
referralIdlocal = referral_key.split('.')[1];
|
|
1335
1334
|
}
|
|
1336
1335
|
|
|
@@ -1351,9 +1350,11 @@ function getEvent(id, pk) {
|
|
|
1351
1350
|
return response;
|
|
1352
1351
|
}
|
|
1353
1352
|
function getTickets(id, promoCode, pk) {
|
|
1353
|
+
var invitationHash = getQueryVariable('invitation-hash');
|
|
1354
1354
|
var response = publicRequest.get("v1/event/" + id + "/tickets", {
|
|
1355
1355
|
params: {
|
|
1356
|
-
pk: pk
|
|
1356
|
+
pk: pk,
|
|
1357
|
+
'invitation-hash': invitationHash
|
|
1357
1358
|
},
|
|
1358
1359
|
headers: promoCode ? _extends({}, ttfHeaders, {
|
|
1359
1360
|
'Promotion-Event': String(id),
|
|
@@ -1611,6 +1612,11 @@ var CustomField = function CustomField(_ref) {
|
|
|
1611
1612
|
_ref$InputProps = _ref.InputProps,
|
|
1612
1613
|
InputProps = _ref$InputProps === void 0 ? {} : _ref$InputProps,
|
|
1613
1614
|
inputRef = _ref.inputRef;
|
|
1615
|
+
|
|
1616
|
+
var _useState = React.useState(Boolean(field.value)),
|
|
1617
|
+
isShrinked = _useState[0],
|
|
1618
|
+
setIsShrinked = _useState[1];
|
|
1619
|
+
|
|
1614
1620
|
var isSelectField = type === 'select';
|
|
1615
1621
|
|
|
1616
1622
|
var error = _get(errors, field.name);
|
|
@@ -1621,6 +1627,7 @@ var CustomField = function CustomField(_ref) {
|
|
|
1621
1627
|
sx: customTheme == null ? void 0 : customTheme.input
|
|
1622
1628
|
};
|
|
1623
1629
|
return React__default.createElement(TextField, Object.assign({
|
|
1630
|
+
placeholder: "",
|
|
1624
1631
|
id: field.name,
|
|
1625
1632
|
label: label,
|
|
1626
1633
|
type: type,
|
|
@@ -1628,6 +1635,9 @@ var CustomField = function CustomField(_ref) {
|
|
|
1628
1635
|
fullWidth: true,
|
|
1629
1636
|
error: !!error && isTouched,
|
|
1630
1637
|
helperText: isTouched && error,
|
|
1638
|
+
onFocus: function onFocus() {
|
|
1639
|
+
setIsShrinked(true);
|
|
1640
|
+
},
|
|
1631
1641
|
SelectProps: {
|
|
1632
1642
|
"native": true,
|
|
1633
1643
|
className: theme,
|
|
@@ -1636,12 +1646,21 @@ var CustomField = function CustomField(_ref) {
|
|
|
1636
1646
|
}
|
|
1637
1647
|
},
|
|
1638
1648
|
InputLabelProps: {
|
|
1639
|
-
sx: customTheme == null ? void 0 : customTheme.input
|
|
1649
|
+
sx: customTheme == null ? void 0 : customTheme.input,
|
|
1650
|
+
shrink: isShrinked || Boolean(field.value)
|
|
1640
1651
|
},
|
|
1641
1652
|
InputProps: InputProps,
|
|
1642
1653
|
inputProps: _extends({}, inputProps, pInputProps),
|
|
1643
1654
|
inputRef: inputRef
|
|
1644
|
-
}, field
|
|
1655
|
+
}, field, {
|
|
1656
|
+
onBlur: function onBlur(e) {
|
|
1657
|
+
setIsShrinked(Boolean(field.value));
|
|
1658
|
+
|
|
1659
|
+
if (field.onBlur) {
|
|
1660
|
+
field.onBlur(e);
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
}), isSelectField ? _map(selectOptions, function (option) {
|
|
1645
1664
|
return React__default.createElement("option", {
|
|
1646
1665
|
key: option.value,
|
|
1647
1666
|
value: option.value,
|
|
@@ -3058,8 +3077,11 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3058
3077
|
var expirationTime = _get(cartInfoData, 'expiresAt');
|
|
3059
3078
|
|
|
3060
3079
|
var flagRequirePhone = getQueryVariable('phone_required') === 'true';
|
|
3080
|
+
var collectMandatoryWalletAddress = getQueryVariable('collect_mandatory_wallet_address') === 'true';
|
|
3061
3081
|
var flagFreeTicket = getQueryVariable('free_ticket') === 'true';
|
|
3062
|
-
var hidePhoneField = getQueryVariable('hide_phone_field') === 'true'; //
|
|
3082
|
+
var hidePhoneField = getQueryVariable('hide_phone_field') === 'true'; // temp change
|
|
3083
|
+
|
|
3084
|
+
var hideWalletAddressField = Number(eventId) === 18164; // Get prevProps
|
|
3063
3085
|
|
|
3064
3086
|
var prevData = React.useRef(data);
|
|
3065
3087
|
|
|
@@ -3628,14 +3650,13 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3628
3650
|
}
|
|
3629
3651
|
}
|
|
3630
3652
|
|
|
3631
|
-
if (el.name === '
|
|
3632
|
-
if (
|
|
3633
|
-
el.required =
|
|
3634
|
-
return false;
|
|
3653
|
+
if (el.name === 'data_capture[wallet_address]') {
|
|
3654
|
+
if (collectMandatoryWalletAddress) {
|
|
3655
|
+
el.required = true;
|
|
3635
3656
|
}
|
|
3636
3657
|
}
|
|
3637
3658
|
|
|
3638
|
-
if (
|
|
3659
|
+
if (['street_address', 'country', 'state', 'city', 'zip'].includes(el.name)) {
|
|
3639
3660
|
if (flagFreeTicket) {
|
|
3640
3661
|
el.required = false;
|
|
3641
3662
|
return false;
|
|
@@ -3644,14 +3665,14 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3644
3665
|
|
|
3645
3666
|
return true;
|
|
3646
3667
|
}), function (element) {
|
|
3647
|
-
return ['password', 'confirmPassword', 'password-info'].includes(element.name) && isLoggedIn ? null : React__default.createElement(React__default.Fragment, {
|
|
3668
|
+
return ['password', 'confirmPassword', 'password-info'].includes(element.name) && isLoggedIn ? null : ['data_capture[wallet_address]'].includes(element.name) && hideWalletAddressField ? null : React__default.createElement(React__default.Fragment, {
|
|
3648
3669
|
key: element.uniqueId
|
|
3649
3670
|
}, React__default.createElement("div", {
|
|
3650
3671
|
className: element.className + " " + (props == null ? void 0 : props.errors[element.name])
|
|
3651
3672
|
}, element.component ? element.component : React__default.createElement(formik.Field, {
|
|
3652
3673
|
setPhoneValidationIsLoading: element.type === 'phone' ? setPhoneValidationIsLoading : undefined,
|
|
3653
3674
|
name: element.name,
|
|
3654
|
-
label: element.name === 'phone' ? "" + element.label + (flagRequirePhone ? '' : ' (optional)') + " " : element.label,
|
|
3675
|
+
label: element.name === 'phone' ? "" + element.label + (flagRequirePhone ? '' : ' (optional)') + " " : element.name === 'data_capture[wallet_address]' ? "" + element.label + (!collectMandatoryWalletAddress ? ' (optional)' : '') + " " : element.label,
|
|
3655
3676
|
type: element.type,
|
|
3656
3677
|
fill: element.fill,
|
|
3657
3678
|
validate: getValidateFunctions(element, states, props.values, props.errors),
|
|
@@ -4849,6 +4870,51 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4849
4870
|
}))))));
|
|
4850
4871
|
};
|
|
4851
4872
|
|
|
4873
|
+
var style$3 = {
|
|
4874
|
+
position: 'absolute',
|
|
4875
|
+
top: '50%',
|
|
4876
|
+
left: '50%',
|
|
4877
|
+
transform: 'translate(-50%, -50%)',
|
|
4878
|
+
minWidth: 480,
|
|
4879
|
+
backgroundColor: '#e3e3e3',
|
|
4880
|
+
border: '1px solid white',
|
|
4881
|
+
outline: 'none',
|
|
4882
|
+
padding: '14px',
|
|
4883
|
+
maxHeight: '85vh',
|
|
4884
|
+
overflow: 'auto'
|
|
4885
|
+
};
|
|
4886
|
+
|
|
4887
|
+
var ConfirmModal = function ConfirmModal(_ref) {
|
|
4888
|
+
var _ref$message = _ref.message,
|
|
4889
|
+
message = _ref$message === void 0 ? '' : _ref$message,
|
|
4890
|
+
_ref$loading = _ref.loading,
|
|
4891
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
4892
|
+
_ref$hideCancelBtn = _ref.hideCancelBtn,
|
|
4893
|
+
hideCancelBtn = _ref$hideCancelBtn === void 0 ? false : _ref$hideCancelBtn,
|
|
4894
|
+
_ref$onClose = _ref.onClose,
|
|
4895
|
+
onClose = _ref$onClose === void 0 ? _identity : _ref$onClose,
|
|
4896
|
+
_ref$onConfirm = _ref.onConfirm,
|
|
4897
|
+
onConfirm = _ref$onConfirm === void 0 ? _identity : _ref$onConfirm;
|
|
4898
|
+
return React__default.createElement(Modal, {
|
|
4899
|
+
open: true,
|
|
4900
|
+
onClose: onClose,
|
|
4901
|
+
"aria-labelledby": "modal-modal-title",
|
|
4902
|
+
"aria-describedby": "modal-modal-description",
|
|
4903
|
+
className: "confirm-modal"
|
|
4904
|
+
}, React__default.createElement(Box, {
|
|
4905
|
+
style: style$3
|
|
4906
|
+
}, React__default.createElement("p", null, message), React__default.createElement("div", {
|
|
4907
|
+
className: "footer"
|
|
4908
|
+
}, !hideCancelBtn && React__default.createElement(Button, {
|
|
4909
|
+
onClick: onClose,
|
|
4910
|
+
disabled: loading
|
|
4911
|
+
}, "Cancel"), React__default.createElement(Button, {
|
|
4912
|
+
onClick: onConfirm
|
|
4913
|
+
}, loading ? React__default.createElement(CircularProgress, {
|
|
4914
|
+
size: "22px"
|
|
4915
|
+
}) : 'OK'))));
|
|
4916
|
+
};
|
|
4917
|
+
|
|
4852
4918
|
var isTimeExpired = function isTimeExpired(startDate, timezone) {
|
|
4853
4919
|
return !moment(startDate).isAfter(moment.tz(moment(), timezone).format('YYYY-MM-DD HH:mm:ss'));
|
|
4854
4920
|
};
|
|
@@ -5427,7 +5493,11 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5427
5493
|
_ref$enableInfluencer = _ref.enableInfluencersSection,
|
|
5428
5494
|
enableInfluencersSection = _ref$enableInfluencer === void 0 ? true : _ref$enableInfluencer,
|
|
5429
5495
|
_ref$enableAddOns = _ref.enableAddOns,
|
|
5430
|
-
enableAddOns = _ref$enableAddOns === void 0 ? true : _ref$enableAddOns
|
|
5496
|
+
enableAddOns = _ref$enableAddOns === void 0 ? true : _ref$enableAddOns,
|
|
5497
|
+
_ref$handleNotInvited = _ref.handleNotInvitedModalClose,
|
|
5498
|
+
handleNotInvitedModalClose = _ref$handleNotInvited === void 0 ? _identity : _ref$handleNotInvited,
|
|
5499
|
+
_ref$handleInvalidLin = _ref.handleInvalidLinkModalClose,
|
|
5500
|
+
handleInvalidLinkModalClose = _ref$handleInvalidLin === void 0 ? _identity : _ref$handleInvalidLin;
|
|
5431
5501
|
|
|
5432
5502
|
var _useState = React.useState({}),
|
|
5433
5503
|
selectedTickets = _useState[0],
|
|
@@ -5496,6 +5566,14 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5496
5566
|
error = _useState16[0],
|
|
5497
5567
|
setError = _useState16[1];
|
|
5498
5568
|
|
|
5569
|
+
var _useState17 = React.useState(''),
|
|
5570
|
+
isNotInvitedError = _useState17[0],
|
|
5571
|
+
setIsNotInvitedError = _useState17[1];
|
|
5572
|
+
|
|
5573
|
+
var _useState18 = React.useState(''),
|
|
5574
|
+
isInvalidLinkError = _useState18[0],
|
|
5575
|
+
setIsInvalidLinkError = _useState18[1];
|
|
5576
|
+
|
|
5499
5577
|
var ticketsContainerRef = React.useRef(null);
|
|
5500
5578
|
React.useEffect(function () {
|
|
5501
5579
|
if (typeof window !== 'undefined') {
|
|
@@ -5674,7 +5752,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5674
5752
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
5675
5753
|
var _product_options, _product_options2, _ticket_types;
|
|
5676
5754
|
|
|
5677
|
-
var ticket, optionName, ticketId, ticketQuantity, data, result, pageConfigsDataResponse, _pageConfigsData$skip, _pageConfigsData$name, _pageConfigsData$age_, _pageConfigsData$phon, _pageConfigsData$hide, _pageConfigsData$has_, _pageConfigsData$free, pageConfigsData, skipBillingPage, nameIsRequired, ageIsRequired, phoneIsRequired, hidePhoneField, hasAddOn, freeTicket, hash, total, _isWindowDefined, userData, access_token, checkoutBody, checkoutResult;
|
|
5755
|
+
var ticket, optionName, ticketId, ticketQuantity, data, result, pageConfigsDataResponse, _pageConfigsData$skip, _pageConfigsData$name, _pageConfigsData$age_, _pageConfigsData$phon, _pageConfigsData$hide, _pageConfigsData$has_, _pageConfigsData$free, _pageConfigsData$coll, _pageConfigsData$coll2, pageConfigsData, skipBillingPage, nameIsRequired, ageIsRequired, phoneIsRequired, hidePhoneField, hasAddOn, freeTicket, collectOptionalWalletAddress, collectMandatoryWalletAddress, hash, total, _isWindowDefined, userData, access_token, checkoutBody, checkoutResult, message, _isInvalidLinkError, _isNotInvitedError;
|
|
5678
5756
|
|
|
5679
5757
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
5680
5758
|
while (1) {
|
|
@@ -5731,7 +5809,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5731
5809
|
pageConfigsDataResponse = _context2.t0;
|
|
5732
5810
|
|
|
5733
5811
|
if (!(result.status === 200 && pageConfigsDataResponse.status === 200)) {
|
|
5734
|
-
_context2.next =
|
|
5812
|
+
_context2.next = 48;
|
|
5735
5813
|
break;
|
|
5736
5814
|
}
|
|
5737
5815
|
|
|
@@ -5743,13 +5821,15 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5743
5821
|
hidePhoneField = (_pageConfigsData$hide = pageConfigsData.hide_phone_field) != null ? _pageConfigsData$hide : false;
|
|
5744
5822
|
hasAddOn = (_pageConfigsData$has_ = pageConfigsData.has_add_on) != null ? _pageConfigsData$has_ : false;
|
|
5745
5823
|
freeTicket = (_pageConfigsData$free = pageConfigsData.free_ticket) != null ? _pageConfigsData$free : false;
|
|
5824
|
+
collectOptionalWalletAddress = (_pageConfigsData$coll = pageConfigsData.collect_optional_wallet_address) != null ? _pageConfigsData$coll : false;
|
|
5825
|
+
collectMandatoryWalletAddress = (_pageConfigsData$coll2 = pageConfigsData.collect_mandatory_wallet_address) != null ? _pageConfigsData$coll2 : false;
|
|
5746
5826
|
hash = '';
|
|
5747
5827
|
total = '';
|
|
5748
5828
|
_isWindowDefined = typeof window !== 'undefined';
|
|
5749
5829
|
_isWindowDefined && window.localStorage.removeItem('add_ons');
|
|
5750
5830
|
|
|
5751
5831
|
if (!(skipBillingPage && !hasAddOn)) {
|
|
5752
|
-
_context2.next =
|
|
5832
|
+
_context2.next = 47;
|
|
5753
5833
|
break;
|
|
5754
5834
|
}
|
|
5755
5835
|
|
|
@@ -5759,27 +5839,27 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5759
5839
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
5760
5840
|
|
|
5761
5841
|
if (!enableBillingInfoAutoCreate) {
|
|
5762
|
-
_context2.next =
|
|
5842
|
+
_context2.next = 43;
|
|
5763
5843
|
break;
|
|
5764
5844
|
}
|
|
5765
5845
|
|
|
5766
|
-
_context2.next =
|
|
5846
|
+
_context2.next = 40;
|
|
5767
5847
|
return postOnCheckout(checkoutBody, access_token);
|
|
5768
5848
|
|
|
5769
|
-
case
|
|
5849
|
+
case 40:
|
|
5770
5850
|
_context2.t1 = _context2.sent;
|
|
5771
|
-
_context2.next =
|
|
5851
|
+
_context2.next = 44;
|
|
5772
5852
|
break;
|
|
5773
5853
|
|
|
5774
|
-
case
|
|
5854
|
+
case 43:
|
|
5775
5855
|
_context2.t1 = null;
|
|
5776
5856
|
|
|
5777
|
-
case
|
|
5857
|
+
case 44:
|
|
5778
5858
|
checkoutResult = _context2.t1;
|
|
5779
5859
|
hash = _get(checkoutResult, 'data.data.attributes.hash');
|
|
5780
5860
|
total = _get(checkoutResult, 'data.data.attributes.total');
|
|
5781
5861
|
|
|
5782
|
-
case
|
|
5862
|
+
case 47:
|
|
5783
5863
|
onAddToCartSuccess({
|
|
5784
5864
|
skip_billing_page: skipBillingPage,
|
|
5785
5865
|
names_required: nameIsRequired,
|
|
@@ -5787,36 +5867,48 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5787
5867
|
age_required: ageIsRequired,
|
|
5788
5868
|
hide_phone_field: hidePhoneField,
|
|
5789
5869
|
free_ticket: freeTicket,
|
|
5870
|
+
collect_optional_wallet_address: collectOptionalWalletAddress,
|
|
5871
|
+
collect_mandatory_wallet_address: collectMandatoryWalletAddress,
|
|
5790
5872
|
event_id: String(eventId),
|
|
5791
5873
|
hash: hash,
|
|
5792
5874
|
total: total,
|
|
5793
5875
|
hasAddOn: hasAddOn
|
|
5794
5876
|
});
|
|
5795
5877
|
|
|
5796
|
-
case
|
|
5797
|
-
_context2.next =
|
|
5878
|
+
case 48:
|
|
5879
|
+
_context2.next = 53;
|
|
5798
5880
|
break;
|
|
5799
5881
|
|
|
5800
|
-
case
|
|
5801
|
-
_context2.prev =
|
|
5882
|
+
case 50:
|
|
5883
|
+
_context2.prev = 50;
|
|
5802
5884
|
_context2.t2 = _context2["catch"](6);
|
|
5803
5885
|
|
|
5804
5886
|
if (axios.isAxiosError(_context2.t2)) {
|
|
5805
5887
|
onAddToCartError(_context2.t2);
|
|
5806
|
-
|
|
5888
|
+
message = _get(_context2.t2, 'response.data.message', '');
|
|
5889
|
+
_isInvalidLinkError = _includes(message, 'No more of this ticket type are available right now');
|
|
5890
|
+
_isNotInvitedError = _includes(message, 'You must have been invited to this event to attend');
|
|
5891
|
+
|
|
5892
|
+
if (_isInvalidLinkError) {
|
|
5893
|
+
setIsInvalidLinkError(message);
|
|
5894
|
+
} else if (_isNotInvitedError) {
|
|
5895
|
+
setIsNotInvitedError(message);
|
|
5896
|
+
} else {
|
|
5897
|
+
setError(message);
|
|
5898
|
+
}
|
|
5807
5899
|
}
|
|
5808
5900
|
|
|
5809
|
-
case
|
|
5810
|
-
_context2.prev =
|
|
5901
|
+
case 53:
|
|
5902
|
+
_context2.prev = 53;
|
|
5811
5903
|
setHandleBookIsLoading(false);
|
|
5812
|
-
return _context2.finish(
|
|
5904
|
+
return _context2.finish(53);
|
|
5813
5905
|
|
|
5814
|
-
case
|
|
5906
|
+
case 56:
|
|
5815
5907
|
case "end":
|
|
5816
5908
|
return _context2.stop();
|
|
5817
5909
|
}
|
|
5818
5910
|
}
|
|
5819
|
-
}, _callee2, null, [[6,
|
|
5911
|
+
}, _callee2, null, [[6, 50, 53, 56]]);
|
|
5820
5912
|
}));
|
|
5821
5913
|
|
|
5822
5914
|
return function handleBook() {
|
|
@@ -5882,6 +5974,17 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5882
5974
|
return false;
|
|
5883
5975
|
};
|
|
5884
5976
|
|
|
5977
|
+
var _onClose = function onClose(value) {
|
|
5978
|
+
if (value === 'notInvited') {
|
|
5979
|
+
handleNotInvitedModalClose();
|
|
5980
|
+
} else if (value === 'invalidLink') {
|
|
5981
|
+
handleInvalidLinkModalClose();
|
|
5982
|
+
}
|
|
5983
|
+
|
|
5984
|
+
setIsNotInvitedError('');
|
|
5985
|
+
setIsInvalidLinkError('');
|
|
5986
|
+
};
|
|
5987
|
+
|
|
5885
5988
|
return React__default.createElement(privateTheming.ThemeProvider, {
|
|
5886
5989
|
theme: themeMui
|
|
5887
5990
|
}, !isLoading && React__default.createElement(ReferralLogic, {
|
|
@@ -5889,7 +5992,25 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5889
5992
|
}), React__default.createElement("div", {
|
|
5890
5993
|
className: "get-tickets-page " + theme,
|
|
5891
5994
|
style: contentStyle
|
|
5892
|
-
},
|
|
5995
|
+
}, isInvalidLinkError && React__default.createElement(ConfirmModal, {
|
|
5996
|
+
message: isInvalidLinkError,
|
|
5997
|
+
hideCancelBtn: true,
|
|
5998
|
+
onClose: function onClose() {
|
|
5999
|
+
return _onClose('invalidLink');
|
|
6000
|
+
},
|
|
6001
|
+
onConfirm: function onConfirm() {
|
|
6002
|
+
return _onClose('invalidLink');
|
|
6003
|
+
}
|
|
6004
|
+
}), isNotInvitedError && React__default.createElement(ConfirmModal, {
|
|
6005
|
+
hideCancelBtn: true,
|
|
6006
|
+
message: isNotInvitedError,
|
|
6007
|
+
onClose: function onClose() {
|
|
6008
|
+
return _onClose('notInvited');
|
|
6009
|
+
},
|
|
6010
|
+
onConfirm: function onConfirm() {
|
|
6011
|
+
return _onClose('notInvited');
|
|
6012
|
+
}
|
|
6013
|
+
}), error && React__default.createElement(Alert, {
|
|
5893
6014
|
severity: "error",
|
|
5894
6015
|
onClose: onErrorClose,
|
|
5895
6016
|
variant: "filled",
|
|
@@ -6217,49 +6338,6 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
6217
6338
|
})));
|
|
6218
6339
|
};
|
|
6219
6340
|
|
|
6220
|
-
var style$3 = {
|
|
6221
|
-
position: 'absolute',
|
|
6222
|
-
top: '50%',
|
|
6223
|
-
left: '50%',
|
|
6224
|
-
transform: 'translate(-50%, -50%)',
|
|
6225
|
-
minWidth: 480,
|
|
6226
|
-
backgroundColor: '#e3e3e3',
|
|
6227
|
-
border: '1px solid white',
|
|
6228
|
-
outline: 'none',
|
|
6229
|
-
padding: '14px',
|
|
6230
|
-
maxHeight: '85vh',
|
|
6231
|
-
overflow: 'auto'
|
|
6232
|
-
};
|
|
6233
|
-
|
|
6234
|
-
var ConfirmModal = function ConfirmModal(_ref) {
|
|
6235
|
-
var _ref$message = _ref.message,
|
|
6236
|
-
message = _ref$message === void 0 ? '' : _ref$message,
|
|
6237
|
-
_ref$loading = _ref.loading,
|
|
6238
|
-
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
6239
|
-
_ref$onClose = _ref.onClose,
|
|
6240
|
-
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
6241
|
-
_ref$onConfirm = _ref.onConfirm,
|
|
6242
|
-
onConfirm = _ref$onConfirm === void 0 ? function () {} : _ref$onConfirm;
|
|
6243
|
-
return React__default.createElement(Modal, {
|
|
6244
|
-
open: true,
|
|
6245
|
-
onClose: onClose,
|
|
6246
|
-
"aria-labelledby": "modal-modal-title",
|
|
6247
|
-
"aria-describedby": "modal-modal-description",
|
|
6248
|
-
className: 'confirm-modal'
|
|
6249
|
-
}, React__default.createElement(Box, {
|
|
6250
|
-
style: style$3
|
|
6251
|
-
}, React__default.createElement("p", null, message), React__default.createElement("div", {
|
|
6252
|
-
className: 'footer'
|
|
6253
|
-
}, React__default.createElement(Button, {
|
|
6254
|
-
onClick: onClose,
|
|
6255
|
-
disabled: loading
|
|
6256
|
-
}, "Cancel"), React__default.createElement(Button, {
|
|
6257
|
-
onClick: onConfirm
|
|
6258
|
-
}, loading ? React__default.createElement(CircularProgress, {
|
|
6259
|
-
size: "22px"
|
|
6260
|
-
}) : 'OK'))));
|
|
6261
|
-
};
|
|
6262
|
-
|
|
6263
6341
|
var _excluded$2 = ["label", "field", "theme", "disableDropdown"];
|
|
6264
6342
|
var RadioField = function RadioField(_ref) {
|
|
6265
6343
|
var label = _ref.label,
|