tf-checkout-react 1.3.6 → 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 +28 -12
- 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 +28 -12
- 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/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>
|
|
@@ -5105,7 +5105,9 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
5105
5105
|
setCode = _ref.setCode,
|
|
5106
5106
|
setShowPromoInput = _ref.setShowPromoInput,
|
|
5107
5107
|
updateTickets = _ref.updateTickets,
|
|
5108
|
-
setCodeIsApplied = _ref.setCodeIsApplied
|
|
5108
|
+
setCodeIsApplied = _ref.setCodeIsApplied,
|
|
5109
|
+
codeIsInvalid = _ref.codeIsInvalid,
|
|
5110
|
+
setCodeIsInvalid = _ref.setCodeIsInvalid;
|
|
5109
5111
|
var isPromoCodeHasValue = !!code.trim();
|
|
5110
5112
|
|
|
5111
5113
|
var renderInputField = function renderInputField() {
|
|
@@ -5147,12 +5149,19 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
5147
5149
|
}
|
|
5148
5150
|
}), React__default.createElement("p", {
|
|
5149
5151
|
className: "promo-code-success"
|
|
5150
|
-
}, "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, {
|
|
5151
5159
|
className: "promo-code-button",
|
|
5152
5160
|
placeholder: "Promo Codes",
|
|
5153
5161
|
onClick: function onClick() {
|
|
5154
5162
|
setCodeIsApplied(false);
|
|
5155
5163
|
setShowPromoInput(true);
|
|
5164
|
+
setCodeIsInvalid(false);
|
|
5156
5165
|
}
|
|
5157
5166
|
}, "Got a promo code? Click here"), showPromoInput && renderInputField());
|
|
5158
5167
|
};
|
|
@@ -5436,17 +5445,21 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5436
5445
|
codeIsApplied = _useState12[0],
|
|
5437
5446
|
setCodeIsApplied = _useState12[1];
|
|
5438
5447
|
|
|
5439
|
-
var _useState13 = React.useState(
|
|
5440
|
-
|
|
5441
|
-
|
|
5448
|
+
var _useState13 = React.useState(false),
|
|
5449
|
+
codeIsInvalid = _useState13[0],
|
|
5450
|
+
setCodeIsInvalid = _useState13[1];
|
|
5442
5451
|
|
|
5443
|
-
var _useState14 = React.useState(
|
|
5444
|
-
|
|
5445
|
-
|
|
5452
|
+
var _useState14 = React.useState(isAccessCodeEnabled),
|
|
5453
|
+
showAccessCodeSection = _useState14[0],
|
|
5454
|
+
setShowAccessCodeSection = _useState14[1];
|
|
5446
5455
|
|
|
5447
|
-
var _useState15 = React.useState(
|
|
5448
|
-
|
|
5449
|
-
|
|
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];
|
|
5450
5463
|
|
|
5451
5464
|
var ticketsContainerRef = React.useRef(null);
|
|
5452
5465
|
React.useEffect(function () {
|
|
@@ -5558,6 +5571,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5558
5571
|
if (response.data.success) {
|
|
5559
5572
|
attributes = _get(response, 'data.data.attributes');
|
|
5560
5573
|
type === 'promo' && setCodeIsApplied(attributes.ValidPromoCode);
|
|
5574
|
+
type === 'promo' && setCodeIsInvalid(!attributes.ValidPromoCode);
|
|
5561
5575
|
setTickets(_get(attributes, 'tickets'));
|
|
5562
5576
|
setShowWaitingList(attributes.showWaitingList);
|
|
5563
5577
|
onGetTicketsSuccess(response.data);
|
|
@@ -5877,7 +5891,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5877
5891
|
showPromoInput: showPromoInput,
|
|
5878
5892
|
setShowPromoInput: setShowPromoInput,
|
|
5879
5893
|
setCode: setCode,
|
|
5880
|
-
updateTickets: updateTickets
|
|
5894
|
+
updateTickets: updateTickets,
|
|
5895
|
+
codeIsInvalid: codeIsInvalid,
|
|
5896
|
+
setCodeIsInvalid: setCodeIsInvalid
|
|
5881
5897
|
}) : null, wrappedActionsSectionComponent, canShowGetTicketBtn() && React__default.createElement(Button$1, {
|
|
5882
5898
|
"aria-hidden": true,
|
|
5883
5899
|
className: "book-button \n " + (bookButtonIsDisabled ? 'disabled' : '') + " \n " + (isButtonScrollable ? 'is-scrollable' : '') + "\n " + (!isLoggedIn ? 'on-bottom' : '') + "\n ",
|