tf-checkout-react 1.0.90 → 1.0.94
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 -0
- package/dist/components/billing-info-container/utils.d.ts +2 -1
- package/dist/components/ticketsContainer/ReferralLogic.d.ts +5 -0
- package/dist/tf-checkout-react.cjs.development.js +79 -7
- 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 +79 -7
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/package.json +2 -2
- package/src/api/index.ts +11 -9
- package/src/components/billing-info-container/index.tsx +6 -1
- package/src/components/billing-info-container/utils.ts +11 -1
- package/src/components/confirmationContainer/social-buttons.tsx +3 -0
- package/src/components/loginModal/index.tsx +8 -0
- package/src/components/loginModal/style.css +9 -0
- package/src/components/ticketsContainer/ReferralLogic.tsx +33 -0
- package/src/components/ticketsContainer/index.tsx +2 -0
package/dist/api/index.d.ts
CHANGED
|
@@ -27,4 +27,5 @@ export declare const getOrders: (page: number, limit: number, eventSlug: string)
|
|
|
27
27
|
export declare const getOrderDetails: (orderId: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
28
28
|
export declare const addToWaitingList: (id: number, data: any) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
29
29
|
export declare const getConditions: (eventId: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
30
|
+
export declare const postReferralVisits: (eventId: string, referralId: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
30
31
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IGroupItem } from '../../types';
|
|
2
|
+
import { FormikValues } from 'formik';
|
|
2
3
|
export interface ILoggedInValues {
|
|
3
4
|
emailLogged?: string;
|
|
4
5
|
firstNameLogged?: string;
|
|
@@ -48,6 +49,6 @@ export declare const setLoggedUserData: (data: IUserData) => {
|
|
|
48
49
|
export declare const createCheckoutDataBody: (ticketsQuantity: number, values?: IValues, logedInValues?: ILoggedInValues, includeDob?: boolean) => ICheckoutBody;
|
|
49
50
|
export declare const getValidateFunctions: (element: IGroupItem, states: {
|
|
50
51
|
[key: string]: any;
|
|
51
|
-
}[]) => (...value: any) => any;
|
|
52
|
+
}[], values: FormikValues) => (...value: any) => any;
|
|
52
53
|
export declare const assingUniqueIds: (data: any) => any;
|
|
53
54
|
export {};
|
|
@@ -1294,7 +1294,7 @@ var getStates = function getStates(countryId) {
|
|
|
1294
1294
|
return publicRequest.get("/countries/" + countryId + "/states/");
|
|
1295
1295
|
};
|
|
1296
1296
|
var getOrders = function getOrders(page, limit, eventSlug) {
|
|
1297
|
-
return publicRequest.get("/v1/account/orders/?page=" + page + "&limit=" + limit + "&filter[event]=" + eventSlug);
|
|
1297
|
+
return publicRequest.get("/v1/account/orders/?page=" + page + "&limit=" + limit + "&filter[event]=" + eventSlug + "&filter[brand]=" + CONFIGS.BRAND_SLUG);
|
|
1298
1298
|
};
|
|
1299
1299
|
var getOrderDetails = function getOrderDetails(orderId) {
|
|
1300
1300
|
return publicRequest.get("/v1/account/order/" + orderId);
|
|
@@ -1305,6 +1305,11 @@ var addToWaitingList = function addToWaitingList(id, data) {
|
|
|
1305
1305
|
var getConditions = function getConditions(eventId) {
|
|
1306
1306
|
return publicRequest.get("v1/event/" + eventId + "/conditions");
|
|
1307
1307
|
};
|
|
1308
|
+
var postReferralVisits = function postReferralVisits(eventId, referralId) {
|
|
1309
|
+
return publicRequest.post("/v1/event/" + eventId + "/referrer/", {
|
|
1310
|
+
referrer: "" + referralId
|
|
1311
|
+
});
|
|
1312
|
+
};
|
|
1308
1313
|
|
|
1309
1314
|
var style = {
|
|
1310
1315
|
position: 'absolute',
|
|
@@ -1338,6 +1343,12 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1338
1343
|
error = _useState[0],
|
|
1339
1344
|
setError = _useState[1];
|
|
1340
1345
|
|
|
1346
|
+
var handleForgotPassword = function handleForgotPassword() {
|
|
1347
|
+
if (typeof window !== 'undefined') {
|
|
1348
|
+
window.open(CONFIGS.BASE_URL + "/password-restore/");
|
|
1349
|
+
}
|
|
1350
|
+
};
|
|
1351
|
+
|
|
1341
1352
|
return React__default.createElement(Modal, {
|
|
1342
1353
|
open: true,
|
|
1343
1354
|
onClose: onClose,
|
|
@@ -1516,7 +1527,11 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1516
1527
|
className: "login-action-button"
|
|
1517
1528
|
}, React__default.createElement("button", {
|
|
1518
1529
|
type: "submit"
|
|
1519
|
-
}, "Login"))
|
|
1530
|
+
}, "Login")), React__default.createElement("div", {
|
|
1531
|
+
className: 'forgot-password'
|
|
1532
|
+
}, React__default.createElement("span", {
|
|
1533
|
+
onClick: handleForgotPassword
|
|
1534
|
+
}, "Forgot password?"))));
|
|
1520
1535
|
}))));
|
|
1521
1536
|
};
|
|
1522
1537
|
|
|
@@ -1856,7 +1871,7 @@ var createCheckoutDataBody = function createCheckoutDataBody(ticketsQuantity, va
|
|
|
1856
1871
|
|
|
1857
1872
|
return body;
|
|
1858
1873
|
};
|
|
1859
|
-
var getValidateFunctions = function getValidateFunctions(element, states) {
|
|
1874
|
+
var getValidateFunctions = function getValidateFunctions(element, states, values) {
|
|
1860
1875
|
var validationFunctions = [];
|
|
1861
1876
|
|
|
1862
1877
|
if (element.required) {
|
|
@@ -1869,6 +1884,14 @@ var getValidateFunctions = function getValidateFunctions(element, states) {
|
|
|
1869
1884
|
validationFunctions.push(element.onValidate);
|
|
1870
1885
|
}
|
|
1871
1886
|
|
|
1887
|
+
if (element.name === 'confirmEmail') {
|
|
1888
|
+
var isSameEmail = function isSameEmail(confirmEmail) {
|
|
1889
|
+
return values.email !== confirmEmail ? 'Please confirm your email address correctly' : null;
|
|
1890
|
+
};
|
|
1891
|
+
|
|
1892
|
+
validationFunctions.push(isSameEmail);
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1872
1895
|
return combineValidators.apply(void 0, validationFunctions);
|
|
1873
1896
|
};
|
|
1874
1897
|
var assingUniqueIds = function assingUniqueIds(data) {
|
|
@@ -2369,7 +2392,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2369
2392
|
|
|
2370
2393
|
var ttfOptIn = Boolean(_get(cartInfoData, 'ttfOptIn', false));
|
|
2371
2394
|
|
|
2372
|
-
var hideTtfOptIn = _get(cartInfoData, 'hide_ttf_opt_in', true);
|
|
2395
|
+
var hideTtfOptIn = _get(cartInfoData, 'hide_ttf_opt_in', true);
|
|
2396
|
+
|
|
2397
|
+
var flagRequirePhone = _get(cartInfoData, 'flagRequirePhone', false); // Get prevProps
|
|
2373
2398
|
|
|
2374
2399
|
|
|
2375
2400
|
var prevData = React.useRef(data);
|
|
@@ -2877,6 +2902,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2877
2902
|
return false;
|
|
2878
2903
|
}
|
|
2879
2904
|
|
|
2905
|
+
if (el.name === 'phone' && !flagRequirePhone) {
|
|
2906
|
+
el.required = true;
|
|
2907
|
+
}
|
|
2908
|
+
|
|
2880
2909
|
return true;
|
|
2881
2910
|
}), function (element) {
|
|
2882
2911
|
return ['password', 'confirmPassword', 'password-info'].includes(element.name) && isLoggedIn ? null : React__default.createElement(React__default.Fragment, {
|
|
@@ -2887,7 +2916,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2887
2916
|
name: element.name,
|
|
2888
2917
|
label: element.label,
|
|
2889
2918
|
type: element.type,
|
|
2890
|
-
validate: getValidateFunctions(element, states),
|
|
2919
|
+
validate: getValidateFunctions(element, states, props.values),
|
|
2891
2920
|
setFieldValue: props.setFieldValue,
|
|
2892
2921
|
onBlur: props.handleBlur,
|
|
2893
2922
|
component: element.type === 'checkbox' ? CheckboxField : element.type === 'select' ? SelectField : element.type === 'phone' ? FormikPhoneNumberField : CustomField,
|
|
@@ -3757,7 +3786,7 @@ var SocialButtons = function SocialButtons(_ref2) {
|
|
|
3757
3786
|
return React__default.createElement(SocialComponent, Object.assign({
|
|
3758
3787
|
key: index
|
|
3759
3788
|
}, shareButton));
|
|
3760
|
-
})));
|
|
3789
|
+
})), (showDefaultShareButtons || shareButtons.length) && React__default.createElement("p", null, "We ", React__default.createElement("strong", null, "never"), " post on Facebook without your permission!"));
|
|
3761
3790
|
};
|
|
3762
3791
|
|
|
3763
3792
|
var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
@@ -4388,6 +4417,47 @@ function Countdown(_ref) {
|
|
|
4388
4417
|
}, message)));
|
|
4389
4418
|
}
|
|
4390
4419
|
|
|
4420
|
+
var ReferralLogic = function ReferralLogic(props) {
|
|
4421
|
+
var eventId = props.eventId;
|
|
4422
|
+
var isWindowDefined = typeof window !== 'undefined';
|
|
4423
|
+
React.useEffect(function () {
|
|
4424
|
+
if (isWindowDefined) {
|
|
4425
|
+
var params = new URL("" + window.location).searchParams;
|
|
4426
|
+
var referralId = params.get('ttf_r') || '';
|
|
4427
|
+
var isAlreadyCounted = !!localStorage.getItem('referral_key');
|
|
4428
|
+
|
|
4429
|
+
if (referralId && eventId && !isAlreadyCounted) {
|
|
4430
|
+
_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
4431
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
4432
|
+
while (1) {
|
|
4433
|
+
switch (_context.prev = _context.next) {
|
|
4434
|
+
case 0:
|
|
4435
|
+
_context.prev = 0;
|
|
4436
|
+
_context.next = 3;
|
|
4437
|
+
return postReferralVisits("" + eventId, referralId);
|
|
4438
|
+
|
|
4439
|
+
case 3:
|
|
4440
|
+
localStorage.setItem('referral_key', [eventId, '.', referralId].join(''));
|
|
4441
|
+
_context.next = 8;
|
|
4442
|
+
break;
|
|
4443
|
+
|
|
4444
|
+
case 6:
|
|
4445
|
+
_context.prev = 6;
|
|
4446
|
+
_context.t0 = _context["catch"](0);
|
|
4447
|
+
|
|
4448
|
+
case 8:
|
|
4449
|
+
case "end":
|
|
4450
|
+
return _context.stop();
|
|
4451
|
+
}
|
|
4452
|
+
}
|
|
4453
|
+
}, _callee, null, [[0, 6]]);
|
|
4454
|
+
}))();
|
|
4455
|
+
}
|
|
4456
|
+
}
|
|
4457
|
+
}, []);
|
|
4458
|
+
return null;
|
|
4459
|
+
};
|
|
4460
|
+
|
|
4391
4461
|
function Loader$1() {
|
|
4392
4462
|
return React__default.createElement("div", {
|
|
4393
4463
|
className: "loader-container"
|
|
@@ -4732,7 +4802,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4732
4802
|
}, []);
|
|
4733
4803
|
return React__default.createElement(privateTheming.ThemeProvider, {
|
|
4734
4804
|
theme: themeMui
|
|
4735
|
-
}, React__default.createElement(
|
|
4805
|
+
}, React__default.createElement(ReferralLogic, {
|
|
4806
|
+
eventId: eventId
|
|
4807
|
+
}), React__default.createElement("div", {
|
|
4736
4808
|
className: "get-tickets-page " + theme,
|
|
4737
4809
|
style: contentStyle
|
|
4738
4810
|
}, isLoading ? React__default.createElement(Loader$1, null) : React__default.createElement("div", null, React__default.createElement(TicketsSection, {
|