tf-checkout-react 1.0.13 → 1.0.14

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.
@@ -10,9 +10,9 @@ export declare function getTickets(id: string | number): Promise<import("axios")
10
10
  export declare const addToCart: (id: string | number, data: any) => Promise<import("axios").AxiosResponse<any, any>>;
11
11
  export declare const getCart: () => Promise<import("axios").AxiosResponse<any, any>>;
12
12
  export declare const postOnCheckout: (data: any, accessToken: string) => Promise<import("axios").AxiosResponse<any, any>>;
13
- export declare const authorize: (data: FormData) => import("axios").AxiosPromise<any>;
13
+ export declare const authorize: (data: FormData) => Promise<import("axios").AxiosResponse<any, any>>;
14
14
  export declare const register: (data: FormData) => Promise<import("axios").AxiosResponse<any, any>>;
15
- export declare const getAccessToken: (data: FormData) => import("axios").AxiosPromise<any>;
15
+ export declare const getAccessToken: (data: FormData) => Promise<import("axios").AxiosResponse<any, any>>;
16
16
  export declare const getPaymentData: (hash: string) => Promise<import("axios").AxiosResponse<any, any>>;
17
17
  export declare const handlePaymentData: (orderHash: string, data: any) => Promise<import("axios").AxiosResponse<any, any>>;
18
18
  export declare const getProfileData: (accessToken: any) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -7,5 +7,6 @@ export interface IBillingInfoPage {
7
7
  handleSubmit: (values: FormikValues, formikHelpers: FormikHelpers<FormikValues>, res?: any) => void;
8
8
  initialValues?: FormikValues;
9
9
  buttonName?: string;
10
+ theme?: 'light' | 'dark';
10
11
  }
11
- export declare const BillingInfoContainer: ({ data, initialValues, buttonName, handleSubmit, }: IBillingInfoPage) => JSX.Element;
12
+ export declare const BillingInfoContainer: ({ data, initialValues, buttonName, handleSubmit, theme }: IBillingInfoPage) => JSX.Element;
@@ -1,4 +1,4 @@
1
- .style_billing-info-container__3ZE3J{margin:0 auto;max-width:800px}.style_billing-info-container__3ZE3J .style_is-half__1W_rP{width:49%}.style_billing-info-container__twoFields__2tDqt{display:flex;justify-content:space-between;margin-top:15px}.style_billing-info-container__singleField__2bcsf{margin-top:15px}button{margin-top:10px}.style_account-actions-block__16OH-{color:#182026;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif;margin-top:10px}.style_login-register-button__fGgZf{background-color:#f28051;border:#f28051;border-radius:5px;color:#fff;cursor:pointer;display:block;font-family:Inter-Bold;font-size:1rem;font-weight:700;line-height:1.15;margin:10px 0;min-height:46px;outline:none;overflow:hidden;padding:14px 12px 12px;position:relative;text-align:center;text-overflow:ellipsis;text-transform:uppercase;width:49%}.style_login-register-block__36tu5{display:flex;justify-content:space-between}
1
+ .style_billing-info-container__3ZE3J{margin:0 auto;max-width:800px}.style_billing-info-container__3ZE3J .style_is-half__1W_rP{width:49%}.style_billing-info-container__twoFields__2tDqt{display:flex;justify-content:space-between;margin-top:15px}.style_billing-info-container__singleField__2bcsf{margin-top:15px}button{margin-top:10px}.style_account-actions-block__16OH-{color:#182026;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif;margin-top:10px}.style_login-register-button__fGgZf,.style_MuiButtonBase-root__1UBk9.style_MuiButton-root__3NzEO,.style_MuiButtonBase-root__1UBk9.style_MuiButton-root__3NzEO:hover{background-color:#f28051;border:#f28051;border-radius:5px;color:#fff;cursor:pointer;display:block;font-family:Inter-Bold;font-size:1rem;font-weight:700;line-height:1.15;margin:10px 0;min-height:46px;outline:none;overflow:hidden;padding:14px 12px 12px;position:relative;text-align:center;text-overflow:ellipsis;text-transform:uppercase;width:49%}.style_login-register-block__36tu5{display:flex;justify-content:space-between}
2
2
  .style_modal-title__2sUq_{align-items:center;background-color:#fff;display:flex;font-family:Inter;font-size:18px;font-weight:700;height:49px;line-height:22px;padding-left:25px;position:relative}.style_login-modal-body__2sFg5{padding:15px 25px}.style_login-modal-body__2sFg5 input{background:#fff!important}.style_login-modal-body__email__2nnEH,.style_login-modal-body__password__qS3g7{margin-bottom:20px}.style_login-action-button__1g9qt button{background-color:#f28051;border:none;border-radius:0;color:#fff;cursor:pointer;font-size:18px;font-weight:600;height:45px;line-height:18px;margin:10px 0;outline:none;padding:10px;width:100%}.style_server_auth__error__1340S{color:red;font-family:Inter;font-size:12px;font-style:normal;padding-left:25px;padding-top:15px}.style_info-text-for-login__28JQf{font-size:14px;margin-bottom:4px;padding-left:10px}
3
3
  .style_register-container___s5V8{margin:0 auto;max-width:800px}.style_register-container___s5V8 .style_is-half__2XhZU{width:49%}.style_register-container__twoFields__3dAvM{display:flex;justify-content:space-between;margin-top:15px}.style_register-container__singleField__36dGU{margin-top:15px}button{margin-top:10px}
4
4
  .style_payment_page__1PUd8{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif}.style_payment_page__1PUd8 .style_order_info_section__J1olw{padding:15px 0}.style_payment_page__1PUd8 .style_order_info_section__J1olw .style_order_info_block__3kZN4{padding-bottom:15px;padding-top:15px}.style_payment_page__1PUd8 .style_order_info_section__J1olw .style_order_info_block__3kZN4 .style_field-underline__2M8Bd{border-bottom:1px solid #000;padding-bottom:15px}.style_payment_page__1PUd8 .style_order_info_section__J1olw .style_order_info_block__3kZN4 .style_order_info_title__1MBgS{font-size:14px;font-weight:700;padding-bottom:3px}.style_payment_page__1PUd8 .style_order_info_section__J1olw .style_order_info_block__3kZN4 .style_order_info_text__3gSEK{font-size:16px;line-height:1.15;outline:none}.style_payment_page__1PUd8 .style_MuiBox-root__2LeaA{margin-left:auto;margin-right:auto;padding:20px;text-align:center}.style_payment_page__1PUd8 .style_payment_info_label__3Zmjp{padding:20px 0;text-align:center}.style_payment_page__1PUd8 .style_payment_form__2arf4{color:#fff;padding:20px}.style_payment_page__1PUd8 .style_payment_form__2arf4 input,.style_payment_page__1PUd8 .style_payment_form__2arf4 label{color:#fff}.style_payment_page__1PUd8 .style_payment_button__3WzAn{padding-top:20px;text-align:center}
@@ -8,6 +8,7 @@ var React = require('react');
8
8
  var React__default = _interopDefault(React);
9
9
  var formik = require('formik');
10
10
  var TextField = _interopDefault(require('@mui/material/TextField'));
11
+ var Button = _interopDefault(require('@mui/material/Button'));
11
12
  var _identity = _interopDefault(require('lodash/identity'));
12
13
  var _map = _interopDefault(require('lodash/map'));
13
14
  var _get = _interopDefault(require('lodash/get'));
@@ -948,27 +949,13 @@ var postOnCheckout = function postOnCheckout(data, accessToken) {
948
949
  return res;
949
950
  };
950
951
  var authorize = function authorize(data) {
951
- return axios({
952
- method: 'post',
953
- url: 'https://www.ticketfairy.com/api/v1/oauth/authorize-rn?client_id=4792a61f2fcb49197ab4c2d2f44df570',
954
- data: data,
955
- headers: {
956
- 'Content-Type': 'multipart/form-data'
957
- }
958
- });
952
+ return publicRequest.post('/v1/oauth/authorize-rn?client_id=4792a61f2fcb49197ab4c2d2f44df570', data);
959
953
  };
960
954
  var register = function register(data) {
961
955
  return publicRequest.post('/v1/oauth/register-rn', data);
962
956
  };
963
957
  var getAccessToken = function getAccessToken(data) {
964
- return axios({
965
- method: 'post',
966
- url: 'https://www.ticketfairy.com/api/v1/oauth/access_token',
967
- data: data,
968
- headers: {
969
- 'Content-Type': 'multipart/form-data'
970
- }
971
- });
958
+ return publicRequest.post('/v1/oauth/access_token', data);
972
959
  };
973
960
  var getPaymentData = function getPaymentData(hash) {
974
961
  var response = publicRequest.get("v1/order/" + hash + "/review/")["catch"](function (error) {
@@ -1070,24 +1057,28 @@ var LoginModal = function LoginModal(_ref) {
1070
1057
  last_name: profileSpecifiedData.lastName,
1071
1058
  email: profileSpecifiedData.email
1072
1059
  };
1073
- localStorage.setItem('user_data', JSON.stringify(profileDataObj));
1074
- localStorage.setItem('access_token', accessToken);
1060
+
1061
+ if (typeof window !== 'undefined') {
1062
+ window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
1063
+ window.localStorage.setItem('access_token', accessToken);
1064
+ }
1065
+
1075
1066
  onLogin();
1076
- _context.next = 33;
1067
+ _context.next = 32;
1077
1068
  break;
1078
1069
 
1079
- case 29:
1080
- _context.prev = 29;
1070
+ case 28:
1071
+ _context.prev = 28;
1081
1072
  _context.t0 = _context["catch"](1);
1082
1073
  _error = _context.t0.response.data.message || 'Error';
1083
1074
  setError(_error);
1084
1075
 
1085
- case 33:
1076
+ case 32:
1086
1077
  case "end":
1087
1078
  return _context.stop();
1088
1079
  }
1089
1080
  }
1090
- }, _callee, null, [[1, 29]]);
1081
+ }, _callee, null, [[1, 28]]);
1091
1082
  }));
1092
1083
 
1093
1084
  function onSubmit(_x) {
@@ -1203,11 +1194,15 @@ var RegisterModal = function RegisterModal(_ref) {
1203
1194
  last_name: profileSpecifiedData.lastName,
1204
1195
  email: profileSpecifiedData.email
1205
1196
  };
1206
- localStorage.setItem('access_token', access_token);
1207
- localStorage.setItem('user_data', JSON.stringify(profileDataObj));
1197
+
1198
+ if (typeof window !== 'undefined') {
1199
+ window.localStorage.setItem('access_token', access_token);
1200
+ window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
1201
+ }
1202
+
1208
1203
  onClose();
1209
1204
 
1210
- case 22:
1205
+ case 21:
1211
1206
  case "end":
1212
1207
  return _context.stop();
1213
1208
  }
@@ -1324,7 +1319,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref) {
1324
1319
  _ref$buttonName = _ref.buttonName,
1325
1320
  buttonName = _ref$buttonName === void 0 ? 'Submit' : _ref$buttonName,
1326
1321
  _ref$handleSubmit = _ref.handleSubmit,
1327
- handleSubmit = _ref$handleSubmit === void 0 ? _identity : _ref$handleSubmit;
1322
+ handleSubmit = _ref$handleSubmit === void 0 ? _identity : _ref$handleSubmit,
1323
+ _ref$theme = _ref.theme,
1324
+ theme = _ref$theme === void 0 ? 'light' : _ref$theme;
1328
1325
  var userData = typeof window !== 'undefined' && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
1329
1326
  var access_token = typeof window !== 'undefined' && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
1330
1327
 
@@ -1465,10 +1462,14 @@ var BillingInfoContainer = function BillingInfoContainer(_ref) {
1465
1462
  last_name: profileSpecifiedData.lastName,
1466
1463
  email: profileSpecifiedData.email
1467
1464
  };
1468
- localStorage.setItem('access_token', access_token_register);
1469
- localStorage.setItem('user_data', JSON.stringify(profileDataObj));
1465
+
1466
+ if (typeof window !== 'undefined') {
1467
+ window.localStorage.setItem('access_token', access_token_register);
1468
+ window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
1469
+ }
1470
+
1470
1471
  holderAge = new Date(values.holderAge);
1471
- _context2.next = 30;
1472
+ _context2.next = 29;
1472
1473
  return postOnCheckout({
1473
1474
  attributes: {
1474
1475
  email: values.email,
@@ -1485,14 +1486,14 @@ var BillingInfoContainer = function BillingInfoContainer(_ref) {
1485
1486
  }
1486
1487
  }, access_token_register);
1487
1488
 
1488
- case 30:
1489
+ case 29:
1489
1490
  res = _context2.sent;
1490
1491
  handleSubmit(values, formikHelpers, res);
1491
- _context2.next = 38;
1492
+ _context2.next = 37;
1492
1493
  break;
1493
1494
 
1494
- case 34:
1495
- _context2.prev = 34;
1495
+ case 33:
1496
+ _context2.prev = 33;
1496
1497
  _context2.t0 = _context2["catch"](0);
1497
1498
  error = _context2.t0.response.data.message;
1498
1499
 
@@ -1501,12 +1502,12 @@ var BillingInfoContainer = function BillingInfoContainer(_ref) {
1501
1502
  setShowModalLogin(true);
1502
1503
  }
1503
1504
 
1504
- case 38:
1505
+ case 37:
1505
1506
  case "end":
1506
1507
  return _context2.stop();
1507
1508
  }
1508
1509
  }
1509
- }, _callee2, null, [[0, 34]]);
1510
+ }, _callee2, null, [[0, 33]]);
1510
1511
  }));
1511
1512
 
1512
1513
  function onSubmit(_x, _x2) {
@@ -1519,7 +1520,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref) {
1519
1520
  return React__default.createElement(formik.Form, {
1520
1521
  onSubmit: props.handleSubmit
1521
1522
  }, React__default.createElement("div", {
1522
- className: "billing-info-container"
1523
+ className: "billing-info-container " + theme
1523
1524
  }, !isLoggedIn && React__default.createElement("div", {
1524
1525
  className: "account-actions-block"
1525
1526
  }, React__default.createElement("div", null, "Got a Restless Nites account?"), React__default.createElement("div", null, "Login & skip ahead:"), React__default.createElement("div", {
@@ -1563,14 +1564,25 @@ var BillingInfoContainer = function BillingInfoContainer(_ref) {
1563
1564
  type: element.type,
1564
1565
  fullWidth: true,
1565
1566
  error: !!meta.error && meta.touched,
1566
- helperText: meta.touched && meta.error
1567
+ helperText: meta.touched && meta.error,
1568
+ InputLabelProps: element.type === 'date' ? {
1569
+ shrink: true
1570
+ } : {}
1567
1571
  }, field));
1568
1572
  }));
1569
1573
  }));
1570
1574
  }));
1571
- }), React__default.createElement("button", {
1572
- type: "submit"
1573
- }, buttonName)));
1575
+ }), React__default.createElement("div", {
1576
+ style: {
1577
+ display: 'flex',
1578
+ padding: 20,
1579
+ justifyContent: 'center'
1580
+ }
1581
+ }, React__default.createElement(Button, {
1582
+ type: "submit",
1583
+ variant: "contained",
1584
+ className: "login-register-button"
1585
+ }, buttonName))));
1574
1586
  }), showModalLogin && React__default.createElement(LoginModal, {
1575
1587
  onClose: function onClose() {
1576
1588
  setShowModalLogin(false);