tf-checkout-react 1.0.64 → 1.0.68
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/components/common/FormikPhoneNumberField.d.ts +11 -0
- package/dist/components/confirmationContainer/index.d.ts +5 -11
- package/dist/components/confirmationContainer/social-buttons.d.ts +11 -0
- package/dist/components/loginModal/index.d.ts +1 -0
- package/dist/normalizers/index.d.ts +1 -0
- package/dist/tf-checkout-react.cjs.development.js +280 -141
- 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 +280 -141
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/dist/types/referral-promotion.d.ts +1 -1
- package/package.json +9 -4
- package/src/api/index.ts +6 -8
- package/src/components/billing-info-container/index.tsx +8 -4
- package/src/components/common/FormikPhoneNumberField.tsx +41 -0
- package/src/components/confirmationContainer/index.tsx +107 -138
- package/src/components/confirmationContainer/social-buttons.tsx +116 -0
- package/src/components/confirmationContainer/style.css +87 -100
- package/src/components/loginModal/index.tsx +8 -1
- package/src/env.ts +2 -2
- package/src/normalizers/index.ts +3 -1
- package/src/types/referral-promotion.ts +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FieldInputProps } from 'formik';
|
|
3
|
+
export interface INumberInField {
|
|
4
|
+
label: string | number | JSX.Element;
|
|
5
|
+
field: FieldInputProps<any>;
|
|
6
|
+
}
|
|
7
|
+
interface IOtherProps {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
export declare const FormikPhoneNumberField: ({ label, field, form: { touched, errors }, setFieldValue, ...rest }: INumberInField & IOtherProps) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './style.css';
|
|
3
|
-
import { IReferralPromotion } from '../../types';
|
|
4
3
|
import { AxiosError } from 'axios';
|
|
5
4
|
export interface IShareButton {
|
|
6
5
|
mainLabel: string;
|
|
7
6
|
subLabel: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
containerInnerClassName?: string;
|
|
11
|
-
svgClassName?: string;
|
|
12
|
-
svgWidth?: string;
|
|
13
|
-
svgHeight?: string;
|
|
14
|
-
svgFill?: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
link: string;
|
|
15
9
|
}
|
|
16
10
|
export interface IConfirmationPage {
|
|
17
|
-
referralPromotions: IReferralPromotion[];
|
|
18
|
-
shareLink: string;
|
|
19
11
|
isReferralEnabled: boolean;
|
|
12
|
+
showDefaultShareButtons: boolean;
|
|
13
|
+
messengerAppId: string;
|
|
20
14
|
shareButtons: IShareButton[];
|
|
21
15
|
onGetConfirmationDataSuccess: (res: any) => void;
|
|
22
16
|
onGetConfirmationDataError: (e: AxiosError) => void;
|
|
23
17
|
}
|
|
24
|
-
export declare const ConfirmationContainer: ({ isReferralEnabled,
|
|
18
|
+
export declare const ConfirmationContainer: ({ isReferralEnabled, showDefaultShareButtons, messengerAppId, shareButtons, onGetConfirmationDataSuccess, onGetConfirmationDataError, }: IConfirmationPage) => JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IShareButton } from './index';
|
|
3
|
+
interface SocialButtonsTypes {
|
|
4
|
+
shareLink: string;
|
|
5
|
+
name: string;
|
|
6
|
+
appId: string;
|
|
7
|
+
showDefaultShareButtons: boolean;
|
|
8
|
+
shareButtons: IShareButton[];
|
|
9
|
+
}
|
|
10
|
+
declare const SocialButtons: ({ showDefaultShareButtons, shareLink, name, appId, shareButtons }: SocialButtonsTypes) => JSX.Element;
|
|
11
|
+
export default SocialButtons;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const currencyNormalizerCreator: (value: string | number, currency: string) => string;
|
|
2
2
|
export declare const createFixedFloatNormalizer: (fixedValue: number) => (value: string | number) => string;
|
|
3
3
|
export declare const getCurrencySymbolByCurrency: (currency?: string) => "£" | "€" | "₹" | "J$" | "NZ$" | "RM" | "Mex$" | "S$" | "A$" | "R" | "Ksh" | "₺" | "CA$" | "฿" | "Kr" | "kr" | "US$";
|
|
4
|
+
export declare const removePlusSign: (string?: string) => string;
|
|
@@ -25,6 +25,7 @@ var FormGroup = _interopDefault(require('@mui/material/FormGroup'));
|
|
|
25
25
|
var FormControlLabel = _interopDefault(require('@mui/material/FormControlLabel'));
|
|
26
26
|
var Checkbox = _interopDefault(require('@mui/material/Checkbox'));
|
|
27
27
|
var Select = _interopDefault(require('@mui/material/Select'));
|
|
28
|
+
var MuiPhoneNumber = _interopDefault(require('material-ui-phone-number'));
|
|
28
29
|
var styles = require('@mui/material/styles');
|
|
29
30
|
var Container = _interopDefault(require('@mui/material/Container'));
|
|
30
31
|
var Alert = _interopDefault(require('@mui/material/Alert'));
|
|
@@ -32,6 +33,7 @@ var reactStripeJs = require('@stripe/react-stripe-js');
|
|
|
32
33
|
var stripeJs = require('@stripe/stripe-js');
|
|
33
34
|
var CircularProgress = _interopDefault(require('@mui/material/CircularProgress'));
|
|
34
35
|
var SVG = _interopDefault(require('react-inlinesvg'));
|
|
36
|
+
var reactShare = require('react-share');
|
|
35
37
|
var _some = _interopDefault(require('lodash/some'));
|
|
36
38
|
var _find = _interopDefault(require('lodash/find'));
|
|
37
39
|
var _isEmpty = _interopDefault(require('lodash/isEmpty'));
|
|
@@ -923,16 +925,18 @@ var emailValidator = function emailValidator(email) {
|
|
|
923
925
|
return !emailRegex.test(email) ? 'Please enter a valid email address' : '';
|
|
924
926
|
};
|
|
925
927
|
|
|
926
|
-
//
|
|
928
|
+
// preview
|
|
927
929
|
var ENV = {
|
|
928
930
|
EVENT_ID: 3483,
|
|
929
|
-
BASE_URL: 'https://
|
|
931
|
+
BASE_URL: 'https://preview.ttf.fluxtech.me/api',
|
|
930
932
|
CLIENT_ID: '4792a61f2fcb49197ab4c2d2f44df570',
|
|
931
933
|
CLIENT_SECRET: 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9',
|
|
932
934
|
STRIPE_PUBLISHABLE_KEY: 'pk_test_51H4BkOGqveRD6EShliLrT9vd7mPOBPvQSuqmvc3wIinDqxWsCLeS2N7HonPPn6MhjU35ayYy5v4I6MLlD4jNWrd000NSgAF6UL'
|
|
933
935
|
}; // prod
|
|
934
936
|
|
|
935
937
|
var isWindowDefined = typeof window !== 'undefined';
|
|
938
|
+
var allowedOrigins = ['http://localhost', 'gtsb.io', 'gatsbyjs.io', 'https://www.houseofx.nyc', 'https://tickets-staging.houseofx.nyc'];
|
|
939
|
+
var origin = isWindowDefined && window.location.origin;
|
|
936
940
|
var ttfHeaders = {
|
|
937
941
|
Accept: 'application/vnd.api+json',
|
|
938
942
|
'Content-Type': 'application/vnd.api+json'
|
|
@@ -942,7 +946,9 @@ if (isWindowDefined && localStorage.getItem('auth_guest_token')) {
|
|
|
942
946
|
ttfHeaders['Authorization-Guest'] = /*#__PURE__*/localStorage.getItem('auth_guest_token');
|
|
943
947
|
}
|
|
944
948
|
|
|
945
|
-
if (isWindowDefined &&
|
|
949
|
+
if (isWindowDefined && !allowedOrigins.some(function (el) {
|
|
950
|
+
return origin && origin.includes(el);
|
|
951
|
+
})) {
|
|
946
952
|
ttfHeaders['X-Source-Origin'] = 'houseofx.nyc';
|
|
947
953
|
}
|
|
948
954
|
|
|
@@ -988,7 +994,9 @@ publicRequest.interceptors.request.use(function (config) {
|
|
|
988
994
|
config.headers = _updatedHeaders;
|
|
989
995
|
}
|
|
990
996
|
|
|
991
|
-
if (isWindowDefined &&
|
|
997
|
+
if (isWindowDefined && !allowedOrigins.some(function (el) {
|
|
998
|
+
return origin && origin.includes(el);
|
|
999
|
+
})) {
|
|
992
1000
|
var _updatedHeaders2 = _extends({}, config.headers, {
|
|
993
1001
|
'X-Source-Origin': 'houseofx.nyc'
|
|
994
1002
|
});
|
|
@@ -1141,7 +1149,9 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1141
1149
|
_ref$onGetProfileData = _ref.onGetProfileDataSuccess,
|
|
1142
1150
|
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? function () {} : _ref$onGetProfileData,
|
|
1143
1151
|
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
1144
|
-
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? function () {} : _ref$onGetProfileData2
|
|
1152
|
+
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? function () {} : _ref$onGetProfileData2,
|
|
1153
|
+
_ref$modalClassname = _ref.modalClassname,
|
|
1154
|
+
modalClassname = _ref$modalClassname === void 0 ? '' : _ref$modalClassname;
|
|
1145
1155
|
|
|
1146
1156
|
var _useState = React.useState(''),
|
|
1147
1157
|
error = _useState[0],
|
|
@@ -1151,7 +1161,8 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1151
1161
|
open: true,
|
|
1152
1162
|
onClose: onClose,
|
|
1153
1163
|
"aria-labelledby": "modal-modal-title",
|
|
1154
|
-
"aria-describedby": "modal-modal-description"
|
|
1164
|
+
"aria-describedby": "modal-modal-description",
|
|
1165
|
+
className: "login-modal " + modalClassname
|
|
1155
1166
|
}, React__default.createElement(Box, {
|
|
1156
1167
|
style: style
|
|
1157
1168
|
}, React__default.createElement("div", null, React__default.createElement(formik.Formik, {
|
|
@@ -1850,6 +1861,109 @@ var ErrorFocusInternal = /*#__PURE__*/function (_Component) {
|
|
|
1850
1861
|
|
|
1851
1862
|
var ErrorFocus = /*#__PURE__*/formik.connect(ErrorFocusInternal);
|
|
1852
1863
|
|
|
1864
|
+
var currencyNormalizerCreator = function currencyNormalizerCreator(value, currency) {
|
|
1865
|
+
return !value ? '' : "" + getCurrencySymbolByCurrency(currency) + value;
|
|
1866
|
+
};
|
|
1867
|
+
var createFixedFloatNormalizer = function createFixedFloatNormalizer(fixedValue) {
|
|
1868
|
+
return function (value) {
|
|
1869
|
+
return value || "" + value === '0' ? (+value).toFixed(fixedValue) : '';
|
|
1870
|
+
};
|
|
1871
|
+
};
|
|
1872
|
+
var getCurrencySymbolByCurrency = function getCurrencySymbolByCurrency(currency) {
|
|
1873
|
+
if (currency === void 0) {
|
|
1874
|
+
currency = '';
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
switch (currency) {
|
|
1878
|
+
case 'GBP':
|
|
1879
|
+
return '£';
|
|
1880
|
+
|
|
1881
|
+
case 'EUR':
|
|
1882
|
+
return '€';
|
|
1883
|
+
|
|
1884
|
+
case 'INR':
|
|
1885
|
+
return '₹';
|
|
1886
|
+
|
|
1887
|
+
case 'JMD':
|
|
1888
|
+
return 'J$';
|
|
1889
|
+
|
|
1890
|
+
case 'NZD':
|
|
1891
|
+
return 'NZ$';
|
|
1892
|
+
|
|
1893
|
+
case 'MYR':
|
|
1894
|
+
return 'RM';
|
|
1895
|
+
|
|
1896
|
+
case 'MXN':
|
|
1897
|
+
return 'Mex$';
|
|
1898
|
+
|
|
1899
|
+
case 'SGD':
|
|
1900
|
+
return 'S$';
|
|
1901
|
+
|
|
1902
|
+
case 'AUD':
|
|
1903
|
+
return 'A$';
|
|
1904
|
+
|
|
1905
|
+
case 'ZAR':
|
|
1906
|
+
return 'R';
|
|
1907
|
+
|
|
1908
|
+
case 'ke':
|
|
1909
|
+
return 'Ksh';
|
|
1910
|
+
|
|
1911
|
+
case 'TRY':
|
|
1912
|
+
return '₺';
|
|
1913
|
+
|
|
1914
|
+
case 'CAD':
|
|
1915
|
+
return 'CA$';
|
|
1916
|
+
|
|
1917
|
+
case 'THB':
|
|
1918
|
+
return '฿';
|
|
1919
|
+
|
|
1920
|
+
case 'ISK':
|
|
1921
|
+
return 'Kr';
|
|
1922
|
+
|
|
1923
|
+
case 'SEK':
|
|
1924
|
+
return 'kr';
|
|
1925
|
+
|
|
1926
|
+
default:
|
|
1927
|
+
return 'US$';
|
|
1928
|
+
}
|
|
1929
|
+
};
|
|
1930
|
+
var removePlusSign = function removePlusSign(string) {
|
|
1931
|
+
if (string === void 0) {
|
|
1932
|
+
string = '';
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
return string.replace('+', '');
|
|
1936
|
+
};
|
|
1937
|
+
|
|
1938
|
+
var _excluded$2 = ["label", "field", "form", "setFieldValue"];
|
|
1939
|
+
var FormikPhoneNumberField = function FormikPhoneNumberField(_ref) {
|
|
1940
|
+
var label = _ref.label,
|
|
1941
|
+
field = _ref.field,
|
|
1942
|
+
_ref$form = _ref.form,
|
|
1943
|
+
touched = _ref$form.touched,
|
|
1944
|
+
errors = _ref$form.errors,
|
|
1945
|
+
setFieldValue = _ref.setFieldValue,
|
|
1946
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
1947
|
+
|
|
1948
|
+
var error = _get(errors, field.name);
|
|
1949
|
+
|
|
1950
|
+
var isTouched = Boolean(_get(touched, field.name));
|
|
1951
|
+
return React__default.createElement(MuiPhoneNumber, Object.assign({
|
|
1952
|
+
name: 'phone',
|
|
1953
|
+
onChange: function onChange(e) {
|
|
1954
|
+
return setFieldValue("phone", removePlusSign(e));
|
|
1955
|
+
},
|
|
1956
|
+
variant: "outlined",
|
|
1957
|
+
defaultCountry: 'us',
|
|
1958
|
+
disableDropdown: true,
|
|
1959
|
+
label: label,
|
|
1960
|
+
error: !!error && isTouched,
|
|
1961
|
+
helperText: isTouched && error,
|
|
1962
|
+
fullWidth: true,
|
|
1963
|
+
autoFormat: false
|
|
1964
|
+
}, rest));
|
|
1965
|
+
};
|
|
1966
|
+
|
|
1853
1967
|
var getImage = function getImage(name) {
|
|
1854
1968
|
if (name === void 0) {
|
|
1855
1969
|
name = '';
|
|
@@ -1877,7 +1991,7 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
1877
1991
|
React.useEffect(function () {
|
|
1878
1992
|
var fetchStates = /*#__PURE__*/function () {
|
|
1879
1993
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
1880
|
-
var _mappedStates$0$
|
|
1994
|
+
var _mappedStates$0$value, _mappedStates$, res, mappedStates;
|
|
1881
1995
|
|
|
1882
1996
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1883
1997
|
while (1) {
|
|
@@ -1889,14 +2003,14 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
1889
2003
|
|
|
1890
2004
|
case 3:
|
|
1891
2005
|
res = _context.sent;
|
|
1892
|
-
mappedStates = _map(_get(res, 'data.data'), function (item) {
|
|
2006
|
+
mappedStates = _map(_get(res, 'data.data'), function (item, key) {
|
|
1893
2007
|
return {
|
|
1894
2008
|
label: item,
|
|
1895
|
-
value:
|
|
2009
|
+
value: key
|
|
1896
2010
|
};
|
|
1897
2011
|
});
|
|
1898
2012
|
setStates(mappedStates);
|
|
1899
|
-
setFieldValue('state', (_mappedStates$0$
|
|
2013
|
+
setFieldValue('state', (_mappedStates$0$value = (_mappedStates$ = mappedStates[0]) == null ? void 0 : _mappedStates$.value) != null ? _mappedStates$0$value : '');
|
|
1900
2014
|
onGetStatesSuccess(res.data);
|
|
1901
2015
|
_context.next = 13;
|
|
1902
2016
|
break;
|
|
@@ -2279,7 +2393,6 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2279
2393
|
theme: themeMui
|
|
2280
2394
|
}, React__default.createElement(formik.Formik, {
|
|
2281
2395
|
initialValues: getInitialValues(dataWithUniqueIds, _extends({}, initialValues, {
|
|
2282
|
-
email: emailLogged,
|
|
2283
2396
|
firstName: firstNameLogged,
|
|
2284
2397
|
lastName: lastNameLogged,
|
|
2285
2398
|
country: 1,
|
|
@@ -2507,7 +2620,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2507
2620
|
label: element.label,
|
|
2508
2621
|
type: element.type,
|
|
2509
2622
|
validate: getValidateFunctions(element, states),
|
|
2510
|
-
|
|
2623
|
+
setFieldValue: props.setFieldValue,
|
|
2624
|
+
onBlur: props.handleBlur,
|
|
2625
|
+
component: element.type === 'checkbox' ? CheckboxField : element.type === 'select' ? SelectField : element.type === 'phone' ? FormikPhoneNumberField : CustomField,
|
|
2511
2626
|
selectOptions: element.name === 'country' ? countries : element.name === 'state' ? states : [],
|
|
2512
2627
|
theme: theme
|
|
2513
2628
|
})));
|
|
@@ -2579,73 +2694,6 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2579
2694
|
}));
|
|
2580
2695
|
};
|
|
2581
2696
|
|
|
2582
|
-
var currencyNormalizerCreator = function currencyNormalizerCreator(value, currency) {
|
|
2583
|
-
return !value ? '' : "" + getCurrencySymbolByCurrency(currency) + value;
|
|
2584
|
-
};
|
|
2585
|
-
var createFixedFloatNormalizer = function createFixedFloatNormalizer(fixedValue) {
|
|
2586
|
-
return function (value) {
|
|
2587
|
-
return value || "" + value === '0' ? (+value).toFixed(fixedValue) : '';
|
|
2588
|
-
};
|
|
2589
|
-
};
|
|
2590
|
-
var getCurrencySymbolByCurrency = function getCurrencySymbolByCurrency(currency) {
|
|
2591
|
-
if (currency === void 0) {
|
|
2592
|
-
currency = '';
|
|
2593
|
-
}
|
|
2594
|
-
|
|
2595
|
-
switch (currency) {
|
|
2596
|
-
case 'GBP':
|
|
2597
|
-
return '£';
|
|
2598
|
-
|
|
2599
|
-
case 'EUR':
|
|
2600
|
-
return '€';
|
|
2601
|
-
|
|
2602
|
-
case 'INR':
|
|
2603
|
-
return '₹';
|
|
2604
|
-
|
|
2605
|
-
case 'JMD':
|
|
2606
|
-
return 'J$';
|
|
2607
|
-
|
|
2608
|
-
case 'NZD':
|
|
2609
|
-
return 'NZ$';
|
|
2610
|
-
|
|
2611
|
-
case 'MYR':
|
|
2612
|
-
return 'RM';
|
|
2613
|
-
|
|
2614
|
-
case 'MXN':
|
|
2615
|
-
return 'Mex$';
|
|
2616
|
-
|
|
2617
|
-
case 'SGD':
|
|
2618
|
-
return 'S$';
|
|
2619
|
-
|
|
2620
|
-
case 'AUD':
|
|
2621
|
-
return 'A$';
|
|
2622
|
-
|
|
2623
|
-
case 'ZAR':
|
|
2624
|
-
return 'R';
|
|
2625
|
-
|
|
2626
|
-
case 'ke':
|
|
2627
|
-
return 'Ksh';
|
|
2628
|
-
|
|
2629
|
-
case 'TRY':
|
|
2630
|
-
return '₺';
|
|
2631
|
-
|
|
2632
|
-
case 'CAD':
|
|
2633
|
-
return 'CA$';
|
|
2634
|
-
|
|
2635
|
-
case 'THB':
|
|
2636
|
-
return '฿';
|
|
2637
|
-
|
|
2638
|
-
case 'ISK':
|
|
2639
|
-
return 'Kr';
|
|
2640
|
-
|
|
2641
|
-
case 'SEK':
|
|
2642
|
-
return 'kr';
|
|
2643
|
-
|
|
2644
|
-
default:
|
|
2645
|
-
return 'US$';
|
|
2646
|
-
}
|
|
2647
|
-
};
|
|
2648
|
-
|
|
2649
2697
|
var options = {
|
|
2650
2698
|
style: {
|
|
2651
2699
|
base: {
|
|
@@ -3178,31 +3226,108 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3178
3226
|
})))))));
|
|
3179
3227
|
};
|
|
3180
3228
|
|
|
3181
|
-
var
|
|
3229
|
+
var SocialButtons = function SocialButtons(_ref) {
|
|
3230
|
+
var showDefaultShareButtons = _ref.showDefaultShareButtons,
|
|
3231
|
+
shareLink = _ref.shareLink,
|
|
3232
|
+
name = _ref.name,
|
|
3233
|
+
appId = _ref.appId,
|
|
3234
|
+
shareButtons = _ref.shareButtons;
|
|
3235
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
3236
|
+
className: "convenient_buttons"
|
|
3237
|
+
}, "or use one of these convenient buttons:"), React__default.createElement("div", {
|
|
3238
|
+
className: "social-media-btns"
|
|
3239
|
+
}, showDefaultShareButtons && React__default.createElement(React__default.Fragment, null, React__default.createElement(reactShare.FacebookShareButton, {
|
|
3240
|
+
url: shareLink,
|
|
3241
|
+
quote: name
|
|
3242
|
+
}, React__default.createElement("div", {
|
|
3243
|
+
className: 'social-media-sharing'
|
|
3244
|
+
}, React__default.createElement("div", {
|
|
3245
|
+
className: 'share-icon'
|
|
3246
|
+
}, React__default.createElement(reactShare.FacebookIcon, {
|
|
3247
|
+
size: 32,
|
|
3248
|
+
round: true
|
|
3249
|
+
})), React__default.createElement("span", {
|
|
3250
|
+
className: "share-text"
|
|
3251
|
+
}, "Share on", React__default.createElement("br", null), " Facebook"))), React__default.createElement(reactShare.TwitterShareButton, {
|
|
3252
|
+
url: shareLink,
|
|
3253
|
+
title: name
|
|
3254
|
+
}, React__default.createElement("div", {
|
|
3255
|
+
className: 'social-media-sharing'
|
|
3256
|
+
}, React__default.createElement("div", {
|
|
3257
|
+
className: 'share-icon'
|
|
3258
|
+
}, React__default.createElement(reactShare.TwitterIcon, {
|
|
3259
|
+
size: 32,
|
|
3260
|
+
round: true
|
|
3261
|
+
})), React__default.createElement("span", {
|
|
3262
|
+
className: "share-text"
|
|
3263
|
+
}, "Tweet to your", React__default.createElement("br", null), " Followers"))), React__default.createElement(reactShare.FacebookMessengerShareButton, {
|
|
3264
|
+
url: shareLink,
|
|
3265
|
+
appId: appId
|
|
3266
|
+
}, React__default.createElement("div", {
|
|
3267
|
+
className: 'social-media-sharing'
|
|
3268
|
+
}, React__default.createElement("div", {
|
|
3269
|
+
className: 'share-icon'
|
|
3270
|
+
}, React__default.createElement(reactShare.FacebookMessengerIcon, {
|
|
3271
|
+
size: 32,
|
|
3272
|
+
round: true
|
|
3273
|
+
})), React__default.createElement("span", {
|
|
3274
|
+
className: "share-text"
|
|
3275
|
+
}, "Message friends on", React__default.createElement("br", null), " Facebook"))), React__default.createElement(reactShare.WhatsappShareButton, {
|
|
3276
|
+
url: shareLink,
|
|
3277
|
+
title: name
|
|
3278
|
+
}, React__default.createElement("div", {
|
|
3279
|
+
className: 'social-media-sharing'
|
|
3280
|
+
}, React__default.createElement("div", {
|
|
3281
|
+
className: 'share-icon'
|
|
3282
|
+
}, React__default.createElement(reactShare.WhatsappIcon, {
|
|
3283
|
+
size: 32,
|
|
3284
|
+
round: true
|
|
3285
|
+
})), React__default.createElement("span", {
|
|
3286
|
+
className: "share-text"
|
|
3287
|
+
}, "Message friends on", React__default.createElement("br", null), " Whatsapp")))), shareButtons.map(function (shareButton, index) {
|
|
3288
|
+
return React__default.createElement("div", {
|
|
3289
|
+
className: 'sharing-btn',
|
|
3290
|
+
key: index
|
|
3291
|
+
}, React__default.createElement("a", {
|
|
3292
|
+
href: shareButton.link,
|
|
3293
|
+
target: "_blank",
|
|
3294
|
+
rel: "noopener noreferrer"
|
|
3295
|
+
}, React__default.createElement("div", {
|
|
3296
|
+
className: 'social-media-sharing'
|
|
3297
|
+
}, React__default.createElement("div", {
|
|
3298
|
+
className: 'share-icon'
|
|
3299
|
+
}, React__default.createElement(SVG, {
|
|
3300
|
+
width: '32px',
|
|
3301
|
+
height: '32px',
|
|
3302
|
+
fill: '#FFF',
|
|
3303
|
+
src: getImage(shareButton.icon)
|
|
3304
|
+
})), React__default.createElement("span", {
|
|
3305
|
+
className: "share-text"
|
|
3306
|
+
}, shareButton.mainLabel, React__default.createElement("br", null), " ", shareButton.subLabel))));
|
|
3307
|
+
})));
|
|
3308
|
+
};
|
|
3309
|
+
|
|
3182
3310
|
var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
3183
3311
|
var isReferralEnabled = _ref.isReferralEnabled,
|
|
3184
|
-
|
|
3185
|
-
|
|
3312
|
+
showDefaultShareButtons = _ref.showDefaultShareButtons,
|
|
3313
|
+
_ref$messengerAppId = _ref.messengerAppId,
|
|
3314
|
+
messengerAppId = _ref$messengerAppId === void 0 ? '' : _ref$messengerAppId,
|
|
3186
3315
|
_ref$shareButtons = _ref.shareButtons,
|
|
3187
3316
|
shareButtons = _ref$shareButtons === void 0 ? [] : _ref$shareButtons,
|
|
3188
|
-
_ref$shareLink = _ref.shareLink,
|
|
3189
|
-
shareLink = _ref$shareLink === void 0 ? '' : _ref$shareLink,
|
|
3190
3317
|
_ref$onGetConfirmatio = _ref.onGetConfirmationDataSuccess,
|
|
3191
3318
|
onGetConfirmationDataSuccess = _ref$onGetConfirmatio === void 0 ? function () {} : _ref$onGetConfirmatio,
|
|
3192
3319
|
_ref$onGetConfirmatio2 = _ref.onGetConfirmationDataError,
|
|
3193
3320
|
onGetConfirmationDataError = _ref$onGetConfirmatio2 === void 0 ? function () {} : _ref$onGetConfirmatio2;
|
|
3194
3321
|
var inputRef = React.useRef(null);
|
|
3195
3322
|
|
|
3196
|
-
var _useState = React.useState(
|
|
3323
|
+
var _useState = React.useState(null),
|
|
3197
3324
|
data = _useState[0],
|
|
3198
|
-
setData = _useState[1];
|
|
3325
|
+
setData = _useState[1]; // 1. get payment complete data ---> v1/order/${orderHash}/payment/complete/
|
|
3199
3326
|
|
|
3200
|
-
var showShareButtons = Boolean(shareButtons.length);
|
|
3201
|
-
var showReferralPromotions = Boolean(referralPromotions.length); // 1. get payment complete data ---> v1/order/${orderHash}/payment/complete/
|
|
3202
3327
|
|
|
3203
3328
|
React.useEffect(function () {
|
|
3204
3329
|
_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
3205
|
-
var dataEncoded, dataDecoded, hash, response, _data;
|
|
3330
|
+
var dataEncoded, dataDecoded, hash, _data$product_price, response, _data;
|
|
3206
3331
|
|
|
3207
3332
|
return runtime_1.wrap(function _callee$(_context) {
|
|
3208
3333
|
while (1) {
|
|
@@ -3211,7 +3336,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
3211
3336
|
dataEncoded = typeof window !== 'undefined' && window.localStorage.getItem('checkoutData');
|
|
3212
3337
|
|
|
3213
3338
|
if (!dataEncoded) {
|
|
3214
|
-
_context.next =
|
|
3339
|
+
_context.next = 18;
|
|
3215
3340
|
break;
|
|
3216
3341
|
}
|
|
3217
3342
|
|
|
@@ -3224,27 +3349,60 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
3224
3349
|
case 7:
|
|
3225
3350
|
response = _context.sent;
|
|
3226
3351
|
_data = _get(response, 'data.data.attributes');
|
|
3352
|
+
_data.personal_share_sales = _data.personal_share_sales.map(function (d) {
|
|
3353
|
+
var salesData = {
|
|
3354
|
+
label: "If your friends buy " + d.sales + " tickets",
|
|
3355
|
+
price: ''
|
|
3356
|
+
};
|
|
3357
|
+
|
|
3358
|
+
if (d.price === 0) {
|
|
3359
|
+
salesData.subLabel = 'Your ticket becomes';
|
|
3360
|
+
salesData.price = 'FREE!';
|
|
3361
|
+
} else {
|
|
3362
|
+
var _d$price;
|
|
3363
|
+
|
|
3364
|
+
salesData.subLabel = 'Your ticket goes down to';
|
|
3365
|
+
salesData.price = _data.currency.symbol + ((_d$price = d.price) == null ? void 0 : _d$price.toFixed(2));
|
|
3366
|
+
}
|
|
3367
|
+
|
|
3368
|
+
return salesData;
|
|
3369
|
+
});
|
|
3370
|
+
|
|
3371
|
+
_data.personal_share_sales.unshift({
|
|
3372
|
+
label: 'Your ticket is currently',
|
|
3373
|
+
price: _data.currency.symbol + ((_data$product_price = _data.product_price) == null ? void 0 : _data$product_price.toFixed(2))
|
|
3374
|
+
});
|
|
3375
|
+
|
|
3227
3376
|
setData(_data);
|
|
3228
3377
|
onGetConfirmationDataSuccess(response.data);
|
|
3229
|
-
_context.next =
|
|
3378
|
+
_context.next = 18;
|
|
3230
3379
|
break;
|
|
3231
3380
|
|
|
3232
|
-
case
|
|
3233
|
-
_context.prev =
|
|
3381
|
+
case 15:
|
|
3382
|
+
_context.prev = 15;
|
|
3234
3383
|
_context.t0 = _context["catch"](4);
|
|
3235
3384
|
onGetConfirmationDataError(_context.t0.response);
|
|
3236
3385
|
|
|
3237
|
-
case
|
|
3386
|
+
case 18:
|
|
3238
3387
|
case "end":
|
|
3239
3388
|
return _context.stop();
|
|
3240
3389
|
}
|
|
3241
3390
|
}
|
|
3242
|
-
}, _callee, null, [[4,
|
|
3391
|
+
}, _callee, null, [[4, 15]]);
|
|
3243
3392
|
}))();
|
|
3244
3393
|
}, []);
|
|
3394
|
+
|
|
3395
|
+
var onChangeShareLink = function onChangeShareLink(e) {
|
|
3396
|
+
var newData = _extends({}, data, {
|
|
3397
|
+
personal_share_link: e.target.value
|
|
3398
|
+
});
|
|
3399
|
+
|
|
3400
|
+
setData(newData);
|
|
3401
|
+
};
|
|
3402
|
+
|
|
3245
3403
|
return React__default.createElement("div", {
|
|
3246
3404
|
className: "confirmation-page"
|
|
3247
|
-
}, React__default.createElement("p", {
|
|
3405
|
+
}, data && React__default.createElement(React__default.Fragment, null, React__default.createElement("p", {
|
|
3248
3406
|
className: "title"
|
|
3249
3407
|
}, "Your Tickets are Confirmed!"), React__default.createElement("div", {
|
|
3250
3408
|
className: "share-message-section"
|
|
@@ -3269,7 +3427,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
3269
3427
|
}, " Invite friends "), "and we'll refund up to", React__default.createElement("span", {
|
|
3270
3428
|
className: "strong-text"
|
|
3271
3429
|
}, " 100% "), "of your ticket money, if they buy tickets as well!")), React__default.createElement("img", {
|
|
3272
|
-
src:
|
|
3430
|
+
src: data.product_image,
|
|
3273
3431
|
alt: "No Data"
|
|
3274
3432
|
})), React__default.createElement("div", {
|
|
3275
3433
|
className: "share_wrapper"
|
|
@@ -3282,65 +3440,46 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
3282
3440
|
}, "How do you invite your friends?"), React__default.createElement("div", {
|
|
3283
3441
|
className: "share_buttons"
|
|
3284
3442
|
}, React__default.createElement("div", {
|
|
3285
|
-
className: "
|
|
3443
|
+
className: "share-by-link"
|
|
3286
3444
|
}, React__default.createElement("h5", {
|
|
3287
|
-
className: "
|
|
3445
|
+
className: "share-by-link label"
|
|
3288
3446
|
}, "Send them this link:"), React__default.createElement("div", {
|
|
3289
|
-
"
|
|
3290
|
-
className: "share-btn-inner share-by-link-copy",
|
|
3291
|
-
onClick: function onClick() {
|
|
3292
|
-
return navigator.clipboard.writeText(_get(inputRef, 'current.value'));
|
|
3293
|
-
}
|
|
3447
|
+
className: "share-btn-inner"
|
|
3294
3448
|
}, React__default.createElement("input", {
|
|
3295
3449
|
ref: inputRef,
|
|
3296
3450
|
className: "share-input",
|
|
3297
|
-
value:
|
|
3298
|
-
|
|
3451
|
+
value: data.personal_share_link,
|
|
3452
|
+
onChange: onChangeShareLink
|
|
3299
3453
|
}), React__default.createElement("div", {
|
|
3300
|
-
className:
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
})))),
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
}, React__default.createElement("div", {
|
|
3315
|
-
"aria-hidden": true,
|
|
3316
|
-
className: "share-btn-inner " + shareButtonItem.containerInnerClassName,
|
|
3317
|
-
onClick: function onClick() {}
|
|
3318
|
-
}, React__default.createElement(SVG, {
|
|
3319
|
-
className: shareButtonItem.svgClassName || 'share-icon',
|
|
3320
|
-
width: shareButtonItem.svgWidth || '40px',
|
|
3321
|
-
height: shareButtonItem.svgHeight || '40px',
|
|
3322
|
-
fill: shareButtonItem.svgFill || '#FFF',
|
|
3323
|
-
src: shareButtonItem.svgSrc || defaultSvg
|
|
3324
|
-
}), React__default.createElement("span", {
|
|
3325
|
-
className: "share-text"
|
|
3326
|
-
}, shareButtonItem.mainLabel, React__default.createElement("br", null), " ", shareButtonItem.subLabel)));
|
|
3327
|
-
})))))), showReferralPromotions && React__default.createElement("div", {
|
|
3454
|
+
className: 'share-by-link-copy-icon',
|
|
3455
|
+
onClick: function onClick() {
|
|
3456
|
+
return navigator.clipboard.writeText(_get(inputRef, 'current.value'));
|
|
3457
|
+
}
|
|
3458
|
+
}, React__default.createElement("img", {
|
|
3459
|
+
src: "https://img.icons8.com/office/50/000000/copy.png",
|
|
3460
|
+
alt: 'copy'
|
|
3461
|
+
})))), (showDefaultShareButtons || !!shareButtons.length) && React__default.createElement(SocialButtons, {
|
|
3462
|
+
showDefaultShareButtons: showDefaultShareButtons,
|
|
3463
|
+
name: data.product_name,
|
|
3464
|
+
appId: messengerAppId,
|
|
3465
|
+
shareLink: data.personal_share_link,
|
|
3466
|
+
shareButtons: shareButtons
|
|
3467
|
+
})))), React__default.createElement("div", {
|
|
3328
3468
|
className: "pricing-section"
|
|
3329
3469
|
}, React__default.createElement("div", {
|
|
3330
3470
|
className: "invitation_title"
|
|
3331
|
-
}, "How much cheaper?"), _map(
|
|
3332
|
-
var isFree = pricing.price === 'FREE';
|
|
3471
|
+
}, "How much cheaper?"), _map(data.personal_share_sales, function (pricing, index) {
|
|
3333
3472
|
return React__default.createElement("div", {
|
|
3334
|
-
key:
|
|
3335
|
-
className:
|
|
3473
|
+
key: index,
|
|
3474
|
+
className: 'pricing-section_wrapper'
|
|
3336
3475
|
}, React__default.createElement("div", {
|
|
3337
3476
|
className: "pricing-section_label"
|
|
3338
|
-
}, pricing.label
|
|
3477
|
+
}, pricing.label, pricing.subLabel && React__default.createElement("div", {
|
|
3339
3478
|
className: "pricing-section_sublabel"
|
|
3340
|
-
}, pricing.subLabel
|
|
3479
|
+
}, pricing.subLabel)), React__default.createElement("div", {
|
|
3341
3480
|
className: "pricing-section_price"
|
|
3342
3481
|
}, ' ', pricing.price));
|
|
3343
|
-
})))));
|
|
3482
|
+
}))))));
|
|
3344
3483
|
};
|
|
3345
3484
|
|
|
3346
3485
|
var getTicketSelectOptions = function getTicketSelectOptions(maxCount, minCount, multiplier) {
|