tf-checkout-react 1.3.5 → 1.3.7
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/ticketsContainer/PromoCodeSection.d.ts +3 -1
- package/dist/images/xmark.svg +92 -0
- package/dist/tf-checkout-react.cjs.development.js +32 -13
- 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 +32 -13
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/images/xmark.svg +92 -0
- package/src/components/confirmationContainer/index.tsx +7 -0
- package/src/components/ticketsContainer/PromoCodeSection.tsx +16 -4
- package/src/components/ticketsContainer/index.tsx +4 -0
- package/src/env.ts +3 -3
|
@@ -7,5 +7,7 @@ export interface IPromoCodeSectionProps {
|
|
|
7
7
|
setShowPromoInput: (value: boolean) => void;
|
|
8
8
|
updateTickets: (value: boolean, type: string) => void;
|
|
9
9
|
setCodeIsApplied: (value: boolean) => void;
|
|
10
|
+
codeIsInvalid: boolean;
|
|
11
|
+
setCodeIsInvalid: (value: boolean) => void;
|
|
10
12
|
}
|
|
11
|
-
export declare const PromoCodeSection: ({ code, codeIsApplied, showPromoInput, setCode, setShowPromoInput, updateTickets, setCodeIsApplied }: IPromoCodeSectionProps) => JSX.Element;
|
|
13
|
+
export declare const PromoCodeSection: ({ code, codeIsApplied, showPromoInput, setCode, setShowPromoInput, updateTickets, setCodeIsApplied, codeIsInvalid, setCodeIsInvalid }: IPromoCodeSectionProps) => JSX.Element;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<svg
|
|
3
|
+
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
|
|
4
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
5
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
6
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
7
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
10
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
11
|
+
viewBox="0 0 48 48"
|
|
12
|
+
version="1.1"
|
|
13
|
+
id="svg15"
|
|
14
|
+
sodipodi:docname="cross red circle.svg"
|
|
15
|
+
inkscape:version="0.92.3 (2405546, 2018-03-11)">
|
|
16
|
+
<metadata
|
|
17
|
+
id="metadata19">
|
|
18
|
+
<rdf:RDF>
|
|
19
|
+
<cc:Work
|
|
20
|
+
rdf:about="">
|
|
21
|
+
<dc:format>image/svg+xml</dc:format>
|
|
22
|
+
<dc:type
|
|
23
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
24
|
+
<dc:title />
|
|
25
|
+
</cc:Work>
|
|
26
|
+
</rdf:RDF>
|
|
27
|
+
</metadata>
|
|
28
|
+
<sodipodi:namedview
|
|
29
|
+
pagecolor="#ffffff"
|
|
30
|
+
bordercolor="#666666"
|
|
31
|
+
borderopacity="1"
|
|
32
|
+
objecttolerance="10"
|
|
33
|
+
gridtolerance="10"
|
|
34
|
+
guidetolerance="10"
|
|
35
|
+
inkscape:pageopacity="0"
|
|
36
|
+
inkscape:pageshadow="2"
|
|
37
|
+
inkscape:window-width="1920"
|
|
38
|
+
inkscape:window-height="1027"
|
|
39
|
+
id="namedview17"
|
|
40
|
+
showgrid="false"
|
|
41
|
+
inkscape:zoom="4.9166667"
|
|
42
|
+
inkscape:cx="-11.694915"
|
|
43
|
+
inkscape:cy="40.271186"
|
|
44
|
+
inkscape:window-x="-8"
|
|
45
|
+
inkscape:window-y="-8"
|
|
46
|
+
inkscape:window-maximized="1"
|
|
47
|
+
inkscape:current-layer="g13" />
|
|
48
|
+
<defs
|
|
49
|
+
id="defs7">
|
|
50
|
+
<linearGradient
|
|
51
|
+
id="linearGradient828"
|
|
52
|
+
osb:paint="solid">
|
|
53
|
+
<stop
|
|
54
|
+
style="stop-color:#ff0000;stop-opacity:1;"
|
|
55
|
+
offset="0"
|
|
56
|
+
id="stop826" />
|
|
57
|
+
</linearGradient>
|
|
58
|
+
<linearGradient
|
|
59
|
+
id="0"
|
|
60
|
+
gradientUnits="userSpaceOnUse"
|
|
61
|
+
y1="47.37"
|
|
62
|
+
x2="0"
|
|
63
|
+
y2="-1.429">
|
|
64
|
+
<stop
|
|
65
|
+
stop-color="#c52828"
|
|
66
|
+
id="stop2" />
|
|
67
|
+
<stop
|
|
68
|
+
offset="1"
|
|
69
|
+
stop-color="#ff5454"
|
|
70
|
+
id="stop4" />
|
|
71
|
+
</linearGradient>
|
|
72
|
+
</defs>
|
|
73
|
+
<g
|
|
74
|
+
transform="matrix(.99999 0 0 .99999-58.37.882)"
|
|
75
|
+
enable-background="new"
|
|
76
|
+
id="g13"
|
|
77
|
+
style="fill-opacity:1">
|
|
78
|
+
<circle
|
|
79
|
+
cx="82.37"
|
|
80
|
+
cy="23.12"
|
|
81
|
+
r="24"
|
|
82
|
+
fill="url(#0)"
|
|
83
|
+
id="circle9"
|
|
84
|
+
style="fill-opacity:1;fill:#dd3333" />
|
|
85
|
+
<path
|
|
86
|
+
d="m87.77 23.725l5.939-5.939c.377-.372.566-.835.566-1.373 0-.54-.189-.997-.566-1.374l-2.747-2.747c-.377-.372-.835-.564-1.373-.564-.539 0-.997.186-1.374.564l-5.939 5.939-5.939-5.939c-.377-.372-.835-.564-1.374-.564-.539 0-.997.186-1.374.564l-2.748 2.747c-.377.378-.566.835-.566 1.374 0 .54.188.997.566 1.373l5.939 5.939-5.939 5.94c-.377.372-.566.835-.566 1.373 0 .54.188.997.566 1.373l2.748 2.747c.377.378.835.564 1.374.564.539 0 .997-.186 1.374-.564l5.939-5.939 5.94 5.939c.377.378.835.564 1.374.564.539 0 .997-.186 1.373-.564l2.747-2.747c.377-.372.566-.835.566-1.373 0-.54-.188-.997-.566-1.373l-5.939-5.94"
|
|
87
|
+
fill="#fff"
|
|
88
|
+
fill-opacity=".842"
|
|
89
|
+
id="path11"
|
|
90
|
+
style="fill-opacity:1;fill:#ffffff" />
|
|
91
|
+
</g>
|
|
92
|
+
</svg>
|
|
@@ -4735,7 +4735,10 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4735
4735
|
className: "main"
|
|
4736
4736
|
}, confirmationMain), React__default.createElement("span", {
|
|
4737
4737
|
className: "helper"
|
|
4738
|
-
}, data.attach_tickets ? 'Please bring them with you to the event' : confirmationHelper)))), data.
|
|
4738
|
+
}, data.attach_tickets ? 'Please bring them with you to the event' : confirmationHelper)))), data.custom_confirmation_page_text ? React__default.createElement("div", {
|
|
4739
|
+
className: 'custom-confirmation-page-text',
|
|
4740
|
+
dangerouslySetInnerHTML: createMarkup(data.custom_confirmation_page_text)
|
|
4741
|
+
}) : null, data.disable_referral === false && isReferralEnabled && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
4739
4742
|
className: "referral_text_image_section"
|
|
4740
4743
|
}, React__default.createElement("div", {
|
|
4741
4744
|
className: "referral_text_section"
|
|
@@ -5102,7 +5105,9 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
5102
5105
|
setCode = _ref.setCode,
|
|
5103
5106
|
setShowPromoInput = _ref.setShowPromoInput,
|
|
5104
5107
|
updateTickets = _ref.updateTickets,
|
|
5105
|
-
setCodeIsApplied = _ref.setCodeIsApplied
|
|
5108
|
+
setCodeIsApplied = _ref.setCodeIsApplied,
|
|
5109
|
+
codeIsInvalid = _ref.codeIsInvalid,
|
|
5110
|
+
setCodeIsInvalid = _ref.setCodeIsInvalid;
|
|
5106
5111
|
var isPromoCodeHasValue = !!code.trim();
|
|
5107
5112
|
|
|
5108
5113
|
var renderInputField = function renderInputField() {
|
|
@@ -5144,12 +5149,19 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
5144
5149
|
}
|
|
5145
5150
|
}), React__default.createElement("p", {
|
|
5146
5151
|
className: "promo-code-success"
|
|
5147
|
-
}, "PROMO CODE APPLIED SUCCESSFULLY")) : null,
|
|
5152
|
+
}, "PROMO CODE APPLIED SUCCESSFULLY")) : null, codeIsInvalid ? React__default.createElement("div", {
|
|
5153
|
+
className: "alert-info fail"
|
|
5154
|
+
}, React__default.createElement(SVG, {
|
|
5155
|
+
src: getImage('xmark.svg')
|
|
5156
|
+
}), React__default.createElement("p", {
|
|
5157
|
+
className: "promo-code-fail"
|
|
5158
|
+
}, "Invalid Promo Code")) : null, !showPromoInput && React__default.createElement(Button$1, {
|
|
5148
5159
|
className: "promo-code-button",
|
|
5149
5160
|
placeholder: "Promo Codes",
|
|
5150
5161
|
onClick: function onClick() {
|
|
5151
5162
|
setCodeIsApplied(false);
|
|
5152
5163
|
setShowPromoInput(true);
|
|
5164
|
+
setCodeIsInvalid(false);
|
|
5153
5165
|
}
|
|
5154
5166
|
}, "Got a promo code? Click here"), showPromoInput && renderInputField());
|
|
5155
5167
|
};
|
|
@@ -5433,17 +5445,21 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5433
5445
|
codeIsApplied = _useState12[0],
|
|
5434
5446
|
setCodeIsApplied = _useState12[1];
|
|
5435
5447
|
|
|
5436
|
-
var _useState13 = React.useState(
|
|
5437
|
-
|
|
5438
|
-
|
|
5448
|
+
var _useState13 = React.useState(false),
|
|
5449
|
+
codeIsInvalid = _useState13[0],
|
|
5450
|
+
setCodeIsInvalid = _useState13[1];
|
|
5439
5451
|
|
|
5440
|
-
var _useState14 = React.useState(
|
|
5441
|
-
|
|
5442
|
-
|
|
5452
|
+
var _useState14 = React.useState(isAccessCodeEnabled),
|
|
5453
|
+
showAccessCodeSection = _useState14[0],
|
|
5454
|
+
setShowAccessCodeSection = _useState14[1];
|
|
5443
5455
|
|
|
5444
|
-
var _useState15 = React.useState(
|
|
5445
|
-
|
|
5446
|
-
|
|
5456
|
+
var _useState15 = React.useState(isPromotionsEnabled),
|
|
5457
|
+
showPromoCodeSection = _useState15[0],
|
|
5458
|
+
setShowPromoCodeSection = _useState15[1];
|
|
5459
|
+
|
|
5460
|
+
var _useState16 = React.useState(null),
|
|
5461
|
+
error = _useState16[0],
|
|
5462
|
+
setError = _useState16[1];
|
|
5447
5463
|
|
|
5448
5464
|
var ticketsContainerRef = React.useRef(null);
|
|
5449
5465
|
React.useEffect(function () {
|
|
@@ -5555,6 +5571,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5555
5571
|
if (response.data.success) {
|
|
5556
5572
|
attributes = _get(response, 'data.data.attributes');
|
|
5557
5573
|
type === 'promo' && setCodeIsApplied(attributes.ValidPromoCode);
|
|
5574
|
+
type === 'promo' && setCodeIsInvalid(!attributes.ValidPromoCode);
|
|
5558
5575
|
setTickets(_get(attributes, 'tickets'));
|
|
5559
5576
|
setShowWaitingList(attributes.showWaitingList);
|
|
5560
5577
|
onGetTicketsSuccess(response.data);
|
|
@@ -5874,7 +5891,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5874
5891
|
showPromoInput: showPromoInput,
|
|
5875
5892
|
setShowPromoInput: setShowPromoInput,
|
|
5876
5893
|
setCode: setCode,
|
|
5877
|
-
updateTickets: updateTickets
|
|
5894
|
+
updateTickets: updateTickets,
|
|
5895
|
+
codeIsInvalid: codeIsInvalid,
|
|
5896
|
+
setCodeIsInvalid: setCodeIsInvalid
|
|
5878
5897
|
}) : null, wrappedActionsSectionComponent, canShowGetTicketBtn() && React__default.createElement(Button$1, {
|
|
5879
5898
|
"aria-hidden": true,
|
|
5880
5899
|
className: "book-button \n " + (bookButtonIsDisabled ? 'disabled' : '') + " \n " + (isButtonScrollable ? 'is-scrollable' : '') + "\n " + (!isLoggedIn ? 'on-bottom' : '') + "\n ",
|