tf-checkout-react 1.0.102 → 1.0.103

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.
Files changed (75) hide show
  1. package/dist/images/done.svg +3 -3
  2. package/dist/tf-checkout-react.cjs.development.js +4 -0
  3. package/dist/tf-checkout-react.cjs.development.js.map +1 -1
  4. package/dist/tf-checkout-react.cjs.production.min.js +1 -1
  5. package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
  6. package/dist/tf-checkout-react.esm.js +4 -0
  7. package/dist/tf-checkout-react.esm.js.map +1 -1
  8. package/package.json +89 -89
  9. package/src/.d.ts +2 -2
  10. package/src/api/index.ts +278 -278
  11. package/src/assets/images/done.svg +3 -3
  12. package/src/components/billing-info-container/index.tsx +799 -796
  13. package/src/components/billing-info-container/style.css +105 -105
  14. package/src/components/billing-info-container/utils.ts +224 -224
  15. package/src/components/common/CheckboxField.tsx +41 -41
  16. package/src/components/common/CustomField.tsx +84 -84
  17. package/src/components/common/FormikPhoneNumberField.tsx +51 -51
  18. package/src/components/common/Loader.tsx +9 -9
  19. package/src/components/common/RadioField.tsx +35 -35
  20. package/src/components/common/SelectField.tsx +80 -80
  21. package/src/components/common/SnackbarAlert.tsx +53 -53
  22. package/src/components/common/index.tsx +4 -4
  23. package/src/components/confirmModal/index.tsx +51 -51
  24. package/src/components/confirmModal/style.css +21 -21
  25. package/src/components/confirmationContainer/config.ts +72 -72
  26. package/src/components/confirmationContainer/index.tsx +197 -197
  27. package/src/components/confirmationContainer/social-buttons.tsx +94 -94
  28. package/src/components/confirmationContainer/style.css +202 -202
  29. package/src/components/countdown/index.tsx +89 -89
  30. package/src/components/countdown/style.css +9 -9
  31. package/src/components/index.ts +7 -7
  32. package/src/components/loginModal/index.tsx +209 -209
  33. package/src/components/loginModal/style.css +71 -71
  34. package/src/components/myTicketsContainer/index.tsx +196 -196
  35. package/src/components/myTicketsContainer/row.tsx +41 -41
  36. package/src/components/myTicketsContainer/style.css +39 -39
  37. package/src/components/myTicketsContainer/tableConfig.tsx +34 -34
  38. package/src/components/orderDetailsContainer/index.tsx +249 -249
  39. package/src/components/orderDetailsContainer/style.css +72 -72
  40. package/src/components/orderDetailsContainer/ticketsTable.tsx +124 -124
  41. package/src/components/paymentContainer/index.tsx +284 -284
  42. package/src/components/registerModal/index.tsx +190 -190
  43. package/src/components/stripePayment/index.tsx +253 -253
  44. package/src/components/stripePayment/style.css +59 -59
  45. package/src/components/ticketResale/index.tsx +56 -56
  46. package/src/components/ticketResaleModal/index.tsx +210 -210
  47. package/src/components/ticketResaleModal/style.css +28 -28
  48. package/src/components/ticketsContainer/PromoCodeSection.tsx +99 -99
  49. package/src/components/ticketsContainer/ReferralLogic.tsx +33 -33
  50. package/src/components/ticketsContainer/TicketRow.tsx +83 -83
  51. package/src/components/ticketsContainer/TicketsSection.tsx +81 -81
  52. package/src/components/ticketsContainer/index.tsx +430 -430
  53. package/src/components/ticketsContainer/style.css +181 -181
  54. package/src/components/ticketsContainer/utils.ts +11 -11
  55. package/src/components/timerWidget/index.tsx +70 -70
  56. package/src/components/timerWidget/style.css +26 -26
  57. package/src/components/waitingList/index.tsx +178 -178
  58. package/src/components/waitingList/style.css +26 -26
  59. package/src/env.ts +20 -20
  60. package/src/index.ts +13 -13
  61. package/src/normalizers/index.ts +45 -45
  62. package/src/types/billing-info-data.ts +37 -37
  63. package/src/types/payment-field.ts +7 -7
  64. package/src/types/referral-promotion.ts +7 -7
  65. package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +59 -59
  66. package/src/utils/downloadPDF.tsx +30 -30
  67. package/src/utils/formikErrorFocus.ts +24 -24
  68. package/src/utils/getImage.ts +14 -14
  69. package/src/utils/getQueryVariable.ts +13 -13
  70. package/src/utils/index.ts +5 -5
  71. package/src/utils/setConfigs.ts +26 -26
  72. package/src/utils/showZero.tsx +10 -10
  73. package/src/validators/index.ts +20 -20
  74. package/src/.DS_Store +0 -0
  75. package/src/components/.DS_Store +0 -0
@@ -1,56 +1,56 @@
1
- import React, { useEffect, useState } from 'react'
2
- import _get from 'lodash/get'
3
- import { checkTicketStatus } from '../../api'
4
- import { AxiosError } from 'axios'
5
-
6
- export interface ITicketResaleContainer {
7
- onCheckTicketStatusSuccess: (res: any) => void
8
- onCheckTicketStatusError: (e: AxiosError) => void
9
- orderHash?: string
10
- }
11
-
12
- export const TicketResaleContainer = ({
13
- onCheckTicketStatusSuccess = () => {},
14
- onCheckTicketStatusError = () => {},
15
- orderHash,
16
- }: ITicketResaleContainer) => {
17
- const isWindowDefined = typeof window !== 'undefined'
18
- const [error, setError] = useState(null)
19
-
20
- useEffect(() => {
21
- (async () => {
22
- if (isWindowDefined) {
23
- const params: URLSearchParams = new URL(`${window.location}`)
24
- .searchParams
25
- const hash = params.get('o') || orderHash || null
26
-
27
- if (hash) {
28
- try {
29
- const response = await checkTicketStatus(hash)
30
- const data = _get(response, 'data.data.attributes')
31
- const age_required = _get(data, 'age_required', false)
32
- const names_required = _get(data, 'names_required', false)
33
- const event_id = _get(data, 'event_id')
34
-
35
- onCheckTicketStatusSuccess(response.data)
36
- window.location.href = `/billing/billing-info/?age_required=${age_required}&names_required=${names_required}&event_id=${event_id}`
37
- } catch (error) {
38
- console.log(error)
39
- setError(error?.response?.data?.message)
40
- onCheckTicketStatusError(error.response)
41
- }
42
- } else {
43
- window.location.href = '/'
44
- }
45
- }
46
- })()
47
- }, [])
48
-
49
- return (
50
- <div className="ticket-resale-page">
51
- <div className="error-block">
52
- <h3>{error}</h3>
53
- </div>
54
- </div>
55
- )
56
- }
1
+ import React, { useEffect, useState } from 'react'
2
+ import _get from 'lodash/get'
3
+ import { checkTicketStatus } from '../../api'
4
+ import { AxiosError } from 'axios'
5
+
6
+ export interface ITicketResaleContainer {
7
+ onCheckTicketStatusSuccess: (res: any) => void
8
+ onCheckTicketStatusError: (e: AxiosError) => void
9
+ orderHash?: string
10
+ }
11
+
12
+ export const TicketResaleContainer = ({
13
+ onCheckTicketStatusSuccess = () => {},
14
+ onCheckTicketStatusError = () => {},
15
+ orderHash,
16
+ }: ITicketResaleContainer) => {
17
+ const isWindowDefined = typeof window !== 'undefined'
18
+ const [error, setError] = useState(null)
19
+
20
+ useEffect(() => {
21
+ (async () => {
22
+ if (isWindowDefined) {
23
+ const params: URLSearchParams = new URL(`${window.location}`)
24
+ .searchParams
25
+ const hash = params.get('o') || orderHash || null
26
+
27
+ if (hash) {
28
+ try {
29
+ const response = await checkTicketStatus(hash)
30
+ const data = _get(response, 'data.data.attributes')
31
+ const age_required = _get(data, 'age_required', false)
32
+ const names_required = _get(data, 'names_required', false)
33
+ const event_id = _get(data, 'event_id')
34
+
35
+ onCheckTicketStatusSuccess(response.data)
36
+ window.location.href = `/billing/billing-info/?age_required=${age_required}&names_required=${names_required}&event_id=${event_id}`
37
+ } catch (error) {
38
+ console.log(error)
39
+ setError(error?.response?.data?.message)
40
+ onCheckTicketStatusError(error.response)
41
+ }
42
+ } else {
43
+ window.location.href = '/'
44
+ }
45
+ }
46
+ })()
47
+ }, [])
48
+
49
+ return (
50
+ <div className="ticket-resale-page">
51
+ <div className="error-block">
52
+ <h3>{error}</h3>
53
+ </div>
54
+ </div>
55
+ )
56
+ }
@@ -1,210 +1,210 @@
1
- import React from 'react'
2
- import { Field, Form, Formik } from 'formik'
3
- import * as yup from 'yup';
4
- import Modal from '@mui/material/Modal'
5
- import Box from '@mui/material/Box'
6
- import Button from '@mui/material/Button';
7
- import { RadioField } from '../common/RadioField'
8
- import { CheckboxField } from '../common/CheckboxField'
9
- import { CustomField } from '../common/CustomField'
10
- import SVG from 'react-inlinesvg'
11
- import { getImage } from '../../utils/getImage'
12
- import { ITicketTypes } from '../orderDetailsContainer/ticketsTable'
13
- import './style.css'
14
-
15
- interface Props {
16
- ticket: ITicketTypes;
17
- onClose: () => void;
18
- onSubmit: (values: InitialValuesTypes) => void;
19
- }
20
-
21
- export interface InitialValuesTypes {
22
- to: string;
23
- first_name: string;
24
- last_name: string;
25
- email: string;
26
- confirm_email: string;
27
- confirm: boolean;
28
- }
29
-
30
- const style: React.CSSProperties = {
31
- position: 'absolute',
32
- top: '50%',
33
- left: '50%',
34
- transform: 'translate(-50%, -50%)',
35
- minWidth: 480,
36
- backgroundColor: '#e3e3e3',
37
- border: '1px solid white',
38
- outline: 'none',
39
- padding: '14px',
40
- maxHeight: '85vh',
41
- overflow: 'auto'
42
- }
43
-
44
- const schema = yup.object().shape({
45
- to: yup.string().required(),
46
- first_name: yup.string().when('to', {
47
- is: (to: string) => to === 'friend',
48
- then: yup.string().required('First Name is required')
49
- }),
50
- last_name: yup.string().when('to', {
51
- is: (to: string) => to === 'friend',
52
- then: yup.string().required('Last Name is required')
53
- }),
54
- email: yup.string().when('to', {
55
- is: (to: string) => to === 'friend',
56
- then: yup.string().email('Invalid email').required('Email is required')
57
- }),
58
- confirm_email: yup.string().when('to', {
59
- is: (to: string) => to === 'friend',
60
- then: yup.string().email('Invalid email').oneOf([yup.ref('email'), null], 'Emails must match').required('Confirm Email is required')
61
- }),
62
- confirm: yup.boolean().oneOf([true])
63
- })
64
-
65
- const initialValues: InitialValuesTypes = {
66
- to: 'friend',
67
- first_name: '',
68
- last_name: '',
69
- email: '',
70
- confirm_email: '',
71
- confirm: false
72
- }
73
-
74
- export const TicketResaleModal = ({
75
- ticket = {} as ITicketTypes,
76
- onClose = () => {},
77
- onSubmit = () => {},
78
- }: Props) => {
79
- const { hash, holder_name, event_name, currency, resale_fee_amount } = ticket
80
- return (
81
- <Modal
82
- open={true}
83
- onClose={onClose}
84
- aria-labelledby="modal-modal-title"
85
- aria-describedby="modal-modal-description"
86
- className='resale-modal'
87
- >
88
- <Box style={style}>
89
- <h3>Sell Ticket</h3>
90
- <div>
91
- <h3>Ticket Details</h3>
92
- <div>
93
- <h4>Event</h4>
94
- <p>{event_name}</p>
95
- </div>
96
- <div>
97
- <h4>Ticket Holder</h4>
98
- <p>{holder_name}</p>
99
- </div>
100
- <div>
101
- <h4>Ticket ID</h4>
102
- <p>{hash}</p>
103
- </div>
104
- </div>
105
- <div>
106
- <h3>Sell to Whom</h3>
107
- <Formik
108
- initialValues={initialValues}
109
- validationSchema={schema}
110
- onSubmit={onSubmit}
111
- >
112
- {({ values, isValid, dirty }) => (
113
- <Form>
114
- <div>
115
- <Field
116
- name='to'
117
- label='I want to sell the ticket to someone I know'
118
- type='radio'
119
- value='friend'
120
- component={RadioField}
121
- />
122
- {values.to === 'friend' && (
123
- <div className='sell-to-friend'>
124
- <div className='user-info-box'>
125
- <div className='field-box'>
126
- <div className='icon'>
127
- <SVG
128
- src={getImage('user.svg')}
129
- width='24'
130
- height='24'
131
- />
132
- </div>
133
- <Field
134
- name='first_name'
135
- label='First Name'
136
- type='text'
137
- component={CustomField}
138
- />
139
- </div>
140
- <div className='field-box'>
141
- <div className='empty-box' />
142
- <Field
143
- name='last_name'
144
- label='Last Name'
145
- type='text'
146
- component={CustomField}
147
- />
148
- </div>
149
- </div>
150
- <div className='email-info-box'>
151
- <div className='field-box'>
152
- <div className='icon'>
153
- <SVG
154
- src={getImage('email.svg')}
155
- width='24'
156
- height='24'
157
- />
158
- </div>
159
- <Field
160
- name='email'
161
- label='Email address'
162
- type='text'
163
- component={CustomField}
164
- />
165
- </div>
166
- <div className='field-box'>
167
- <div className='empty-box' />
168
- <Field
169
- name='confirm_email'
170
- label='Confirm Email address'
171
- type='text'
172
- component={CustomField}
173
- />
174
- </div>
175
- </div>
176
- </div>
177
- )}
178
- </div>
179
- <div>
180
- <Field
181
- name='to'
182
- label='I will sell my ticket to anyone who wants to buy it'
183
- type='radio'
184
- value='anyone'
185
- component={RadioField}
186
- />
187
- </div>
188
- <div>
189
- <h4>Terms of Resale</h4>
190
- <p>I confirm that I want to sell this ticket and that, if someone chooses to buy it, I will no longer own it or have the right to ask for it back.</p>
191
- <p>I also understand that, if no one chooses to buy it, it remains my property, is valid for entry to <strong>{event_name}</strong> and I will not receive any refund.</p>
192
- <p>If my ticket is sold, the original card I used to buy my ticket will be refunded with the original amount paid, minus a small handling fee of <strong>{currency + resale_fee_amount}</strong>, and that any existing refunds due to me for referring sales for this event are no longer valid.</p>
193
- <Field
194
- name='confirm'
195
- label='I agree'
196
- type='checkbox'
197
- component={CheckboxField}
198
- />
199
- </div>
200
- <div className="resale-action-button">
201
- <Button type="submit" disabled={!(isValid && dirty)}>Sell Ticket</Button>
202
- </div>
203
- </Form>
204
- )}
205
- </Formik>
206
- </div>
207
- </Box>
208
- </Modal>
209
- )
210
- }
1
+ import React from 'react'
2
+ import { Field, Form, Formik } from 'formik'
3
+ import * as yup from 'yup';
4
+ import Modal from '@mui/material/Modal'
5
+ import Box from '@mui/material/Box'
6
+ import Button from '@mui/material/Button';
7
+ import { RadioField } from '../common/RadioField'
8
+ import { CheckboxField } from '../common/CheckboxField'
9
+ import { CustomField } from '../common/CustomField'
10
+ import SVG from 'react-inlinesvg'
11
+ import { getImage } from '../../utils/getImage'
12
+ import { ITicketTypes } from '../orderDetailsContainer/ticketsTable'
13
+ import './style.css'
14
+
15
+ interface Props {
16
+ ticket: ITicketTypes;
17
+ onClose: () => void;
18
+ onSubmit: (values: InitialValuesTypes) => void;
19
+ }
20
+
21
+ export interface InitialValuesTypes {
22
+ to: string;
23
+ first_name: string;
24
+ last_name: string;
25
+ email: string;
26
+ confirm_email: string;
27
+ confirm: boolean;
28
+ }
29
+
30
+ const style: React.CSSProperties = {
31
+ position: 'absolute',
32
+ top: '50%',
33
+ left: '50%',
34
+ transform: 'translate(-50%, -50%)',
35
+ minWidth: 480,
36
+ backgroundColor: '#e3e3e3',
37
+ border: '1px solid white',
38
+ outline: 'none',
39
+ padding: '14px',
40
+ maxHeight: '85vh',
41
+ overflow: 'auto'
42
+ }
43
+
44
+ const schema = yup.object().shape({
45
+ to: yup.string().required(),
46
+ first_name: yup.string().when('to', {
47
+ is: (to: string) => to === 'friend',
48
+ then: yup.string().required('First Name is required')
49
+ }),
50
+ last_name: yup.string().when('to', {
51
+ is: (to: string) => to === 'friend',
52
+ then: yup.string().required('Last Name is required')
53
+ }),
54
+ email: yup.string().when('to', {
55
+ is: (to: string) => to === 'friend',
56
+ then: yup.string().email('Invalid email').required('Email is required')
57
+ }),
58
+ confirm_email: yup.string().when('to', {
59
+ is: (to: string) => to === 'friend',
60
+ then: yup.string().email('Invalid email').oneOf([yup.ref('email'), null], 'Emails must match').required('Confirm Email is required')
61
+ }),
62
+ confirm: yup.boolean().oneOf([true])
63
+ })
64
+
65
+ const initialValues: InitialValuesTypes = {
66
+ to: 'friend',
67
+ first_name: '',
68
+ last_name: '',
69
+ email: '',
70
+ confirm_email: '',
71
+ confirm: false
72
+ }
73
+
74
+ export const TicketResaleModal = ({
75
+ ticket = {} as ITicketTypes,
76
+ onClose = () => {},
77
+ onSubmit = () => {},
78
+ }: Props) => {
79
+ const { hash, holder_name, event_name, currency, resale_fee_amount } = ticket
80
+ return (
81
+ <Modal
82
+ open={true}
83
+ onClose={onClose}
84
+ aria-labelledby="modal-modal-title"
85
+ aria-describedby="modal-modal-description"
86
+ className='resale-modal'
87
+ >
88
+ <Box style={style}>
89
+ <h3>Sell Ticket</h3>
90
+ <div>
91
+ <h3>Ticket Details</h3>
92
+ <div>
93
+ <h4>Event</h4>
94
+ <p>{event_name}</p>
95
+ </div>
96
+ <div>
97
+ <h4>Ticket Holder</h4>
98
+ <p>{holder_name}</p>
99
+ </div>
100
+ <div>
101
+ <h4>Ticket ID</h4>
102
+ <p>{hash}</p>
103
+ </div>
104
+ </div>
105
+ <div>
106
+ <h3>Sell to Whom</h3>
107
+ <Formik
108
+ initialValues={initialValues}
109
+ validationSchema={schema}
110
+ onSubmit={onSubmit}
111
+ >
112
+ {({ values, isValid, dirty }) => (
113
+ <Form>
114
+ <div>
115
+ <Field
116
+ name='to'
117
+ label='I want to sell the ticket to someone I know'
118
+ type='radio'
119
+ value='friend'
120
+ component={RadioField}
121
+ />
122
+ {values.to === 'friend' && (
123
+ <div className='sell-to-friend'>
124
+ <div className='user-info-box'>
125
+ <div className='field-box'>
126
+ <div className='icon'>
127
+ <SVG
128
+ src={getImage('user.svg')}
129
+ width='24'
130
+ height='24'
131
+ />
132
+ </div>
133
+ <Field
134
+ name='first_name'
135
+ label='First Name'
136
+ type='text'
137
+ component={CustomField}
138
+ />
139
+ </div>
140
+ <div className='field-box'>
141
+ <div className='empty-box' />
142
+ <Field
143
+ name='last_name'
144
+ label='Last Name'
145
+ type='text'
146
+ component={CustomField}
147
+ />
148
+ </div>
149
+ </div>
150
+ <div className='email-info-box'>
151
+ <div className='field-box'>
152
+ <div className='icon'>
153
+ <SVG
154
+ src={getImage('email.svg')}
155
+ width='24'
156
+ height='24'
157
+ />
158
+ </div>
159
+ <Field
160
+ name='email'
161
+ label='Email address'
162
+ type='text'
163
+ component={CustomField}
164
+ />
165
+ </div>
166
+ <div className='field-box'>
167
+ <div className='empty-box' />
168
+ <Field
169
+ name='confirm_email'
170
+ label='Confirm Email address'
171
+ type='text'
172
+ component={CustomField}
173
+ />
174
+ </div>
175
+ </div>
176
+ </div>
177
+ )}
178
+ </div>
179
+ <div>
180
+ <Field
181
+ name='to'
182
+ label='I will sell my ticket to anyone who wants to buy it'
183
+ type='radio'
184
+ value='anyone'
185
+ component={RadioField}
186
+ />
187
+ </div>
188
+ <div>
189
+ <h4>Terms of Resale</h4>
190
+ <p>I confirm that I want to sell this ticket and that, if someone chooses to buy it, I will no longer own it or have the right to ask for it back.</p>
191
+ <p>I also understand that, if no one chooses to buy it, it remains my property, is valid for entry to <strong>{event_name}</strong> and I will not receive any refund.</p>
192
+ <p>If my ticket is sold, the original card I used to buy my ticket will be refunded with the original amount paid, minus a small handling fee of <strong>{currency + resale_fee_amount}</strong>, and that any existing refunds due to me for referring sales for this event are no longer valid.</p>
193
+ <Field
194
+ name='confirm'
195
+ label='I agree'
196
+ type='checkbox'
197
+ component={CheckboxField}
198
+ />
199
+ </div>
200
+ <div className="resale-action-button">
201
+ <Button type="submit" disabled={!(isValid && dirty)}>Sell Ticket</Button>
202
+ </div>
203
+ </Form>
204
+ )}
205
+ </Formik>
206
+ </div>
207
+ </Box>
208
+ </Modal>
209
+ )
210
+ }
@@ -1,28 +1,28 @@
1
- .resale-modal .field-box {
2
- margin-bottom: 10px;
3
- display: flex;
4
- }
5
- .resale-modal .field-box .icon {
6
- height: 56px;
7
- min-width: 44px;
8
- display: flex;
9
- justify-content: center;
10
- align-items: center;
11
- }
12
- .resale-modal .field-box .empty-box {
13
- min-width: 44px;
14
- }
15
- .resale-modal .resale-action-button button {
16
- width: 100%;
17
- color: white;
18
- cursor: pointer;
19
- background-color: #212529;
20
- }
21
- .resale-modal .resale-action-button button[disabled] {
22
- opacity: .7;
23
- }
24
- .resale-modal .resale-action-button button:hover {
25
- width: 100%;
26
- background-color: #505050;
27
- border-color: #505050;
28
- }
1
+ .resale-modal .field-box {
2
+ margin-bottom: 10px;
3
+ display: flex;
4
+ }
5
+ .resale-modal .field-box .icon {
6
+ height: 56px;
7
+ min-width: 44px;
8
+ display: flex;
9
+ justify-content: center;
10
+ align-items: center;
11
+ }
12
+ .resale-modal .field-box .empty-box {
13
+ min-width: 44px;
14
+ }
15
+ .resale-modal .resale-action-button button {
16
+ width: 100%;
17
+ color: white;
18
+ cursor: pointer;
19
+ background-color: #212529;
20
+ }
21
+ .resale-modal .resale-action-button button[disabled] {
22
+ opacity: .7;
23
+ }
24
+ .resale-modal .resale-action-button button:hover {
25
+ width: 100%;
26
+ background-color: #505050;
27
+ border-color: #505050;
28
+ }