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
package/package.json
CHANGED
|
@@ -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>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import Button from 'react-bootstrap/Button'
|
|
3
3
|
import SVG from 'react-inlinesvg'
|
|
4
|
+
|
|
4
5
|
import { getImage } from '../../utils/getImage'
|
|
5
6
|
|
|
6
7
|
export interface IPromoCodeSectionProps {
|
|
@@ -11,6 +12,8 @@ export interface IPromoCodeSectionProps {
|
|
|
11
12
|
setShowPromoInput: (value: boolean) => void;
|
|
12
13
|
updateTickets: (value: boolean, type: string) => void;
|
|
13
14
|
setCodeIsApplied: (value: boolean) => void;
|
|
15
|
+
codeIsInvalid: boolean;
|
|
16
|
+
setCodeIsInvalid: (value: boolean) => void;
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
export const PromoCodeSection = ({
|
|
@@ -20,12 +23,13 @@ export const PromoCodeSection = ({
|
|
|
20
23
|
setCode,
|
|
21
24
|
setShowPromoInput,
|
|
22
25
|
updateTickets,
|
|
23
|
-
setCodeIsApplied
|
|
26
|
+
setCodeIsApplied,
|
|
27
|
+
codeIsInvalid,
|
|
28
|
+
setCodeIsInvalid
|
|
24
29
|
}: IPromoCodeSectionProps) => {
|
|
25
30
|
const isPromoCodeHasValue = !!code.trim()
|
|
26
31
|
|
|
27
|
-
const renderInputField = () =>
|
|
28
|
-
return (
|
|
32
|
+
const renderInputField = () => (
|
|
29
33
|
<div className="promo-code-block">
|
|
30
34
|
<div className="promo-code-block">
|
|
31
35
|
<p className="promo-code-text">Promo code</p>
|
|
@@ -56,7 +60,6 @@ export const PromoCodeSection = ({
|
|
|
56
60
|
</Button>
|
|
57
61
|
</div>
|
|
58
62
|
)
|
|
59
|
-
}
|
|
60
63
|
|
|
61
64
|
return (
|
|
62
65
|
<div>
|
|
@@ -71,6 +74,14 @@ export const PromoCodeSection = ({
|
|
|
71
74
|
<p className="promo-code-success">PROMO CODE APPLIED SUCCESSFULLY</p>
|
|
72
75
|
</div>
|
|
73
76
|
) : null}
|
|
77
|
+
{codeIsInvalid ? (
|
|
78
|
+
<div className="alert-info fail">
|
|
79
|
+
<SVG
|
|
80
|
+
src={getImage('xmark.svg')}
|
|
81
|
+
/>
|
|
82
|
+
<p className="promo-code-fail">Invalid Promo Code</p>
|
|
83
|
+
</div>
|
|
84
|
+
) : null}
|
|
74
85
|
{!showPromoInput && (
|
|
75
86
|
<Button
|
|
76
87
|
className="promo-code-button"
|
|
@@ -78,6 +89,7 @@ export const PromoCodeSection = ({
|
|
|
78
89
|
onClick={() => {
|
|
79
90
|
setCodeIsApplied(false)
|
|
80
91
|
setShowPromoInput(true)
|
|
92
|
+
setCodeIsInvalid(false)
|
|
81
93
|
}}
|
|
82
94
|
>
|
|
83
95
|
Got a promo code? Click here
|
|
@@ -140,6 +140,7 @@ export const TicketsContainer = ({
|
|
|
140
140
|
const [code, setCode] = useState(getQueryVariable('r') || queryPromoCode)
|
|
141
141
|
const [showPromoInput, setShowPromoInput] = useState(false)
|
|
142
142
|
const [codeIsApplied, setCodeIsApplied] = useState(false)
|
|
143
|
+
const [codeIsInvalid, setCodeIsInvalid] = useState(false)
|
|
143
144
|
const [showAccessCodeSection, setShowAccessCodeSection] = useState(
|
|
144
145
|
isAccessCodeEnabled
|
|
145
146
|
)
|
|
@@ -207,6 +208,7 @@ export const TicketsContainer = ({
|
|
|
207
208
|
if (response.data.success) {
|
|
208
209
|
const attributes = _get(response, 'data.data.attributes')
|
|
209
210
|
type === 'promo' && setCodeIsApplied(attributes.ValidPromoCode)
|
|
211
|
+
type === 'promo' && setCodeIsInvalid(!attributes.ValidPromoCode)
|
|
210
212
|
setTickets(_get(attributes, 'tickets'))
|
|
211
213
|
setShowWaitingList(attributes.showWaitingList)
|
|
212
214
|
onGetTicketsSuccess(response.data)
|
|
@@ -501,6 +503,8 @@ export const TicketsContainer = ({
|
|
|
501
503
|
setShowPromoInput={setShowPromoInput}
|
|
502
504
|
setCode={setCode}
|
|
503
505
|
updateTickets={updateTickets}
|
|
506
|
+
codeIsInvalid={codeIsInvalid}
|
|
507
|
+
setCodeIsInvalid={setCodeIsInvalid}
|
|
504
508
|
/>
|
|
505
509
|
) : null}
|
|
506
510
|
{wrappedActionsSectionComponent}
|
package/src/env.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// preview
|
|
2
2
|
export const ENV = {
|
|
3
|
-
EVENT_ID:
|
|
3
|
+
EVENT_ID: 13063,
|
|
4
4
|
BASE_URL: 'https://test.ticketfairy.com',
|
|
5
5
|
CLIENT_ID: 'e9d8f8922797b4621e562255afe90dbf',
|
|
6
6
|
CLIENT_SECRET: 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9',
|
|
7
7
|
STRIPE_PUBLISHABLE_KEY:
|
|
8
8
|
'pk_test_51H4BkOGqveRD6EShliLrT9vd7mPOBPvQSuqmvc3wIinDqxWsCLeS2N7HonPPn6MhjU35ayYy5v4I6MLlD4jNWrd000NSgAF6UL',
|
|
9
|
-
BRAND_SLUG: 'mana-
|
|
10
|
-
X_SOURCE_ORIGIN: 'manacommon.com',
|
|
9
|
+
BRAND_SLUG: 'mana-common',
|
|
10
|
+
X_SOURCE_ORIGIN: 'tickets-staging.manacommon.com',
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
// prod
|