tf-checkout-react 1.0.72 → 1.0.73
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/billing-info-container/index.d.ts +2 -1
- package/dist/components/ticketsContainer/PromoCodeSection.d.ts +12 -0
- package/dist/components/ticketsContainer/index.d.ts +2 -1
- package/dist/components/waitingList/index.d.ts +2 -1
- package/dist/images/done.svg +3 -0
- package/dist/tf-checkout-react.cjs.development.js +96 -63
- 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 +101 -68
- 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/assets/images/done.svg +3 -0
- package/src/components/billing-info-container/index.tsx +22 -12
- package/src/components/paymentContainer/index.tsx +20 -10
- package/src/components/ticketsContainer/PromoCodeSection.tsx +82 -0
- package/src/components/ticketsContainer/index.tsx +45 -69
- package/src/components/ticketsContainer/style.css +6 -4
- package/src/components/waitingList/index.tsx +7 -4
|
@@ -30,5 +30,6 @@ export interface IBillingInfoPage {
|
|
|
30
30
|
theme?: 'light' | 'dark';
|
|
31
31
|
isLoggedIn?: boolean;
|
|
32
32
|
fontFamily?: string;
|
|
33
|
+
hideLogo?: boolean;
|
|
33
34
|
}
|
|
34
|
-
export declare const BillingInfoContainer: ({ data, ticketHoldersFields, initialValues, buttonName, handleSubmit, theme, onRegisterSuccess, onRegisterError, onSubmitError, onGetCartSuccess, onGetCartError, onGetCountriesSuccess, onGetCountriesError, onGetStatesSuccess, onGetStatesError, onGetProfileDataSuccess, onGetProfileDataError, onAuthorizeSuccess, onAuthorizeError, onLogin, onLoginSuccess, isLoggedIn: pIsLoggedIn, fontFamily }: IBillingInfoPage) => JSX.Element;
|
|
35
|
+
export declare const BillingInfoContainer: ({ data, ticketHoldersFields, initialValues, buttonName, handleSubmit, theme, onRegisterSuccess, onRegisterError, onSubmitError, onGetCartSuccess, onGetCartError, onGetCountriesSuccess, onGetCountriesError, onGetStatesSuccess, onGetStatesError, onGetProfileDataSuccess, onGetProfileDataError, onAuthorizeSuccess, onAuthorizeError, onLogin, onLoginSuccess, isLoggedIn: pIsLoggedIn, fontFamily, hideLogo, }: IBillingInfoPage) => JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface IPromoCodeSectionProps {
|
|
3
|
+
promoCode: string;
|
|
4
|
+
promoCodeIsApplied: boolean;
|
|
5
|
+
showPromoInput: boolean;
|
|
6
|
+
isPromotionsEnabled: boolean;
|
|
7
|
+
isAllTicketsSoldOut: boolean;
|
|
8
|
+
setPromoCode: (value: string) => void;
|
|
9
|
+
setPromoCodeUpdated: (value: string) => void;
|
|
10
|
+
setShowPromoInput: (value: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const PromoCodeSection: ({ promoCode, promoCodeIsApplied, showPromoInput, isPromotionsEnabled, isAllTicketsSoldOut, setPromoCode, setPromoCodeUpdated, setShowPromoInput, }: IPromoCodeSectionProps) => JSX.Element;
|
|
@@ -17,6 +17,7 @@ export interface IGetTickets {
|
|
|
17
17
|
onGetTicketsError: (e: AxiosError) => void;
|
|
18
18
|
theme?: 'light' | 'dark';
|
|
19
19
|
queryPromoCode?: string;
|
|
20
|
+
isPromotionsEnabled?: boolean;
|
|
20
21
|
}
|
|
21
22
|
export interface ITicket {
|
|
22
23
|
id: string | number;
|
|
@@ -25,5 +26,5 @@ export interface ITicket {
|
|
|
25
26
|
export interface ISelectedTickets {
|
|
26
27
|
[key: string]: string | number;
|
|
27
28
|
}
|
|
28
|
-
export declare const TicketsContainer: ({ getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, theme, queryPromoCode }: IGetTickets) => JSX.Element;
|
|
29
|
+
export declare const TicketsContainer: ({ getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, theme, queryPromoCode, isPromotionsEnabled, }: IGetTickets) => JSX.Element;
|
|
29
30
|
export {};
|
|
@@ -3,6 +3,7 @@ import './style.css';
|
|
|
3
3
|
interface WaitingListProps {
|
|
4
4
|
tickets: any;
|
|
5
5
|
eventId: number;
|
|
6
|
+
isPromotionsEnabled: boolean;
|
|
6
7
|
}
|
|
7
|
-
declare const WaitingList: ({ tickets, eventId }: WaitingListProps) => JSX.Element;
|
|
8
|
+
declare const WaitingList: ({ tickets, eventId, isPromotionsEnabled }: WaitingListProps) => JSX.Element;
|
|
8
9
|
export default WaitingList;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 20C15.5228 20 20 15.5228 20 10C20 4.47717 15.5228 0 10 0C4.47717 0 0 4.47717 0 10C0 15.5228 4.47717 20 10 20ZM8.14661 15.8678L16.8782 6.39722C16.9561 6.31335 17 6.19922 17 6.08008C17 5.96094 16.9561 5.8468 16.8782 5.76282L16.3016 5.12854C16.1386 4.95715 15.8796 4.95715 15.7167 5.12854L7.85004 13.661L4.28326 9.79236C4.20593 9.70776 4.10071 9.66016 3.99084 9.66016C3.9353 9.66016 3.88086 9.67236 3.83069 9.69531C3.78168 9.71777 3.73663 9.75061 3.69843 9.79236L3.12183 10.4177C3.07635 10.4667 3.04248 10.5259 3.02216 10.5905C3.00763 10.6365 3 10.6853 3 10.735C3 10.8541 3.04388 10.9683 3.12183 11.0521L7.56177 15.8678C7.6391 15.9524 7.74438 16 7.85419 16C7.96399 16 8.06927 15.9524 8.14661 15.8678Z" fill="#569F44"/>
|
|
3
|
+
</svg>
|
|
@@ -43,6 +43,7 @@ var _has = _interopDefault(require('lodash/has'));
|
|
|
43
43
|
var FormControl = _interopDefault(require('@mui/material/FormControl'));
|
|
44
44
|
var MenuItem = _interopDefault(require('@mui/material/MenuItem'));
|
|
45
45
|
var Button$1 = _interopDefault(require('@mui/material/Button'));
|
|
46
|
+
var SVG = _interopDefault(require('react-inlinesvg'));
|
|
46
47
|
var Table = _interopDefault(require('@mui/material/Table'));
|
|
47
48
|
var TableBody = _interopDefault(require('@mui/material/TableBody'));
|
|
48
49
|
var TableCell = _interopDefault(require('@mui/material/TableCell'));
|
|
@@ -1971,22 +1972,6 @@ var FormikPhoneNumberField = function FormikPhoneNumberField(_ref) {
|
|
|
1971
1972
|
}, rest));
|
|
1972
1973
|
};
|
|
1973
1974
|
|
|
1974
|
-
var getImage = function getImage(name) {
|
|
1975
|
-
if (name === void 0) {
|
|
1976
|
-
name = '';
|
|
1977
|
-
}
|
|
1978
|
-
|
|
1979
|
-
var image = '';
|
|
1980
|
-
|
|
1981
|
-
if (!name.trim().length) {
|
|
1982
|
-
return image;
|
|
1983
|
-
}
|
|
1984
|
-
|
|
1985
|
-
return image;
|
|
1986
|
-
};
|
|
1987
|
-
|
|
1988
|
-
var TTFLOGO = /*#__PURE__*/getImage('logo-ttf.png');
|
|
1989
|
-
|
|
1990
1975
|
var LogicRunner = function LogicRunner(_ref) {
|
|
1991
1976
|
var values = _ref.values,
|
|
1992
1977
|
setStates = _ref.setStates,
|
|
@@ -2131,7 +2116,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2131
2116
|
onLoginSuccess = _ref3$onLoginSuccess === void 0 ? function () {} : _ref3$onLoginSuccess,
|
|
2132
2117
|
_ref3$isLoggedIn = _ref3.isLoggedIn,
|
|
2133
2118
|
pIsLoggedIn = _ref3$isLoggedIn === void 0 ? false : _ref3$isLoggedIn,
|
|
2134
|
-
fontFamily = _ref3.fontFamily
|
|
2119
|
+
fontFamily = _ref3.fontFamily,
|
|
2120
|
+
hideLogo = _ref3.hideLogo;
|
|
2135
2121
|
var themeMui = styles.createTheme({
|
|
2136
2122
|
typography: {
|
|
2137
2123
|
allVariants: {
|
|
@@ -2234,9 +2220,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2234
2220
|
setIsLoggedIn(false);
|
|
2235
2221
|
}, []);
|
|
2236
2222
|
React.useEffect(function () {
|
|
2237
|
-
isWindowDefined && window.document.addEventListener(
|
|
2223
|
+
isWindowDefined && window.document.addEventListener('auth_error', handleAuthErrors);
|
|
2238
2224
|
return function () {
|
|
2239
|
-
isWindowDefined && window.document.removeEventListener(
|
|
2225
|
+
isWindowDefined && window.document.removeEventListener('auth_error', handleAuthErrors);
|
|
2240
2226
|
};
|
|
2241
2227
|
}, [handleAuthErrors]);
|
|
2242
2228
|
React.useEffect(function () {
|
|
@@ -2585,10 +2571,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2585
2571
|
onLogin();
|
|
2586
2572
|
setShowModalLogin(true);
|
|
2587
2573
|
}
|
|
2588
|
-
}, "Login"), React__default.createElement("div", {
|
|
2574
|
+
}, "Login"), !hideLogo && React__default.createElement("div", {
|
|
2589
2575
|
className: "logo-image-container"
|
|
2590
2576
|
}, React__default.createElement("img", {
|
|
2591
|
-
src:
|
|
2577
|
+
src: theme === 'dark' ? 'https://www.ticketfairy.com/resources/images/logo-ttf.svg' : 'https://www.ticketfairy.com/resources/images/logo-ttf-black.svg',
|
|
2592
2578
|
alt: "nodata"
|
|
2593
2579
|
})))), _map(dataWithUniqueIds, function (item) {
|
|
2594
2580
|
var label = item.label,
|
|
@@ -2962,12 +2948,18 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2962
2948
|
|
|
2963
2949
|
var publishableKey = CONFIGS.STRIPE_PUBLISHABLE_KEY || '';
|
|
2964
2950
|
|
|
2965
|
-
var getStripePromise = function getStripePromise(
|
|
2966
|
-
|
|
2967
|
-
|
|
2951
|
+
var getStripePromise = function getStripePromise(reviewData) {
|
|
2952
|
+
var stripePublishableKey = _get(reviewData, 'payment_method.stripe_publishable_key') || publishableKey;
|
|
2953
|
+
|
|
2954
|
+
var stripeAccount = _get(reviewData, 'payment_method.stripe_connected_account');
|
|
2955
|
+
|
|
2956
|
+
var options = {};
|
|
2957
|
+
|
|
2958
|
+
if (stripeAccount) {
|
|
2959
|
+
options.stripeAccount = stripeAccount;
|
|
2968
2960
|
}
|
|
2969
2961
|
|
|
2970
|
-
return stripeJs.loadStripe(stripePublishableKey);
|
|
2962
|
+
return stripeJs.loadStripe(stripePublishableKey, options);
|
|
2971
2963
|
};
|
|
2972
2964
|
|
|
2973
2965
|
function Loader() {
|
|
@@ -3238,7 +3230,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3238
3230
|
}, "Please provide your payment information"), showErrorText && React__default.createElement("p", {
|
|
3239
3231
|
className: "payment_info__error"
|
|
3240
3232
|
}, errorText), React__default.createElement("div", null, React__default.createElement(reactStripeJs.Elements, {
|
|
3241
|
-
stripe: getStripePromise(
|
|
3233
|
+
stripe: getStripePromise(reviewData)
|
|
3242
3234
|
}, React__default.createElement(CheckoutForm, {
|
|
3243
3235
|
stripe_client_secret: _get(reviewData, 'payment_method.stripe_client_secret'),
|
|
3244
3236
|
total: orderData.total,
|
|
@@ -3742,7 +3734,8 @@ var generateQuantity = function generateQuantity(n) {
|
|
|
3742
3734
|
var WaitingList = function WaitingList(_ref) {
|
|
3743
3735
|
var _ref$tickets = _ref.tickets,
|
|
3744
3736
|
tickets = _ref$tickets === void 0 ? {} : _ref$tickets,
|
|
3745
|
-
eventId = _ref.eventId
|
|
3737
|
+
eventId = _ref.eventId,
|
|
3738
|
+
isPromotionsEnabled = _ref.isPromotionsEnabled;
|
|
3746
3739
|
|
|
3747
3740
|
var _useState = React.useState(false),
|
|
3748
3741
|
showSuccessMessage = _useState[0],
|
|
@@ -3817,7 +3810,7 @@ var WaitingList = function WaitingList(_ref) {
|
|
|
3817
3810
|
className: "success-message"
|
|
3818
3811
|
}, React__default.createElement("p", {
|
|
3819
3812
|
className: "added-success-message"
|
|
3820
|
-
}, "You've been added to the waiting list!"), React__default.createElement("p", null, "You'll be notified if tickets become available.")) : React__default.createElement(React__default.Fragment, null, React__default.createElement("p", {
|
|
3813
|
+
}, "You've been added to the waiting list!"), React__default.createElement("p", null, "You'll be notified if tickets become available.")) : React__default.createElement(React__default.Fragment, null, !isPromotionsEnabled && React__default.createElement("p", {
|
|
3821
3814
|
className: "no-tickets-text"
|
|
3822
3815
|
}, "No tickets are currently available for this event."), React__default.createElement("h2", null, "WAITING LIST"), React__default.createElement(formik.Formik, {
|
|
3823
3816
|
initialValues: {
|
|
@@ -3890,6 +3883,65 @@ var WaitingList = function WaitingList(_ref) {
|
|
|
3890
3883
|
}) : 'ADD TO WAITING LIST')))));
|
|
3891
3884
|
};
|
|
3892
3885
|
|
|
3886
|
+
var getImage = function getImage(name) {
|
|
3887
|
+
if (name === void 0) {
|
|
3888
|
+
name = '';
|
|
3889
|
+
}
|
|
3890
|
+
|
|
3891
|
+
var image = '';
|
|
3892
|
+
|
|
3893
|
+
if (!name.trim().length) {
|
|
3894
|
+
return image;
|
|
3895
|
+
}
|
|
3896
|
+
|
|
3897
|
+
return image;
|
|
3898
|
+
};
|
|
3899
|
+
|
|
3900
|
+
var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
3901
|
+
var promoCode = _ref.promoCode,
|
|
3902
|
+
promoCodeIsApplied = _ref.promoCodeIsApplied,
|
|
3903
|
+
showPromoInput = _ref.showPromoInput,
|
|
3904
|
+
isPromotionsEnabled = _ref.isPromotionsEnabled,
|
|
3905
|
+
isAllTicketsSoldOut = _ref.isAllTicketsSoldOut,
|
|
3906
|
+
setPromoCode = _ref.setPromoCode,
|
|
3907
|
+
setPromoCodeUpdated = _ref.setPromoCodeUpdated,
|
|
3908
|
+
setShowPromoInput = _ref.setShowPromoInput;
|
|
3909
|
+
return React__default.createElement("div", null, promoCodeIsApplied ? React__default.createElement("div", {
|
|
3910
|
+
className: "alert-info"
|
|
3911
|
+
}, React__default.createElement(SVG, {
|
|
3912
|
+
src: getImage('done.svg'),
|
|
3913
|
+
preProcessor: function preProcessor(code) {
|
|
3914
|
+
return code.replace(/fill=".*?"/g, 'fill="currentColor"');
|
|
3915
|
+
}
|
|
3916
|
+
}), React__default.createElement("p", null, "PROMO CODE APPLIED SUCCESSFULLY")) : null, showPromoInput && React__default.createElement("div", {
|
|
3917
|
+
className: "promo-code-block"
|
|
3918
|
+
}, React__default.createElement("input", {
|
|
3919
|
+
placeholder: "Promo Code",
|
|
3920
|
+
onChange: function onChange(e) {
|
|
3921
|
+
setPromoCode(e.target.value);
|
|
3922
|
+
},
|
|
3923
|
+
onKeyPress: function onKeyPress(event) {
|
|
3924
|
+
if (event.key === 'Enter') {
|
|
3925
|
+
setPromoCodeUpdated(promoCode);
|
|
3926
|
+
}
|
|
3927
|
+
}
|
|
3928
|
+
}), React__default.createElement(Button, {
|
|
3929
|
+
className: "promo-apply-button",
|
|
3930
|
+
placeholder: "Promo Code",
|
|
3931
|
+
onClick: function onClick() {
|
|
3932
|
+
setPromoCodeUpdated(promoCode);
|
|
3933
|
+
}
|
|
3934
|
+
}, "Apply")), isPromotionsEnabled && !showPromoInput && isAllTicketsSoldOut && React__default.createElement("p", {
|
|
3935
|
+
className: "promo-code-text"
|
|
3936
|
+
}, "Access code needed"), isPromotionsEnabled && !showPromoInput ? React__default.createElement(Button, {
|
|
3937
|
+
className: "promo-code-button",
|
|
3938
|
+
placeholder: "Promo Codes",
|
|
3939
|
+
onClick: function onClick() {
|
|
3940
|
+
setShowPromoInput(true);
|
|
3941
|
+
}
|
|
3942
|
+
}, "Got a promo code? Click here") : null);
|
|
3943
|
+
};
|
|
3944
|
+
|
|
3893
3945
|
function Loader$1() {
|
|
3894
3946
|
return React__default.createElement("div", {
|
|
3895
3947
|
className: "loader-container"
|
|
@@ -3911,7 +3963,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3911
3963
|
_ref$theme = _ref.theme,
|
|
3912
3964
|
theme = _ref$theme === void 0 ? 'light' : _ref$theme,
|
|
3913
3965
|
_ref$queryPromoCode = _ref.queryPromoCode,
|
|
3914
|
-
queryPromoCode = _ref$queryPromoCode === void 0 ? '' : _ref$queryPromoCode
|
|
3966
|
+
queryPromoCode = _ref$queryPromoCode === void 0 ? '' : _ref$queryPromoCode,
|
|
3967
|
+
_ref$isPromotionsEnab = _ref.isPromotionsEnabled,
|
|
3968
|
+
isPromotionsEnabled = _ref$isPromotionsEnab === void 0 ? true : _ref$isPromotionsEnab;
|
|
3915
3969
|
|
|
3916
3970
|
var _useState = React.useState({}),
|
|
3917
3971
|
selectedTickets = _useState[0],
|
|
@@ -4114,45 +4168,24 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4114
4168
|
return React__default.createElement("div", {
|
|
4115
4169
|
className: "get-tickets-page " + theme,
|
|
4116
4170
|
style: contentStyle
|
|
4117
|
-
}, isLoading ? React__default.createElement(Loader$1, null) : React__default.createElement(React__default.Fragment, null, showWaitingList
|
|
4171
|
+
}, isLoading ? React__default.createElement(Loader$1, null) : React__default.createElement(React__default.Fragment, null, showWaitingList && React__default.createElement(WaitingList, {
|
|
4118
4172
|
tickets: tickets,
|
|
4119
|
-
eventId: eventId
|
|
4120
|
-
|
|
4173
|
+
eventId: eventId,
|
|
4174
|
+
isPromotionsEnabled: isPromotionsEnabled
|
|
4175
|
+
}), React__default.createElement("div", null, !showWaitingList && React__default.createElement(TicketsSection, {
|
|
4121
4176
|
ticketsList: tickets,
|
|
4122
4177
|
selectedTickets: selectedTickets,
|
|
4123
4178
|
handleTicketSelect: handleTicketSelect,
|
|
4124
4179
|
promoCodeIsApplied: promoCodeIsApplied
|
|
4125
|
-
}),
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
onKeyPress: function onKeyPress(event) {
|
|
4135
|
-
if (event.key === 'Enter') {
|
|
4136
|
-
setPromoCodeUpdated(promoCode);
|
|
4137
|
-
}
|
|
4138
|
-
}
|
|
4139
|
-
}), React__default.createElement(Button, {
|
|
4140
|
-
className: "promo-apply-button",
|
|
4141
|
-
placeholder: "Promo Code",
|
|
4142
|
-
onClick: function onClick() {
|
|
4143
|
-
setPromoCodeUpdated(promoCode);
|
|
4144
|
-
}
|
|
4145
|
-
}, "Apply")), !showPromoInput && !isAllTicketsSoldOut ? React__default.createElement(Button, {
|
|
4146
|
-
className: "promo-code-button",
|
|
4147
|
-
placeholder: "Promo Codes",
|
|
4148
|
-
onClick: function onClick() {
|
|
4149
|
-
setShowPromoInput(true);
|
|
4150
|
-
}
|
|
4151
|
-
}, "Got a promo code? Click here") : null, React__default.createElement("div", {
|
|
4152
|
-
className: "test v1.0.19",
|
|
4153
|
-
style: {
|
|
4154
|
-
display: 'none'
|
|
4155
|
-
}
|
|
4180
|
+
}), React__default.createElement(PromoCodeSection, {
|
|
4181
|
+
promoCode: promoCode,
|
|
4182
|
+
promoCodeIsApplied: promoCodeIsApplied,
|
|
4183
|
+
showPromoInput: showPromoInput,
|
|
4184
|
+
setPromoCode: setPromoCode,
|
|
4185
|
+
setPromoCodeUpdated: setPromoCodeUpdated,
|
|
4186
|
+
setShowPromoInput: setShowPromoInput,
|
|
4187
|
+
isPromotionsEnabled: isPromotionsEnabled,
|
|
4188
|
+
isAllTicketsSoldOut: isAllTicketsSoldOut
|
|
4156
4189
|
}), !isAllTicketsSoldOut && React__default.createElement(Button, {
|
|
4157
4190
|
"aria-hidden": true,
|
|
4158
4191
|
className: "book-button " + (handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0 ? 'disabled' : ''),
|