tf-checkout-react 1.0.63 → 1.0.67
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/api/index.d.ts +1 -1
- package/dist/components/billing-info-container/index.d.ts +2 -1
- package/dist/components/common/FormikPhoneNumberField.d.ts +11 -0
- package/dist/components/myTicketsContainer/index.d.ts +2 -1
- package/dist/components/orderDetailsContainer/index.d.ts +1 -1
- package/dist/components/paymentContainer/index.d.ts +2 -1
- package/dist/normalizers/index.d.ts +1 -0
- package/dist/tf-checkout-react.cjs.development.js +207 -128
- 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 +208 -129
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/package.json +3 -3
- package/src/api/index.ts +12 -8
- package/src/components/billing-info-container/index.tsx +29 -4
- package/src/components/common/CustomField.tsx +10 -25
- package/src/components/common/FormikPhoneNumberField.tsx +41 -0
- package/src/components/common/SelectField.tsx +0 -13
- package/src/components/myTicketsContainer/index.tsx +22 -10
- package/src/components/orderDetailsContainer/index.tsx +63 -29
- package/src/components/orderDetailsContainer/style.css +27 -8
- package/src/components/paymentContainer/index.tsx +58 -45
- package/src/components/ticketsContainer/TicketRow.tsx +3 -0
- package/src/normalizers/index.ts +3 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, Component, useEffect, useRef, Fragment } from 'react';
|
|
1
|
+
import React, { useState, Component, useCallback, useEffect, useRef, Fragment } from 'react';
|
|
2
2
|
import { Formik, Form, Field, connect } from 'formik';
|
|
3
3
|
import LoadingButton from '@mui/lab/LoadingButton';
|
|
4
4
|
import _identity from 'lodash-es/identity';
|
|
@@ -14,11 +14,12 @@ import _flatMapDeep from 'lodash-es/flatMapDeep';
|
|
|
14
14
|
import _isArray from 'lodash-es/isArray';
|
|
15
15
|
import { nanoid } from 'nanoid';
|
|
16
16
|
import TextField$1 from '@mui/material/TextField';
|
|
17
|
-
import { makeStyles } from '@mui/styles';
|
|
18
17
|
import FormGroup from '@mui/material/FormGroup';
|
|
19
18
|
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
20
19
|
import Checkbox from '@mui/material/Checkbox';
|
|
21
20
|
import Select from '@mui/material/Select';
|
|
21
|
+
import MuiPhoneNumber from 'material-ui-phone-number';
|
|
22
|
+
import { createTheme, ThemeProvider } from '@mui/material/styles';
|
|
22
23
|
import Container from '@mui/material/Container';
|
|
23
24
|
import Alert from '@mui/material/Alert';
|
|
24
25
|
import { useStripe, useElements, CardNumberElement, CardExpiryElement, CardCvcElement, Elements } from '@stripe/react-stripe-js';
|
|
@@ -927,6 +928,8 @@ var ENV = {
|
|
|
927
928
|
};
|
|
928
929
|
|
|
929
930
|
var isWindowDefined = typeof window !== 'undefined';
|
|
931
|
+
var allowedOrigins = ['http://localhost', 'gtsb.io', 'gatsbyjs.io', 'https://www.houseofx.nyc', 'https://tickets-staging.houseofx.nyc'];
|
|
932
|
+
var origin = isWindowDefined && window.location.origin;
|
|
930
933
|
var ttfHeaders = {
|
|
931
934
|
Accept: 'application/vnd.api+json',
|
|
932
935
|
'Content-Type': 'application/vnd.api+json'
|
|
@@ -936,7 +939,9 @@ if (isWindowDefined && localStorage.getItem('auth_guest_token')) {
|
|
|
936
939
|
ttfHeaders['Authorization-Guest'] = /*#__PURE__*/localStorage.getItem('auth_guest_token');
|
|
937
940
|
}
|
|
938
941
|
|
|
939
|
-
if (isWindowDefined &&
|
|
942
|
+
if (isWindowDefined && !allowedOrigins.some(function (el) {
|
|
943
|
+
return origin && origin.includes(el);
|
|
944
|
+
})) {
|
|
940
945
|
ttfHeaders['X-Source-Origin'] = 'houseofx.nyc';
|
|
941
946
|
}
|
|
942
947
|
|
|
@@ -982,7 +987,9 @@ publicRequest.interceptors.request.use(function (config) {
|
|
|
982
987
|
config.headers = _updatedHeaders;
|
|
983
988
|
}
|
|
984
989
|
|
|
985
|
-
if (isWindowDefined &&
|
|
990
|
+
if (isWindowDefined && !allowedOrigins.some(function (el) {
|
|
991
|
+
return origin && origin.includes(el);
|
|
992
|
+
})) {
|
|
986
993
|
var _updatedHeaders2 = _extends({}, config.headers, {
|
|
987
994
|
'X-Source-Origin': 'houseofx.nyc'
|
|
988
995
|
});
|
|
@@ -1080,6 +1087,13 @@ var getProfileData = function getProfileData(accessToken) {
|
|
|
1080
1087
|
headers: _extends({}, ttfHeaders, {
|
|
1081
1088
|
Authorization: "Bearer " + accessToken
|
|
1082
1089
|
})
|
|
1090
|
+
})["catch"](function (e) {
|
|
1091
|
+
if (isWindowDefined) {
|
|
1092
|
+
var event = new window.CustomEvent('auth_error', e);
|
|
1093
|
+
window.document.dispatchEvent(event);
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
return e;
|
|
1083
1097
|
});
|
|
1084
1098
|
};
|
|
1085
1099
|
var getCountries = function getCountries() {
|
|
@@ -1682,13 +1696,6 @@ var assingUniqueIds = function assingUniqueIds(data) {
|
|
|
1682
1696
|
});
|
|
1683
1697
|
};
|
|
1684
1698
|
|
|
1685
|
-
var useStyles = /*#__PURE__*/makeStyles({
|
|
1686
|
-
input: {
|
|
1687
|
-
'&::placeholder': {
|
|
1688
|
-
color: 'gray'
|
|
1689
|
-
}
|
|
1690
|
-
}
|
|
1691
|
-
});
|
|
1692
1699
|
var CustomField = function CustomField(_ref) {
|
|
1693
1700
|
var label = _ref.label,
|
|
1694
1701
|
_ref$type = _ref.type,
|
|
@@ -1706,7 +1713,6 @@ var CustomField = function CustomField(_ref) {
|
|
|
1706
1713
|
var error = _get(errors, field.name);
|
|
1707
1714
|
|
|
1708
1715
|
var isTouched = Boolean(_get(touched, field.name)) || _includes(field.name, 'holder') && !!error && !!submitCount;
|
|
1709
|
-
var classes = useStyles();
|
|
1710
1716
|
return React.createElement(TextField$1, Object.assign({
|
|
1711
1717
|
id: field.name,
|
|
1712
1718
|
label: label,
|
|
@@ -1715,11 +1721,6 @@ var CustomField = function CustomField(_ref) {
|
|
|
1715
1721
|
fullWidth: true,
|
|
1716
1722
|
error: !!error && isTouched,
|
|
1717
1723
|
helperText: isTouched && error,
|
|
1718
|
-
InputProps: {
|
|
1719
|
-
classes: {
|
|
1720
|
-
input: classes.input
|
|
1721
|
-
}
|
|
1722
|
-
},
|
|
1723
1724
|
SelectProps: {
|
|
1724
1725
|
"native": true,
|
|
1725
1726
|
className: theme,
|
|
@@ -1765,13 +1766,6 @@ var getQueryVariable = function getQueryVariable(variable) {
|
|
|
1765
1766
|
return false;
|
|
1766
1767
|
};
|
|
1767
1768
|
|
|
1768
|
-
var useStyles$1 = /*#__PURE__*/makeStyles({
|
|
1769
|
-
input: {
|
|
1770
|
-
'&::placeholder': {
|
|
1771
|
-
color: 'gray'
|
|
1772
|
-
}
|
|
1773
|
-
}
|
|
1774
|
-
});
|
|
1775
1769
|
var SelectField = function SelectField(_ref) {
|
|
1776
1770
|
var label = _ref.label,
|
|
1777
1771
|
_ref$type = _ref.type,
|
|
@@ -1787,7 +1781,6 @@ var SelectField = function SelectField(_ref) {
|
|
|
1787
1781
|
|
|
1788
1782
|
var error = _get(errors, field.name);
|
|
1789
1783
|
|
|
1790
|
-
var classes = useStyles$1();
|
|
1791
1784
|
return React.createElement(FormControl, {
|
|
1792
1785
|
fullWidth: true
|
|
1793
1786
|
}, React.createElement(InputLabel, {
|
|
@@ -1801,10 +1794,7 @@ var SelectField = function SelectField(_ref) {
|
|
|
1801
1794
|
fullWidth: true,
|
|
1802
1795
|
error: !!error && isTouched,
|
|
1803
1796
|
inputProps: {
|
|
1804
|
-
id: field.name
|
|
1805
|
-
classes: {
|
|
1806
|
-
input: classes.input
|
|
1807
|
-
}
|
|
1797
|
+
id: field.name
|
|
1808
1798
|
},
|
|
1809
1799
|
"native": true,
|
|
1810
1800
|
className: theme,
|
|
@@ -1861,6 +1851,109 @@ var ErrorFocusInternal = /*#__PURE__*/function (_Component) {
|
|
|
1861
1851
|
|
|
1862
1852
|
var ErrorFocus = /*#__PURE__*/connect(ErrorFocusInternal);
|
|
1863
1853
|
|
|
1854
|
+
var currencyNormalizerCreator = function currencyNormalizerCreator(value, currency) {
|
|
1855
|
+
return !value ? '' : "" + getCurrencySymbolByCurrency(currency) + value;
|
|
1856
|
+
};
|
|
1857
|
+
var createFixedFloatNormalizer = function createFixedFloatNormalizer(fixedValue) {
|
|
1858
|
+
return function (value) {
|
|
1859
|
+
return value || "" + value === '0' ? (+value).toFixed(fixedValue) : '';
|
|
1860
|
+
};
|
|
1861
|
+
};
|
|
1862
|
+
var getCurrencySymbolByCurrency = function getCurrencySymbolByCurrency(currency) {
|
|
1863
|
+
if (currency === void 0) {
|
|
1864
|
+
currency = '';
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
switch (currency) {
|
|
1868
|
+
case 'GBP':
|
|
1869
|
+
return '£';
|
|
1870
|
+
|
|
1871
|
+
case 'EUR':
|
|
1872
|
+
return '€';
|
|
1873
|
+
|
|
1874
|
+
case 'INR':
|
|
1875
|
+
return '₹';
|
|
1876
|
+
|
|
1877
|
+
case 'JMD':
|
|
1878
|
+
return 'J$';
|
|
1879
|
+
|
|
1880
|
+
case 'NZD':
|
|
1881
|
+
return 'NZ$';
|
|
1882
|
+
|
|
1883
|
+
case 'MYR':
|
|
1884
|
+
return 'RM';
|
|
1885
|
+
|
|
1886
|
+
case 'MXN':
|
|
1887
|
+
return 'Mex$';
|
|
1888
|
+
|
|
1889
|
+
case 'SGD':
|
|
1890
|
+
return 'S$';
|
|
1891
|
+
|
|
1892
|
+
case 'AUD':
|
|
1893
|
+
return 'A$';
|
|
1894
|
+
|
|
1895
|
+
case 'ZAR':
|
|
1896
|
+
return 'R';
|
|
1897
|
+
|
|
1898
|
+
case 'ke':
|
|
1899
|
+
return 'Ksh';
|
|
1900
|
+
|
|
1901
|
+
case 'TRY':
|
|
1902
|
+
return '₺';
|
|
1903
|
+
|
|
1904
|
+
case 'CAD':
|
|
1905
|
+
return 'CA$';
|
|
1906
|
+
|
|
1907
|
+
case 'THB':
|
|
1908
|
+
return '฿';
|
|
1909
|
+
|
|
1910
|
+
case 'ISK':
|
|
1911
|
+
return 'Kr';
|
|
1912
|
+
|
|
1913
|
+
case 'SEK':
|
|
1914
|
+
return 'kr';
|
|
1915
|
+
|
|
1916
|
+
default:
|
|
1917
|
+
return 'US$';
|
|
1918
|
+
}
|
|
1919
|
+
};
|
|
1920
|
+
var removePlusSign = function removePlusSign(string) {
|
|
1921
|
+
if (string === void 0) {
|
|
1922
|
+
string = '';
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
return string.replace('+', '');
|
|
1926
|
+
};
|
|
1927
|
+
|
|
1928
|
+
var _excluded$2 = ["label", "field", "form", "setFieldValue"];
|
|
1929
|
+
var FormikPhoneNumberField = function FormikPhoneNumberField(_ref) {
|
|
1930
|
+
var label = _ref.label,
|
|
1931
|
+
field = _ref.field,
|
|
1932
|
+
_ref$form = _ref.form,
|
|
1933
|
+
touched = _ref$form.touched,
|
|
1934
|
+
errors = _ref$form.errors,
|
|
1935
|
+
setFieldValue = _ref.setFieldValue,
|
|
1936
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
1937
|
+
|
|
1938
|
+
var error = _get(errors, field.name);
|
|
1939
|
+
|
|
1940
|
+
var isTouched = Boolean(_get(touched, field.name));
|
|
1941
|
+
return React.createElement(MuiPhoneNumber, Object.assign({
|
|
1942
|
+
name: 'phone',
|
|
1943
|
+
onChange: function onChange(e) {
|
|
1944
|
+
return setFieldValue("phone", removePlusSign(e));
|
|
1945
|
+
},
|
|
1946
|
+
variant: "outlined",
|
|
1947
|
+
defaultCountry: 'us',
|
|
1948
|
+
disableDropdown: true,
|
|
1949
|
+
label: label,
|
|
1950
|
+
error: !!error && isTouched,
|
|
1951
|
+
helperText: isTouched && error,
|
|
1952
|
+
fullWidth: true,
|
|
1953
|
+
autoFormat: false
|
|
1954
|
+
}, rest));
|
|
1955
|
+
};
|
|
1956
|
+
|
|
1864
1957
|
var getImage = function getImage(name) {
|
|
1865
1958
|
if (name === void 0) {
|
|
1866
1959
|
name = '';
|
|
@@ -2025,7 +2118,15 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2025
2118
|
_ref3$onLoginSuccess = _ref3.onLoginSuccess,
|
|
2026
2119
|
onLoginSuccess = _ref3$onLoginSuccess === void 0 ? function () {} : _ref3$onLoginSuccess,
|
|
2027
2120
|
_ref3$isLoggedIn = _ref3.isLoggedIn,
|
|
2028
|
-
pIsLoggedIn = _ref3$isLoggedIn === void 0 ? false : _ref3$isLoggedIn
|
|
2121
|
+
pIsLoggedIn = _ref3$isLoggedIn === void 0 ? false : _ref3$isLoggedIn,
|
|
2122
|
+
fontFamily = _ref3.fontFamily;
|
|
2123
|
+
var themeMui = createTheme({
|
|
2124
|
+
typography: {
|
|
2125
|
+
allVariants: {
|
|
2126
|
+
fontFamily: fontFamily
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
});
|
|
2029
2130
|
var isWindowDefined = typeof window !== 'undefined';
|
|
2030
2131
|
var userData = isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
2031
2132
|
var access_token = isWindowDefined && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
@@ -2117,6 +2218,15 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2117
2218
|
return qty;
|
|
2118
2219
|
};
|
|
2119
2220
|
|
|
2221
|
+
var handleAuthErrors = useCallback(function () {
|
|
2222
|
+
setIsLoggedIn(false);
|
|
2223
|
+
}, []);
|
|
2224
|
+
useEffect(function () {
|
|
2225
|
+
isWindowDefined && window.document.addEventListener("auth_error", handleAuthErrors);
|
|
2226
|
+
return function () {
|
|
2227
|
+
isWindowDefined && window.document.removeEventListener("auth_error", handleAuthErrors);
|
|
2228
|
+
};
|
|
2229
|
+
}, [handleAuthErrors]);
|
|
2120
2230
|
useEffect(function () {
|
|
2121
2231
|
if ((pIsLoggedIn || access_token) && !isLoggedIn) {
|
|
2122
2232
|
setIsLoggedIn(true);
|
|
@@ -2274,9 +2384,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2274
2384
|
useEffect(function () {
|
|
2275
2385
|
fetchUserData(access_token);
|
|
2276
2386
|
}, [access_token]);
|
|
2277
|
-
return React.createElement(
|
|
2387
|
+
return React.createElement(ThemeProvider, {
|
|
2388
|
+
theme: themeMui
|
|
2389
|
+
}, React.createElement(Formik, {
|
|
2278
2390
|
initialValues: getInitialValues(dataWithUniqueIds, _extends({}, initialValues, {
|
|
2279
|
-
email: emailLogged,
|
|
2280
2391
|
firstName: firstNameLogged,
|
|
2281
2392
|
lastName: lastNameLogged,
|
|
2282
2393
|
country: 1,
|
|
@@ -2504,7 +2615,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2504
2615
|
label: element.label,
|
|
2505
2616
|
type: element.type,
|
|
2506
2617
|
validate: getValidateFunctions(element, states),
|
|
2507
|
-
|
|
2618
|
+
setFieldValue: props.setFieldValue,
|
|
2619
|
+
onBlur: props.handleBlur,
|
|
2620
|
+
component: element.type === 'checkbox' ? CheckboxField : element.type === 'select' ? SelectField : element.type === 'phone' ? FormikPhoneNumberField : CustomField,
|
|
2508
2621
|
selectOptions: element.name === 'country' ? countries : element.name === 'state' ? states : [],
|
|
2509
2622
|
theme: theme
|
|
2510
2623
|
})));
|
|
@@ -2576,73 +2689,6 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2576
2689
|
}));
|
|
2577
2690
|
};
|
|
2578
2691
|
|
|
2579
|
-
var currencyNormalizerCreator = function currencyNormalizerCreator(value, currency) {
|
|
2580
|
-
return !value ? '' : "" + getCurrencySymbolByCurrency(currency) + value;
|
|
2581
|
-
};
|
|
2582
|
-
var createFixedFloatNormalizer = function createFixedFloatNormalizer(fixedValue) {
|
|
2583
|
-
return function (value) {
|
|
2584
|
-
return value || "" + value === '0' ? (+value).toFixed(fixedValue) : '';
|
|
2585
|
-
};
|
|
2586
|
-
};
|
|
2587
|
-
var getCurrencySymbolByCurrency = function getCurrencySymbolByCurrency(currency) {
|
|
2588
|
-
if (currency === void 0) {
|
|
2589
|
-
currency = '';
|
|
2590
|
-
}
|
|
2591
|
-
|
|
2592
|
-
switch (currency) {
|
|
2593
|
-
case 'GBP':
|
|
2594
|
-
return '£';
|
|
2595
|
-
|
|
2596
|
-
case 'EUR':
|
|
2597
|
-
return '€';
|
|
2598
|
-
|
|
2599
|
-
case 'INR':
|
|
2600
|
-
return '₹';
|
|
2601
|
-
|
|
2602
|
-
case 'JMD':
|
|
2603
|
-
return 'J$';
|
|
2604
|
-
|
|
2605
|
-
case 'NZD':
|
|
2606
|
-
return 'NZ$';
|
|
2607
|
-
|
|
2608
|
-
case 'MYR':
|
|
2609
|
-
return 'RM';
|
|
2610
|
-
|
|
2611
|
-
case 'MXN':
|
|
2612
|
-
return 'Mex$';
|
|
2613
|
-
|
|
2614
|
-
case 'SGD':
|
|
2615
|
-
return 'S$';
|
|
2616
|
-
|
|
2617
|
-
case 'AUD':
|
|
2618
|
-
return 'A$';
|
|
2619
|
-
|
|
2620
|
-
case 'ZAR':
|
|
2621
|
-
return 'R';
|
|
2622
|
-
|
|
2623
|
-
case 'ke':
|
|
2624
|
-
return 'Ksh';
|
|
2625
|
-
|
|
2626
|
-
case 'TRY':
|
|
2627
|
-
return '₺';
|
|
2628
|
-
|
|
2629
|
-
case 'CAD':
|
|
2630
|
-
return 'CA$';
|
|
2631
|
-
|
|
2632
|
-
case 'THB':
|
|
2633
|
-
return '฿';
|
|
2634
|
-
|
|
2635
|
-
case 'ISK':
|
|
2636
|
-
return 'Kr';
|
|
2637
|
-
|
|
2638
|
-
case 'SEK':
|
|
2639
|
-
return 'kr';
|
|
2640
|
-
|
|
2641
|
-
default:
|
|
2642
|
-
return 'US$';
|
|
2643
|
-
}
|
|
2644
|
-
};
|
|
2645
|
-
|
|
2646
2692
|
var options = {
|
|
2647
2693
|
style: {
|
|
2648
2694
|
base: {
|
|
@@ -2939,7 +2985,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
2939
2985
|
_ref$onPaymentError = _ref.onPaymentError,
|
|
2940
2986
|
onPaymentError = _ref$onPaymentError === void 0 ? function () {} : _ref$onPaymentError,
|
|
2941
2987
|
_ref$stripeCardOption = _ref.stripeCardOptions,
|
|
2942
|
-
stripeCardOptions = _ref$stripeCardOption === void 0 ? {} : _ref$stripeCardOption
|
|
2988
|
+
stripeCardOptions = _ref$stripeCardOption === void 0 ? {} : _ref$stripeCardOption,
|
|
2989
|
+
fontFamily = _ref.fontFamily;
|
|
2943
2990
|
|
|
2944
2991
|
var _useState = useState(initialReviewValues),
|
|
2945
2992
|
reviewData = _useState[0],
|
|
@@ -3114,7 +3161,16 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3114
3161
|
};
|
|
3115
3162
|
}();
|
|
3116
3163
|
|
|
3117
|
-
|
|
3164
|
+
var themeMui = createTheme({
|
|
3165
|
+
typography: {
|
|
3166
|
+
allVariants: {
|
|
3167
|
+
fontFamily: fontFamily
|
|
3168
|
+
}
|
|
3169
|
+
}
|
|
3170
|
+
});
|
|
3171
|
+
return React.createElement(ThemeProvider, {
|
|
3172
|
+
theme: themeMui
|
|
3173
|
+
}, React.createElement("div", {
|
|
3118
3174
|
className: "payment_page"
|
|
3119
3175
|
}, error && React.createElement(Alert, {
|
|
3120
3176
|
severity: "error",
|
|
@@ -3162,7 +3218,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3162
3218
|
},
|
|
3163
3219
|
conditions: conditions,
|
|
3164
3220
|
stripeCardOptions: stripeCardOptions
|
|
3165
|
-
}))))));
|
|
3221
|
+
})))))));
|
|
3166
3222
|
};
|
|
3167
3223
|
|
|
3168
3224
|
var defaultSvg = 'https://img.icons8.com/ios-filled/50/000000/facebook-new.svg';
|
|
@@ -3373,6 +3429,9 @@ var TicketRow = function TicketRow(_ref) {
|
|
|
3373
3429
|
}, React.createElement(FormControl$1, {
|
|
3374
3430
|
fullWidth: true
|
|
3375
3431
|
}, React.createElement(Select, {
|
|
3432
|
+
sx: {
|
|
3433
|
+
borderRadius: 0
|
|
3434
|
+
},
|
|
3376
3435
|
value: selectedTickets[ticketTier.id] ? selectedTickets[ticketTier.id] : 0,
|
|
3377
3436
|
onChange: handleTicketSelect,
|
|
3378
3437
|
displayEmpty: true,
|
|
@@ -3967,7 +4026,9 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
3967
4026
|
_ref$onGetOrdersSucce = _ref.onGetOrdersSuccess,
|
|
3968
4027
|
onGetOrdersSuccess = _ref$onGetOrdersSucce === void 0 ? function () {} : _ref$onGetOrdersSucce,
|
|
3969
4028
|
_ref$onGetOrdersError = _ref.onGetOrdersError,
|
|
3970
|
-
onGetOrdersError = _ref$onGetOrdersError === void 0 ? function () {} : _ref$onGetOrdersError
|
|
4029
|
+
onGetOrdersError = _ref$onGetOrdersError === void 0 ? function () {} : _ref$onGetOrdersError,
|
|
4030
|
+
_ref$theme = _ref.theme,
|
|
4031
|
+
theme = _ref$theme === void 0 ? 'dark' : _ref$theme;
|
|
3971
4032
|
|
|
3972
4033
|
var _useState = useState(null),
|
|
3973
4034
|
data = _useState[0],
|
|
@@ -4050,9 +4111,9 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
4050
4111
|
};
|
|
4051
4112
|
|
|
4052
4113
|
return React.createElement("div", {
|
|
4053
|
-
className:
|
|
4114
|
+
className: "my-ticket " + theme
|
|
4054
4115
|
}, loading && React.createElement("div", {
|
|
4055
|
-
className:
|
|
4116
|
+
className: "loading"
|
|
4056
4117
|
}, React.createElement(CircularProgress$1, null)), data && React.createElement(React.Fragment, null, React.createElement(Autocomplete, {
|
|
4057
4118
|
disablePortal: true,
|
|
4058
4119
|
id: "combo-box-demo",
|
|
@@ -4071,7 +4132,7 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
4071
4132
|
}
|
|
4072
4133
|
}), React.createElement(TableContainer, {
|
|
4073
4134
|
component: Paper,
|
|
4074
|
-
className:
|
|
4135
|
+
className: "my-ticket-table"
|
|
4075
4136
|
}, React.createElement(Table, {
|
|
4076
4137
|
"aria-label": "collapsible table"
|
|
4077
4138
|
}, React.createElement(TableHead, null, React.createElement(TableRow, null, tableConfig().header.map(function (column, index) {
|
|
@@ -4140,7 +4201,7 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
4140
4201
|
_ref$onGetOrdersError = _ref.onGetOrdersError,
|
|
4141
4202
|
onGetOrdersError = _ref$onGetOrdersError === void 0 ? function () {} : _ref$onGetOrdersError;
|
|
4142
4203
|
|
|
4143
|
-
var _useState = useState(
|
|
4204
|
+
var _useState = useState({}),
|
|
4144
4205
|
data = _useState[0],
|
|
4145
4206
|
setData = _useState[1];
|
|
4146
4207
|
|
|
@@ -4150,7 +4211,7 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
4150
4211
|
|
|
4151
4212
|
useEffect(function () {
|
|
4152
4213
|
_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
4153
|
-
var orderId, response, _data;
|
|
4214
|
+
var orderId, params, response, _data;
|
|
4154
4215
|
|
|
4155
4216
|
return runtime_1.wrap(function _callee$(_context) {
|
|
4156
4217
|
while (1) {
|
|
@@ -4158,50 +4219,58 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
4158
4219
|
case 0:
|
|
4159
4220
|
_context.prev = 0;
|
|
4160
4221
|
setLoading(true);
|
|
4161
|
-
orderId =
|
|
4162
|
-
|
|
4222
|
+
orderId = '';
|
|
4223
|
+
|
|
4224
|
+
if (typeof window !== 'undefined') {
|
|
4225
|
+
params = new URL("" + window.location).searchParams;
|
|
4226
|
+
orderId = params.get('o') || '';
|
|
4227
|
+
}
|
|
4228
|
+
|
|
4229
|
+
_context.next = 6;
|
|
4163
4230
|
return getOrderDetails(orderId);
|
|
4164
4231
|
|
|
4165
|
-
case
|
|
4232
|
+
case 6:
|
|
4166
4233
|
response = _context.sent;
|
|
4167
4234
|
onGetOrdersSuccess(response);
|
|
4168
4235
|
_data = _get(response, 'data.data.attributes');
|
|
4169
4236
|
setData(_data);
|
|
4170
|
-
_context.next =
|
|
4237
|
+
_context.next = 15;
|
|
4171
4238
|
break;
|
|
4172
4239
|
|
|
4173
|
-
case
|
|
4174
|
-
_context.prev =
|
|
4240
|
+
case 12:
|
|
4241
|
+
_context.prev = 12;
|
|
4175
4242
|
_context.t0 = _context["catch"](0);
|
|
4176
4243
|
onGetOrdersError(_context.t0);
|
|
4177
4244
|
|
|
4178
|
-
case
|
|
4179
|
-
_context.prev =
|
|
4245
|
+
case 15:
|
|
4246
|
+
_context.prev = 15;
|
|
4180
4247
|
setLoading(false);
|
|
4181
|
-
return _context.finish(
|
|
4248
|
+
return _context.finish(15);
|
|
4182
4249
|
|
|
4183
|
-
case
|
|
4250
|
+
case 18:
|
|
4184
4251
|
case "end":
|
|
4185
4252
|
return _context.stop();
|
|
4186
4253
|
}
|
|
4187
4254
|
}
|
|
4188
|
-
}, _callee, null, [[0,
|
|
4255
|
+
}, _callee, null, [[0, 12, 15, 18]]);
|
|
4189
4256
|
}))();
|
|
4190
4257
|
}, []);
|
|
4191
4258
|
return React.createElement("div", {
|
|
4192
4259
|
className: "order-details"
|
|
4193
4260
|
}, loading ? React.createElement("div", {
|
|
4194
|
-
className:
|
|
4261
|
+
className: "loading"
|
|
4195
4262
|
}, React.createElement(CircularProgress$1, null)) : React.createElement(React.Fragment, null, React.createElement("h1", {
|
|
4196
|
-
className:
|
|
4263
|
+
className: "layout-title"
|
|
4197
4264
|
}, "Order Details"), React.createElement("div", {
|
|
4198
|
-
className:
|
|
4265
|
+
className: "order-summary-box"
|
|
4199
4266
|
}, React.createElement("h4", {
|
|
4200
|
-
className:
|
|
4201
|
-
}, "Order Summary"), React.createElement("div",
|
|
4267
|
+
className: "sub-title"
|
|
4268
|
+
}, "Order Summary"), React.createElement("div", {
|
|
4269
|
+
className: "personal-link"
|
|
4270
|
+
}, React.createElement("b", null, "Your personal share link for this event is: "), React.createElement("a", {
|
|
4202
4271
|
href: data == null ? void 0 : data.personal_share_link,
|
|
4203
|
-
target:
|
|
4204
|
-
rel:
|
|
4272
|
+
target: "_blank",
|
|
4273
|
+
rel: "noreferrer"
|
|
4205
4274
|
}, data == null ? void 0 : data.personal_share_link)), React.createElement(TableContainer, {
|
|
4206
4275
|
component: Paper
|
|
4207
4276
|
}, React.createElement(Table, {
|
|
@@ -4215,10 +4284,20 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
4215
4284
|
key: index
|
|
4216
4285
|
}, React.createElement(TableCell, null, React.createElement("b", null, "Add-On: "), ticket.name), React.createElement(TableCell, null, ticket.currency + ticket.price), React.createElement(TableCell, null, ticket.quantity), React.createElement(TableCell, null, ticket.currency + ticket.total));
|
|
4217
4286
|
}), React.createElement(TableRow, {
|
|
4218
|
-
className:
|
|
4287
|
+
className: "total-row"
|
|
4219
4288
|
}, React.createElement(TableCell, null), React.createElement(TableCell, null), React.createElement(TableCell, null, "Total"), React.createElement(TableCell, null, getTotal(data))))))), React.createElement(TicketsTable, {
|
|
4220
4289
|
tickets: data.tickets
|
|
4221
|
-
})
|
|
4290
|
+
}), React.createElement("div", {
|
|
4291
|
+
className: "return-button-container"
|
|
4292
|
+
}, React.createElement("button", {
|
|
4293
|
+
type: "button",
|
|
4294
|
+
className: "return-button",
|
|
4295
|
+
onClick: function onClick() {
|
|
4296
|
+
if (typeof window !== 'undefined') {
|
|
4297
|
+
window.location.assign('/orders');
|
|
4298
|
+
}
|
|
4299
|
+
}
|
|
4300
|
+
}, "Return to Order History"))));
|
|
4222
4301
|
};
|
|
4223
4302
|
|
|
4224
4303
|
export { BillingInfoContainer, ConfirmationContainer, LoginModal, MyTicketsContainer, OrderDetailsContainer, PaymentContainer, TicketsContainer, createFixedFloatNormalizer, currencyNormalizerCreator };
|