tf-checkout-react 1.2.12 → 1.2.13

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.
@@ -21,8 +21,10 @@ import { useTheme } from '@mui/styles';
21
21
  import FormGroup from '@mui/material/FormGroup';
22
22
  import FormControlLabel from '@mui/material/FormControlLabel';
23
23
  import Checkbox from '@mui/material/Checkbox';
24
- import MuiPhoneNumber from 'material-ui-phone-number';
24
+ import 'material-ui-phone-number';
25
+ import 'react-phone-input-2/lib/material.css';
25
26
  import _debounce from 'lodash-es/debounce';
27
+ import PhoneInput from 'react-phone-input-2';
26
28
  import CircularProgress from '@mui/material/CircularProgress';
27
29
  import Select from '@mui/material/Select';
28
30
  import { object, string, ref, boolean } from 'yup';
@@ -1724,46 +1726,62 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
1724
1726
 
1725
1727
  case 4:
1726
1728
  setFieldError(field.name, '');
1727
- setFieldTouched(field.name, false);
1728
- _context.next = 12;
1729
+ _context.next = 11;
1729
1730
  break;
1730
1731
 
1731
- case 8:
1732
- _context.prev = 8;
1732
+ case 7:
1733
+ _context.prev = 7;
1733
1734
  _context.t0 = _context["catch"](0);
1734
1735
  message = _get(_context.t0, 'response.data.message', 'Invalid phone number');
1735
1736
  setFieldError(field.name, message);
1736
1737
 
1737
- case 12:
1738
- _context.prev = 12;
1738
+ case 11:
1739
+ _context.prev = 11;
1739
1740
  setStatus((_setStatus2 = {}, _setStatus2[field.name] = false, _setStatus2));
1740
- return _context.finish(12);
1741
+ return _context.finish(11);
1741
1742
 
1742
- case 15:
1743
+ case 14:
1743
1744
  case "end":
1744
1745
  return _context.stop();
1745
1746
  }
1746
1747
  }
1747
- }, _callee, null, [[0, 8, 12, 15]]);
1748
+ }, _callee, null, [[0, 7, 11, 14]]);
1748
1749
  }))); // eslint-disable-next-line
1749
1750
  }, [field.value]);
1750
- return React.createElement(MuiPhoneNumber, {
1751
- name: field.name,
1751
+ return React.createElement(React.Fragment, null, React.createElement(PhoneInput, {
1752
+ key: field.name,
1752
1753
  value: fill ? values.phone : initialValues.phone,
1753
- onChange: function onChange(e) {
1754
- setFieldTouched(field.name, true);
1755
- setFieldValue(field.name, e);
1754
+ onChange: function onChange(value, data) {
1755
+ if (data.dialCode !== value) {
1756
+ setFieldTouched(field.name, true);
1757
+ setFieldValue(field.name, value);
1758
+ } else {
1759
+ setFieldValue(field.name, '');
1760
+ setFieldError(field.name, '');
1761
+ }
1756
1762
  },
1757
- variant: "outlined",
1758
- defaultCountry: "us",
1763
+ country: "us",
1759
1764
  disableDropdown: disableDropdown,
1760
- label: label,
1761
- error: !!error && isTouched,
1762
- helperText: isTouched && error,
1763
- fullWidth: true,
1765
+ specialLabel: label,
1764
1766
  autoFormat: false,
1765
- disableAreaCodes: true
1766
- });
1767
+ inputStyle: {
1768
+ width: '100%'
1769
+ }
1770
+ }), !!error && isTouched && React.createElement("p", {
1771
+ style: {
1772
+ fontFamily: '"Roboto","Helvetica","Arial",sans-serif',
1773
+ fontWeight: '400',
1774
+ fontSize: '0.75rem',
1775
+ lineHeight: '1.66',
1776
+ letterSpacing: '0.03333em',
1777
+ textAlign: 'left',
1778
+ marginTop: '3px',
1779
+ marginRight: '14px',
1780
+ marginBottom: '0',
1781
+ marginLeft: '14px',
1782
+ color: '#d32f2f'
1783
+ }
1784
+ }, error));
1767
1785
  };
1768
1786
 
1769
1787
  function Loader() {
@@ -2662,7 +2680,8 @@ var LogicRunner = function LogicRunner(_ref) {
2662
2680
  setUserValues = _ref.setUserValues,
2663
2681
  onGetStatesSuccess = _ref.onGetStatesSuccess,
2664
2682
  onGetStatesError = _ref.onGetStatesError,
2665
- shouldFetchCountries = _ref.shouldFetchCountries;
2683
+ shouldFetchCountries = _ref.shouldFetchCountries,
2684
+ brandOptIn = _ref.brandOptIn;
2666
2685
  var prevCountry = useRef(values.country);
2667
2686
  useEffect(function () {
2668
2687
  var fetchStates = /*#__PURE__*/function () {
@@ -2737,7 +2756,7 @@ var LogicRunner = function LogicRunner(_ref) {
2737
2756
  street_address: (parsedData == null ? void 0 : parsedData.street_address) || '',
2738
2757
  country: (parsedData == null ? void 0 : parsedData.country) || '1',
2739
2758
  zip: (parsedData == null ? void 0 : parsedData.zip) || '',
2740
- brand_opt_in: (parsedData == null ? void 0 : parsedData.brand_opt_in) || false,
2759
+ brand_opt_in: brandOptIn ? brandOptIn : (parsedData == null ? void 0 : parsedData.brand_opt_in) || false,
2741
2760
  city: (parsedData == null ? void 0 : parsedData.city) || '',
2742
2761
  confirmPassword: '',
2743
2762
  password: '',
@@ -2832,7 +2851,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2832
2851
  _ref3$showForgotPassw = _ref3.showForgotPasswordButton,
2833
2852
  showForgotPasswordButton = _ref3$showForgotPassw === void 0 ? false : _ref3$showForgotPassw,
2834
2853
  _ref3$showSignUpButto = _ref3.showSignUpButton,
2835
- showSignUpButton = _ref3$showSignUpButto === void 0 ? false : _ref3$showSignUpButto;
2854
+ showSignUpButton = _ref3$showSignUpButto === void 0 ? false : _ref3$showSignUpButto,
2855
+ _ref3$brandOptIn = _ref3.brandOptIn,
2856
+ brandOptIn = _ref3$brandOptIn === void 0 ? false : _ref3$brandOptIn;
2836
2857
 
2837
2858
  var themeMui = createTheme(themeOptions);
2838
2859
  var isWindowDefined = typeof window !== 'undefined';
@@ -2920,9 +2941,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2920
2941
  var showDOB = getQueryVariable('age_required') === 'true';
2921
2942
  var showTicketHolders = getQueryVariable('names_required') === 'true';
2922
2943
  var eventId = getQueryVariable('event_id');
2923
-
2924
- var optedInFieldValue = _get(cartInfoData, 'optedIn', false);
2925
-
2944
+ var optedInFieldValue = brandOptIn ? brandOptIn : _get(cartInfoData, 'optedIn', false);
2926
2945
  var ttfOptIn = Boolean(_get(cartInfoData, 'ttfOptIn', false));
2927
2946
 
2928
2947
  var hideTtfOptIn = _get(cartInfoData, 'hide_ttf_opt_in', true);
@@ -3398,6 +3417,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
3398
3417
  return React.createElement(Form, {
3399
3418
  onSubmit: props.handleSubmit
3400
3419
  }, React.createElement(ErrorFocus, null), React.createElement(LogicRunner, {
3420
+ brandOptIn: brandOptIn,
3401
3421
  values: props.values,
3402
3422
  setStates: setStates,
3403
3423
  setFieldValue: props.setFieldValue,
@@ -6477,8 +6497,9 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
6477
6497
 
6478
6498
  var orderSummery = "ID " + data.id + ", placed";
6479
6499
 
6480
- if (data.date) {
6481
- orderSummery += " " + data.date;
6500
+ if (data.date && data.timezone) {
6501
+ var date = moment.tz(data.date, data.timezone).format("dddd, DD MMMM YYYY");
6502
+ orderSummery += " " + date;
6482
6503
  }
6483
6504
 
6484
6505
  return React.createElement("div", {