tf-checkout-react 1.3.12-beta.1 → 1.3.12-beta.11
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/README.md +354 -160
- package/dist/api/index.d.ts +17 -2
- package/dist/api/preRegistrationComplete.d.ts +2 -0
- package/dist/components/addonsContainer/index.d.ts +2 -1
- package/dist/components/billing-info-container/index.d.ts +4 -1
- package/dist/components/billing-info-container/utils.d.ts +6 -2
- package/dist/components/common/CheckboxField.d.ts +1 -1
- package/dist/components/common/CopyField.d.ts +12 -0
- package/dist/components/common/CopyMessageModal.d.ts +7 -0
- package/dist/components/common/CustomField.d.ts +8 -3
- package/dist/components/common/DatePickerField.d.ts +1 -1
- package/dist/components/common/Loader.d.ts +1 -1
- package/dist/components/common/ModalComponent/index.d.ts +16 -0
- package/dist/components/common/{SelectField.d.ts → NativeSelectFeild/index.d.ts} +1 -1
- package/dist/components/common/PhoneNumberField.d.ts +3 -1
- package/dist/components/common/PoweredBy.d.ts +2 -0
- package/dist/components/common/RadioGroupField/index.d.ts +17 -0
- package/dist/components/common/SelectField/index.d.ts +19 -0
- package/dist/components/common/index.d.ts +4 -0
- package/dist/components/common/socials.d.ts +9 -0
- package/dist/components/confirmModal/index.d.ts +1 -1
- package/dist/components/confirmationContainer/index.d.ts +5 -1
- package/dist/components/confirmationContainer/social-buttons.d.ts +6 -2
- package/dist/components/forgotPasswordModal/index.d.ts +1 -0
- package/dist/components/idVerificationContainer/VerificationPendingModal.d.ts +10 -0
- package/dist/components/idVerificationContainer/constants.d.ts +16 -0
- package/dist/components/idVerificationContainer/index.d.ts +16 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/loginForm/index.d.ts +1 -0
- package/dist/components/myTicketsContainer/index.d.ts +5 -2
- package/dist/components/myTicketsContainer/row.d.ts +1 -13
- package/dist/components/myTicketsContainer/tableConfig.d.ts +2 -2
- package/dist/components/orderDetailsContainer/index.d.ts +7 -1
- package/dist/components/orderDetailsContainer/ticketsTable.d.ts +6 -1
- package/dist/components/paymentContainer/index.d.ts +3 -1
- package/dist/components/preRegistration/Influancers.d.ts +2 -0
- package/dist/components/preRegistration/PreRegistrationComplete.d.ts +5 -0
- package/dist/components/preRegistration/PreRegistrationInformations.d.ts +2 -0
- package/dist/components/preRegistration/Prewards.d.ts +2 -0
- package/dist/components/preRegistration/ShareOptions.d.ts +2 -0
- package/dist/components/preRegistration/index.d.ts +5 -0
- package/dist/components/preRegistration/utils.d.ts +2 -0
- package/dist/components/registerModal/index.d.ts +3 -2
- package/dist/components/seatMapContainer/SeatMapComponent.d.ts +8 -0
- package/dist/components/seatMapContainer/TicketsSection.d.ts +9 -0
- package/dist/components/seatMapContainer/addToCart.d.ts +21 -0
- package/dist/components/seatMapContainer/index.d.ts +2 -0
- package/dist/components/seatMapContainer/utils.d.ts +14 -0
- package/dist/components/signupModal/index.d.ts +3 -2
- package/dist/components/stripePayment/index.d.ts +2 -2
- package/dist/components/ticketResale/index.d.ts +2 -1
- package/dist/components/ticketsContainer/PromoCodeSection.d.ts +3 -1
- package/dist/components/ticketsContainer/TicketRow.d.ts +4 -1
- package/dist/components/ticketsContainer/TicketsSection.d.ts +10 -3
- package/dist/components/ticketsContainer/index.d.ts +20 -2
- package/dist/components/timerWidget/index.d.ts +1 -1
- package/dist/components/waitingList/index.d.ts +2 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/usePixel.d.ts +6 -0
- package/dist/images/instagram.svg +5 -0
- package/dist/images/spotify.svg +6 -0
- package/dist/index.d.ts +8 -1
- package/dist/tf-checkout-react.cjs.development.js +6036 -4362
- 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 +6044 -4378
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/dist/types/checkoutPageConfigs.d.ts +3 -0
- package/dist/types/order-data.d.ts +3 -0
- package/dist/types/verification.d.ts +11 -0
- package/dist/utils/auth.d.ts +13 -0
- package/dist/utils/createCheckoutDataBodyWithDefaultHolder.d.ts +9 -2
- package/dist/utils/htmlNodeFromString.d.ts +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/isBrowser.d.ts +1 -0
- package/dist/utils/isValidNumber.d.ts +1 -0
- package/dist/utils/jsonUtils.d.ts +1 -0
- package/dist/validators/index.d.ts +2 -1
- package/package.json +23 -10
- package/src/.d.ts +4 -2
- package/src/api/index.ts +168 -27
- package/src/api/preRegistrationComplete.ts +27 -0
- package/src/assets/images/instagram.svg +5 -0
- package/src/assets/images/spotify.svg +6 -0
- package/src/components/addonsContainer/AddonComponent.tsx +2 -2
- package/src/components/addonsContainer/index.tsx +24 -2
- package/src/components/billing-info-container/index.tsx +516 -392
- package/src/components/billing-info-container/utils.ts +91 -20
- package/src/components/common/CheckboxField.tsx +17 -8
- package/src/components/common/CopyField.tsx +53 -0
- package/src/components/common/CopyMessageModal.tsx +34 -0
- package/src/components/common/CustomField.tsx +51 -18
- package/src/components/common/DatePickerField.tsx +50 -49
- package/src/components/common/FormikPhoneNumberField.tsx +11 -11
- package/src/components/common/Loader.tsx +6 -8
- package/src/components/common/ModalComponent/index.tsx +68 -0
- package/src/components/common/{SelectField.tsx → NativeSelectFeild/index.tsx} +1 -1
- package/src/components/common/PhoneNumberField.tsx +8 -4
- package/src/components/common/PoweredBy.tsx +15 -0
- package/src/components/common/RadioGroupField/index.tsx +76 -0
- package/src/components/common/SelectField/index.tsx +104 -0
- package/src/components/common/index.tsx +5 -1
- package/src/components/common/socials.tsx +31 -0
- package/src/components/confirmModal/index.tsx +16 -9
- package/src/components/confirmationContainer/config.ts +62 -55
- package/src/components/confirmationContainer/index.tsx +95 -71
- package/src/components/confirmationContainer/social-buttons.tsx +104 -65
- package/src/components/forgotPasswordModal/index.tsx +4 -0
- package/src/components/idVerificationContainer/VerificationPendingModal.tsx +47 -0
- package/src/components/idVerificationContainer/constants.ts +19 -0
- package/src/components/idVerificationContainer/index.tsx +283 -0
- package/src/components/index.ts +3 -1
- package/src/components/loginForm/index.tsx +4 -0
- package/src/components/myTicketsContainer/index.tsx +28 -10
- package/src/components/myTicketsContainer/row.tsx +33 -27
- package/src/components/myTicketsContainer/tableConfig.tsx +58 -17
- package/src/components/myTicketsContainer/types.d.ts +41 -0
- package/src/components/orderDetailsContainer/index.tsx +179 -147
- package/src/components/orderDetailsContainer/ticketsTable.tsx +11 -4
- package/src/components/paymentContainer/index.tsx +167 -25
- package/src/components/preRegistration/FieldsSection.tsx +14 -8
- package/src/components/preRegistration/Influancers.tsx +31 -0
- package/src/components/preRegistration/PreRegistrationComplete.tsx +96 -0
- package/src/components/preRegistration/PreRegistrationInformations.tsx +45 -0
- package/src/components/preRegistration/Prewards.tsx +38 -0
- package/src/components/preRegistration/ShareOptions.tsx +46 -0
- package/src/components/preRegistration/index.tsx +62 -16
- package/src/components/preRegistration/utils.ts +35 -0
- package/src/components/registerModal/index.tsx +11 -5
- package/src/components/seatMapContainer/SeatMapComponent.tsx +73 -0
- package/src/components/seatMapContainer/TicketsSection.tsx +285 -0
- package/src/components/seatMapContainer/addToCart.ts +82 -0
- package/src/components/seatMapContainer/index.tsx +426 -0
- package/src/components/seatMapContainer/utils.ts +138 -0
- package/src/components/signupModal/index.tsx +22 -16
- package/src/components/stripePayment/index.tsx +23 -18
- package/src/components/ticketResale/index.tsx +14 -9
- package/src/components/ticketResaleModal/index.tsx +4 -3
- package/src/components/ticketsContainer/PromoCodeSection.tsx +21 -12
- package/src/components/ticketsContainer/ReferralLogic.tsx +4 -2
- package/src/components/ticketsContainer/TicketRow.tsx +29 -19
- package/src/components/ticketsContainer/TicketsSection.tsx +129 -40
- package/src/components/ticketsContainer/index.tsx +220 -26
- package/src/components/ticketsContainer/style.css +0 -3
- package/src/components/ticketsContainer/utils.ts +1 -1
- package/src/components/timerWidget/index.tsx +9 -7
- package/src/components/waitingList/index.tsx +3 -2
- package/src/constants/index.ts +1 -0
- package/src/env.ts +1 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/usePixel.ts +88 -0
- package/src/index.ts +9 -4
- package/src/normalizers/index.ts +8 -5
- package/src/types/api/axiosResponse.d.ts +6 -0
- package/src/types/api/preRegistrationComplete.d.ts +70 -0
- package/src/types/auth.d.ts +15 -0
- package/src/types/checkoutPageConfigs.ts +3 -0
- package/src/types/order-data.ts +3 -0
- package/src/types/pre-registration-complete.d.ts +32 -0
- package/src/types/seatMap.d.ts +158 -0
- package/src/types/verification.ts +11 -0
- package/src/utils/auth.ts +13 -0
- package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +6 -2
- package/src/utils/htmlNodeFromString.ts +6 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/isBrowser.ts +2 -0
- package/src/utils/isValidNumber.ts +8 -0
- package/src/utils/jsonUtils.ts +8 -0
- package/src/validators/index.ts +25 -5
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/confirmModal/style.css +0 -21
package/README.md
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
# tf-checkout-react
|
|
2
|
+
|
|
2
3
|
|
|
3
4
|
|
|
5
|
+
<details>
|
|
6
|
+
<summary><strong>Table of Contents</strong></summary>
|
|
7
|
+
|
|
4
8
|
- [About The Project](#about-the-project)
|
|
9
|
+
- [Intergrations](#intergrations)
|
|
10
|
+
- [WebFlow](#webflow)
|
|
5
11
|
- [Getting started](#getting-started)
|
|
6
12
|
- [Prerequisites](#prerequisites)
|
|
7
13
|
- [Installation](#installation)
|
|
@@ -11,37 +17,66 @@
|
|
|
11
17
|
- [Set configuration](#set-configuration)
|
|
12
18
|
- [Features/Functionalities](#featuresfunctionalities)
|
|
13
19
|
- [Login](#login)
|
|
20
|
+
- [Login Modal Interface](#login-modal-interface)
|
|
14
21
|
- [Tickets Container](#tickets-container)
|
|
22
|
+
- [Tickets Container Interface](#tickets-container-interface)
|
|
15
23
|
- [Billing Container](#billing-container)
|
|
16
|
-
|
|
24
|
+
- [Billing Container Interface](#billing-container-interface)
|
|
25
|
+
- [Checkout Container](#checkout-container)
|
|
26
|
+
- [Checkout Container Interface](#checkout-container-interface)
|
|
17
27
|
- [Confirmation Container](#confirmation-container)
|
|
28
|
+
- [Confirmation Container Interface](#confirmation-container-interface)
|
|
18
29
|
- [Orders Container](#orders-container)
|
|
19
|
-
|
|
30
|
+
- [Orders Container Interface](#orders-container-interface)
|
|
31
|
+
- [Order Details Container](#order-details-container)
|
|
32
|
+
- [Order Details Container Interface](#order-details-container-interface)
|
|
20
33
|
- [Commands](#commands)
|
|
21
34
|
- [Rollup](#rollup)
|
|
22
35
|
- [TypeScript](#typescript)
|
|
23
36
|
- [GitHub Actions](#github-actions)
|
|
24
37
|
|
|
38
|
+
</details>
|
|
39
|
+
|
|
25
40
|
|
|
41
|
+
|
|
26
42
|
# About The Project
|
|
27
43
|
|
|
28
44
|
This package containes Ticketfairy checkout functionality. Besides that package provides different functionalities connected with checkout functionality, such as `login/register`, `order management functionality`, `resale functionality`, `referrals functionality`, etc.
|
|
29
45
|
|
|
30
46
|
|
|
47
|
+
|
|
48
|
+
# Intergrations
|
|
49
|
+
|
|
50
|
+
## [WebFlow](/webflow/public/INTEGRATION.md)
|
|
51
|
+
|
|
52
|
+
## Clients (Minimal version required)
|
|
53
|
+
|
|
54
|
+
- Mana Common (1.3.19)
|
|
55
|
+
- Restlesnites (1.3.3)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
31
59
|
# Getting started
|
|
60
|
+
|
|
32
61
|
## Prerequisites
|
|
62
|
+
|
|
33
63
|
- node >= 12.14.1
|
|
34
64
|
- npm >= 6.13.4
|
|
65
|
+
|
|
35
66
|
## Installation
|
|
67
|
+
|
|
36
68
|
### Existing project
|
|
37
69
|
|
|
38
70
|
```
|
|
39
71
|
npm i tf-checkout-react
|
|
40
72
|
```
|
|
73
|
+
|
|
41
74
|
or
|
|
75
|
+
|
|
42
76
|
```
|
|
43
77
|
yarn add tf-checkout-react
|
|
44
78
|
```
|
|
79
|
+
|
|
45
80
|
### Run Independently
|
|
46
81
|
|
|
47
82
|
- Clone this repo: `git clone https://github.com/theticketfairy/tf-checkout-react.git`
|
|
@@ -57,6 +92,8 @@ Project will run under `localhost:3002`. Port can be changed from `package.json`
|
|
|
57
92
|
|
|
58
93
|
## Set configuration
|
|
59
94
|
|
|
95
|
+
In order to make this package work properly, you need to set some configurations, otherwise the default configurations will be used. Currently only configuration which is needed for production, is `BASE_URL`. Other configurations written below are only for development/test environments.
|
|
96
|
+
|
|
60
97
|
Import `setConfigs` function from the package.
|
|
61
98
|
|
|
62
99
|
```
|
|
@@ -65,10 +102,16 @@ import { setConfigs } from 'tf-checkout-react'
|
|
|
65
102
|
|
|
66
103
|
Call it in the root and pass neccesary options. Here are available options:
|
|
67
104
|
|
|
105
|
+
### Configurations for production
|
|
106
|
+
|
|
68
107
|
- BASE_URL - need for making API calls (default: `https://www.ticketfairy.com`)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
108
|
+
|
|
109
|
+
### Configurations for development/testing
|
|
110
|
+
|
|
111
|
+
- BASE_URL - need for making API calls
|
|
112
|
+
- EVENT_ID - get and use specific event data
|
|
113
|
+
- BRAND_SLUG - slug of the event's parent/owner brand
|
|
114
|
+
- X_SOURCE_ORIGIN - need for local environment. This header will be included in every API request.
|
|
72
115
|
|
|
73
116
|
|
|
74
117
|
|
|
@@ -76,206 +119,355 @@ Call it in the root and pass neccesary options. Here are available options:
|
|
|
76
119
|
|
|
77
120
|
## Login
|
|
78
121
|
|
|
79
|
-
Used to authenticate user.
|
|
122
|
+
### Used to authenticate user. Contains `email` and `password` fields.
|
|
80
123
|
|
|
81
|
-
|
|
124
|
+
Import `LoginModal` from package. `LoginModal` component provides login form with validations and error handlings. Also it provides callback functions for every action and API call.
|
|
82
125
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
126
|
+
### Login Modal Interface
|
|
127
|
+
|
|
128
|
+
<details>
|
|
129
|
+
<summary><b>props</b></summary>
|
|
130
|
+
|
|
131
|
+
| Property | Type | Required | Default Value | Description |
|
|
132
|
+
| ------------------------ | ------------------------- | -------- | ------------------------------- | -------------------------------------------------- |
|
|
133
|
+
| onLogin | Function: () => void | yes | N/A | Called after log in request’s success. |
|
|
134
|
+
| onClose | Function: () => void | yes | N/A | Called on modal close. |
|
|
135
|
+
| onGetProfileDataSuccess | Function: (data) => void | no | value => value | Called after fetching user data request’s success. |
|
|
136
|
+
| onGetProfileDataError | Function: (error) => void | no | value => value | Called after fetching user data request’s failure. |
|
|
137
|
+
| onForgotPassword | Function: () => void | no | value => value | Called on “Forgot Password” button click. |
|
|
138
|
+
| onSignup | Function: () => void | no | value => value | Called on “Sign Up” button click. |
|
|
139
|
+
| modalClassname | string | no | " " | Login modal main container class. |
|
|
140
|
+
| logo | string / URL / path | no | TheTicketFairy black logo (URL) | Login modal top section’s logo. |
|
|
141
|
+
| showForgotPasswordButton | boolean | no | false | Display “Forgot Password” button. |
|
|
142
|
+
| showSignUpButton | boolean | no | false | Display “Sign Up” button. |
|
|
143
|
+
|
|
144
|
+
</details>
|
|
96
145
|
|
|
97
146
|
|
|
98
|
-
## Tickets Container
|
|
99
147
|
|
|
100
|
-
|
|
148
|
+
## Register
|
|
101
149
|
|
|
102
|
-
### `
|
|
150
|
+
### Used to register new user. Contains `firstName`, `lastName`, `email`, `password` and `confirmPassword` fields.
|
|
103
151
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
152
|
+
`RegisterModal` component provides register form with validations and error handlings. Also it provides callback functions for every action and API call.
|
|
153
|
+
|
|
154
|
+
### Register Modal Interface
|
|
155
|
+
|
|
156
|
+
<details>
|
|
157
|
+
<summary><b>props</b></summary>
|
|
158
|
+
|
|
159
|
+
| Property | Type | Required | Default Value | Description |
|
|
160
|
+
| ----------------------- | ------------------------- | -------- | -------------- | -------------------------------------------------------- |
|
|
161
|
+
| onRegister (deprecated) | Function: () => void | no | N/A | - |
|
|
162
|
+
| onClose | Function: () => void | yes | N/A | Called on modal close, after register request's success. |
|
|
163
|
+
| onGetProfileDataSuccess | Function: (data) => void | no | value => value | Called after fetching user data request’s success. |
|
|
164
|
+
| onGetProfileDataError | Function: (error) => void | no | value => value | Called after fetching user data request’s failure. |
|
|
165
|
+
|
|
166
|
+
</details>
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
## Forgot Password
|
|
171
|
+
|
|
172
|
+
### Used to recover forgot password of user. Contains `email` field.
|
|
173
|
+
|
|
174
|
+
`ForgotPasswordModal` component provides forgot password form with validations and error handlings. Also it provides callback functions for every action and API call.
|
|
175
|
+
|
|
176
|
+
### Forgot Password Modal Interface
|
|
177
|
+
|
|
178
|
+
<details>
|
|
179
|
+
<summary><b>props</b></summary>
|
|
180
|
+
|
|
181
|
+
| Property | Type | Required | Default Value | Description |
|
|
182
|
+
| ----------------------- | ------------------------- | -------- | -------------- | -------------------------------------------------------- |
|
|
183
|
+
| onLogin | Function: () => void | yes | N/A | Called on "Back to Log In" button click. |
|
|
184
|
+
| onClose | Function: () => void | yes | N/A | Called on modal close, after register request's success. |
|
|
185
|
+
| onForgotPasswordSuccess | Function: (data) => void | no | value => value | Called after forgot password request’s success. |
|
|
186
|
+
| onForgotPasswordError | Function: (error) => void | no | value => value | Called after forgot password request’s failure. |
|
|
187
|
+
|
|
188
|
+
</details>
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
## Tickets Container
|
|
193
|
+
|
|
194
|
+
Tickets container/component will retrieve and show a list of tickets corresponding to selected event. It also containes `PromoCode`, `AccessCode`, `WaitingLsit` and `SessionButtons` functionalities.
|
|
195
|
+
|
|
196
|
+
### Tickets Container Interface
|
|
197
|
+
|
|
198
|
+
<details>
|
|
199
|
+
<summary><b>props</b></summary>
|
|
200
|
+
|
|
201
|
+
| Property | Type | Required | Default value | Description |
|
|
202
|
+
| ---------------------------------------- | ------------------------- | -------- | -------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
203
|
+
| eventId | string/number | yes | N/A | |
|
|
204
|
+
| getTicketsLabel | string | no | “Get Tickets" | “Get Tickets” button label. |
|
|
205
|
+
| contentStyle | CSSProperties | no | {} | Main div container styles. |
|
|
206
|
+
| theme | ‘light’, ‘dark' | no | ‘light' | Main div class. |
|
|
207
|
+
| themeOptions | MUI ThemeOptions | no | N/A | MUI Theme Provider’s theme. |
|
|
208
|
+
| queryPromoCode (deprecated) | string | no | N/A | Promo code value get from URL query parameters. |
|
|
209
|
+
| isPromotionsEnabled | boolean | no | false | Enable Promotions feature. |
|
|
210
|
+
| isAccessCodeEnabled | boolean | no | false | Enable Access Code feature. |
|
|
211
|
+
| hideTicketsHeader | boolean | no | false | Hides section header component. |
|
|
212
|
+
| hideSessionButtons | boolean | no | false | Hide “My Tickets” and “Log Out” buttons. |
|
|
213
|
+
| hideWaitingList | boolean | no | false | Disable Waiting List feature. |
|
|
214
|
+
| enableBillingInfoAutoCreate | boolean | no | true | Enable to automatically create billing info data, instead of manually creation by user. |
|
|
215
|
+
| enableInfluencersSection | boolean | no | true | Display Influencers section. |
|
|
216
|
+
| enableAddOns | boolean | no | true | Enable Add-Ons feature. |
|
|
217
|
+
| isButtonScrollable (deprecated) | boolean | no | false | Enable “Get Tickets” button’s scroll. |
|
|
218
|
+
| sortBySoldOut | boolean | no | false | Enable to sort tickets by sort order and sold out status. By default tickets will be sorted only by sort order. |
|
|
219
|
+
| disableCountdownLeadingZero (deprecated) | boolean | no | false | - |
|
|
220
|
+
| isLoggedIn (deprecated) | boolean | no | false | - |
|
|
221
|
+
| actionsSectionComponent | ReactNode | no | N/A | Custom component instead of “Get Tickets” button. |
|
|
222
|
+
| ticketsHeaderComponent | ReactNode | no | N/A | Tickets section header component. |
|
|
223
|
+
| onAddToCartSuccess | Function: (data) => void | no | value => value | Called after add to cart request’s success. |
|
|
224
|
+
| onAddToCartError | Function: (error) => void | no | value => value | Called after add to cart request’s failure. |
|
|
225
|
+
| onGetTicketsSuccess | Function: (data) => void | no | value => value | Called after fetching tickets request’s success. |
|
|
226
|
+
| onGetTicketsError | Function: (error) => void | no | value => value | Called after fetching tickets request’s failure. |
|
|
227
|
+
| onLogoutSuccess | Function: () => void | no | value => value | Called after log out request’s success. |
|
|
228
|
+
| onLogoutError | Function: (error) => void | no | value => value | Called after log out request’s failure. |
|
|
229
|
+
| onLoginSuccess | Function: () => void | no | value => value | Called after log in request’s success. |
|
|
230
|
+
|
|
231
|
+
</details>
|
|
136
232
|
|
|
137
233
|
|
|
234
|
+
|
|
138
235
|
## Billing Container
|
|
139
236
|
|
|
140
237
|
Billing container provides form for filling user's data. Form contains `user info`, `age` and `ticket holders` sections. Depending on event's requirements billing information form may differ. Form will autofill all available information and in case of all required fields are autofilled, billing page will redirect to payment page. Form submition will automatically register new user, if there is no existing user with provided email.
|
|
141
238
|
|
|
142
|
-
###
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
onLoginSuccess?: () => void;
|
|
175
|
-
onErrorClose?: () => void;
|
|
176
|
-
|
|
177
|
-
theme?: 'light' | 'dark';
|
|
178
|
-
themeOptions?: ThemeOptions & {
|
|
179
|
-
input?: CSSProperties;
|
|
180
|
-
checkbox?: CSSProperties;
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
buttonName?: string;
|
|
184
|
-
accountInfoTitle?: string | JSX.Element;
|
|
185
|
-
hideLogo?: boolean;
|
|
186
|
-
hideErrorsAlertSection?: boolean;
|
|
187
|
-
skipPage?: boolean;
|
|
188
|
-
canSkipHolderNames?: boolean;
|
|
189
|
-
shouldFetchCountries?: boolean;
|
|
190
|
-
enableTimer?: boolean;
|
|
191
|
-
}
|
|
192
|
-
```
|
|
239
|
+
### Billing Container Interface
|
|
240
|
+
|
|
241
|
+
Billing container interface extends [Login Modal Interface](#login-modal-interface), [Register Modal Interface](#register-modal-interface), [Forgot Password Modal Interface](#forgot-password-modal-interface).
|
|
242
|
+
|
|
243
|
+
<details>
|
|
244
|
+
<summary><b>props</b></summary>
|
|
245
|
+
|
|
246
|
+
| Property | Type | Required | Default Value | Description |
|
|
247
|
+
| --------------------------------- | -------------------------------------------------------- | -------- | ----------------------- | --------------------------------------------------------------------------------------------------- |
|
|
248
|
+
| data | IBillingInfoData[] | no | [] | Form fields list to be rendered to collect billing info data. |
|
|
249
|
+
| ticketHoldersFields | IBillingInfoData[] | no | [{ id: 1, fields: [] }] | Form fields list to be rendered to collect ticket holders data. |
|
|
250
|
+
| initialValues (deprecated) | { [key: string]: any } | no | {} | Form’s initial values. |
|
|
251
|
+
| theme | 'light' / 'dark' | no | 'light' | MUI Theme Provider’s theme. |
|
|
252
|
+
| isLoggedIn (deprecated) | boolean | no | false | - |
|
|
253
|
+
| accountInfoTitle | string / JSX.Element | no | “” | Render some text or JSX component above Login section. Do not available if there is logged in user. |
|
|
254
|
+
| hideLogo | boolean | no | false | Hide TicketFairy logo under “Login” button. |
|
|
255
|
+
| themeOptions | MUI ThemeOptions | no | N/A | MUI Theme Provider’s theme. |
|
|
256
|
+
| hideErrorsAlertSection | boolean | no | false | Hide form submit errors rendered by package. |
|
|
257
|
+
| skipPage | boolean | no | false | Enable skipping Billing Info page. |
|
|
258
|
+
| canSkipHolderNames | boolean | no | false | Enable to autogenerate ticket holders’ data, if ticket holders’ data are not required. |
|
|
259
|
+
| shouldFetchCountries (deprecated) | boolean | no | true | Enable to fetch countries list from TicketFairy. |
|
|
260
|
+
| enableTimer | boolean | no | false | Display whole checkout process timer. |
|
|
261
|
+
| brandOptIn (deprecated) | boolean | no | false | - |
|
|
262
|
+
| handleSubmit | Function: (data, helpers, eventId, responseData) => void | no | value => value | Called after billing info data submit request’s success. |
|
|
263
|
+
| onSubmitError | Function: (error) => void | no | value => value | Called after billing info data submit request’s failure. |
|
|
264
|
+
| onGetCartSuccess | Function: (data) => void | no | value => value | Called after fetching cart data request’s success. |
|
|
265
|
+
| onGetCartError | Function: (error) => void | no | value => value | Called after fetching cart data request’s failure. |
|
|
266
|
+
| onLogin (deprecated) | - | - | - | - |
|
|
267
|
+
| onErrorClose | Function: () => void | no | value => value | Called after closing error alert component. |
|
|
268
|
+
| onSkipBillingPage | Function: (data) => void | no | value => value | Called if skipPage is true. |
|
|
269
|
+
|
|
270
|
+
</details>
|
|
193
271
|
|
|
194
272
|
|
|
195
|
-
|
|
273
|
+
|
|
274
|
+
## Checkout Container
|
|
196
275
|
|
|
197
276
|
Will show the order details and a card form that the user will need to fill with its card details.
|
|
198
277
|
TicketFairy doesn't store any card related data, we use [Stripe](https://stripe.com/) as payments solution.
|
|
199
278
|
|
|
200
|
-
###
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
279
|
+
### Checkout Container Interface
|
|
280
|
+
|
|
281
|
+
<details>
|
|
282
|
+
<summary><b>props</b></summary>
|
|
283
|
+
|
|
284
|
+
| Property | Type | Required | Default Value | Description |
|
|
285
|
+
| -------------------------- | ------------------------------- | -------- | ------------------ | ----------------------------------------------------------- |
|
|
286
|
+
| paymentFields | IPaymentField[] | yes | N/A | Define which field’s data should be displayed. |
|
|
287
|
+
| handlePayment (deprecated) | Function: (data) => void | yes | N/A | Called after payment request’s success. |
|
|
288
|
+
| onPaymentError | Function: (error) => void | yes | value => value | Called after payment request’s failure. |
|
|
289
|
+
| checkoutData (deprecated) | { hash: string; total: string } | yes | N/A | Object which contains checkout hash and order’s total cost. |
|
|
290
|
+
| onGetPaymentDataSuccess | Function: (data) => void | yes | value => value | Called after fetching payment data request’s success. |
|
|
291
|
+
| onGetPaymentDataError | Function: (error) => void | yes | value => value | Called after fetching payment data request’s failure. |
|
|
292
|
+
| onCountdownFinish | Function: () => void | yes | value => value | Called after checkout time expired. |
|
|
293
|
+
| enableTimer | boolean | no | false | Enable checkout process timer. |
|
|
294
|
+
| enablePaymentPlan | boolean | no | false | Enable pay with payment plan feature. |
|
|
295
|
+
| disableZipSection | boolean | no | false | Hide “Zip code” field. |
|
|
296
|
+
| paymentButtonText | string | no | “Pay” | Custom text for “Pay” button. |
|
|
297
|
+
| stripeCardOptions | StripeCardNumberElementOptions | no | {} | Custom styles for Stripe card. |
|
|
298
|
+
| themeOptions | MUI ThemeOptions | no | N/A | MUI Theme Provider’s theme. |
|
|
299
|
+
| formTitle | string | no | “Get Your Tickets” | Custom text for payment form title. |
|
|
300
|
+
| errorText (deprecated) | string | no | N/A | Payment confirmation error text. |
|
|
301
|
+
| onErrorClose | Function: () => void | no | N/A | Called after closing error alert component. |
|
|
302
|
+
| elementsOptions | StripeElementsOptions | no | N/A | Custom Stripe card elements. |
|
|
303
|
+
|
|
304
|
+
</details>
|
|
224
305
|
|
|
225
306
|
|
|
307
|
+
|
|
226
308
|
## Confirmation Container
|
|
227
309
|
|
|
228
310
|
This is shown once the payment is successfully completed, could show components to share the purchase in social media or refer it with friends to get discounts on the purchase.
|
|
229
311
|
|
|
230
|
-
###
|
|
312
|
+
### Confirmation Container Interface
|
|
231
313
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
314
|
+
<details>
|
|
315
|
+
<summary><b>props</b></summary>
|
|
316
|
+
|
|
317
|
+
| Property | Type | Required | Default Value | Description |
|
|
318
|
+
| ---------------------------- | ------------------------------------- | -------- | ------------------------------------------- | ----------------------------------------------------- |
|
|
319
|
+
| isReferralEnabled | boolean | yes | false | Enable Referrals feature. |
|
|
320
|
+
| showDefaultShareButtons | boolean | yes | false | Display social media share buttons.<sup>[1](#1)</sup> |
|
|
321
|
+
| messengerAppId | string | yes | “” | Facebook app ID. |
|
|
322
|
+
| shareButtons | IShareButton[] <sup>[1](#1)</sup> | yes | [] | Custom social media share buttons. |
|
|
323
|
+
| confirmationLabels | IConfirmationLabels<sup>[2](#2)</sup> | yes | defaultConfirmationLabels<sup>[2](#2)</sup> | Custom texts to display on Confirmation page. |
|
|
324
|
+
| onLinkCopied | Function: () => void | no | value => value | Called after personal share link copy. |
|
|
325
|
+
| onGetConfirmationDataSuccess | Function: (data) => void | no | value => value | Called after order confirmation request’s success. |
|
|
326
|
+
| onGetConfirmationDataError | Function: (error) => void | no | value => value | Called after order confirmation request’s failure. |
|
|
327
|
+
| hasCopyIcon | boolean | no | true | Display Copy icon near personal share link. |
|
|
328
|
+
| orderHash (deprecated) | string | no | N/A | - |
|
|
329
|
+
|
|
330
|
+
</details>
|
|
245
331
|
|
|
246
332
|
|
|
333
|
+
|
|
247
334
|
## Orders Container
|
|
248
335
|
|
|
249
336
|
Will show the purchased orders for the logged user.
|
|
250
337
|
|
|
251
|
-
###
|
|
338
|
+
### Orders Container Interface
|
|
339
|
+
|
|
340
|
+
Orders container interface extends [Login Modal Interface](#login-modal-interface).
|
|
341
|
+
|
|
342
|
+
<details>
|
|
343
|
+
<summary><b>props</b></summary>
|
|
344
|
+
|
|
345
|
+
| Property | Type | Required | Default Value | Description |
|
|
346
|
+
| ------------------ | ------------------------------ | -------- | -------------- | ---------------------------------------------------- |
|
|
347
|
+
| handleDetailsInfo | Function: (id: string) => void | yes | value => value | Called on "Order Details" button click. |
|
|
348
|
+
| onGetOrdersSuccess | Function: (data) => void | yes | value => value | Called after fetching orders data request’s success. |
|
|
349
|
+
| onGetOrdersError | Function: (error) => void | yes | value => value | Called after fetching orders data request’s failure. |
|
|
350
|
+
| theme | 'light' / 'dark' | no | ‘dark' | Main container class. |
|
|
351
|
+
|
|
352
|
+
</details>
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
## Order Details Container
|
|
357
|
+
|
|
358
|
+
Will show the purchased order details. Contains `order PDF download` and `ticket resale` functionalities. Currently both functionalities are enabled by default.
|
|
359
|
+
|
|
360
|
+
### Order Details Container Interface
|
|
361
|
+
|
|
362
|
+
<details>
|
|
363
|
+
<summary><b>props</b></summary>
|
|
364
|
+
|
|
365
|
+
| Property | Type | Required | Default Value | Description |
|
|
366
|
+
| ------------------------- | ----------------------------------------- | -------- | -------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
367
|
+
| columns | [ { label: string } ] | yes | [] | Order details table’s columns’ labels. |
|
|
368
|
+
| ticketsTableColumns | ITicketsTableColumns[] <sup>[3](#3)</sup> | no | defaultTicketsTableColumns<sup>[3](#3)</sup> | Order’s tickets table’s columns. |
|
|
369
|
+
| displayColumnNameInRow | boolean | no | false | Display column’s names in row, instead of table header. |
|
|
370
|
+
| personalLinkIcon | string | no | “” | Custom icon to display near personal share link. |
|
|
371
|
+
| onGetOrdersSuccess | Function: (data) => void | no | value => value | Called after fetching order data request’s success. |
|
|
372
|
+
| onGetOrdersError | Function: (error) => void | no | value => value | Called after fetching order data request’s failure. |
|
|
373
|
+
| onResaleTicketSuccess | Function: (data) => void | no | value => value | Called after resale ticket request’s success. |
|
|
374
|
+
| onResaleTicketError | Function: (error) => void | no | value => value | Called after resale ticket request’s failure. |
|
|
375
|
+
| onRemoveFromResaleSuccess | Function: (data) => void | no | value => value | Called after remove from resale ticket request’s success. |
|
|
376
|
+
| onRemoveFromResaleError | Function: (error) => void | no | value => value | Called after remove from resale ticket request’s failure. |
|
|
377
|
+
| onReturnButtonClick | Function: () => void | no | N/A | Called on “Return” button click. If not passed, button click will redirect to ‘/orders’. |
|
|
378
|
+
|
|
379
|
+
</details>
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
## Ticket Resale Container
|
|
384
|
+
|
|
385
|
+
Container renders information about accepting or declining of resold tickets. It will automatically redirect to home page, if not valid hash is provided in URL.
|
|
386
|
+
|
|
387
|
+
### Ticket Resale Container Interface
|
|
252
388
|
|
|
389
|
+
<details>
|
|
390
|
+
<summary><b>props</b></summary>
|
|
391
|
+
|
|
392
|
+
| Property | Type | Required | Default Value | Description |
|
|
393
|
+
| ------------------------------ | ------------------------- | -------- | -------------- | ---------------------------------------------- |
|
|
394
|
+
| onProcessTicketSuccess | Function: (data) => void | no | value => value | Called after process ticket request’s success. |
|
|
395
|
+
| onGetOrdersError | Function: (error) => void | no | value => value | Called after process ticket request’s failure. |
|
|
396
|
+
| onDeclineTicketPurchaseSuccess | Function: (data) => void | no | value => value | Called after decline ticket request’s success. |
|
|
397
|
+
| onDeclineTicketPurchaseError | Function: (error) => void | no | value => value | Called after decline ticket request’s failure. |
|
|
398
|
+
|
|
399
|
+
</details>
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
<details>
|
|
404
|
+
<summary><small id="1">1. Share buttons</small></summary>
|
|
405
|
+
|
|
406
|
+
```
|
|
407
|
+
IShareButton {
|
|
408
|
+
mainLabel: string;
|
|
409
|
+
subLabel: string;
|
|
410
|
+
platform: string;
|
|
411
|
+
shareData: any;
|
|
412
|
+
}
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
```
|
|
416
|
+
Default share options if `showDefaultShareButtons` is true, are: "Share on Facebook", "Tweet to your Followers", "Message friends on Facebook" and "Message friends on WhatsApp".
|
|
253
417
|
```
|
|
254
|
-
interface Props {
|
|
255
|
-
handleDetailsInfo: (id: string) => void;
|
|
256
|
-
onGetOrdersSuccess: (res: any) => void;
|
|
257
|
-
onGetOrdersError: (err: any) => void;
|
|
258
418
|
|
|
259
|
-
|
|
419
|
+
</details>
|
|
420
|
+
|
|
421
|
+
<details>
|
|
422
|
+
<summary><small id="2">2. Confirmation Labels</small></summary>
|
|
423
|
+
|
|
424
|
+
```
|
|
425
|
+
IConfirmationLabels {
|
|
426
|
+
confirmationTitle?: string;
|
|
427
|
+
confirmationMain?: string;
|
|
428
|
+
confirmationHelper?: string
|
|
260
429
|
}
|
|
261
430
|
```
|
|
262
431
|
|
|
263
|
-
|
|
264
|
-
|
|
432
|
+
```
|
|
433
|
+
const defaultConfirmationLabels = {
|
|
434
|
+
confirmationTitle = "Your Tickets are Confirmed!",
|
|
435
|
+
confirmationMain = "Your tickets are available in My Tickets section",
|
|
436
|
+
confirmationHelper = "Please bring them with you to the event"
|
|
437
|
+
}
|
|
438
|
+
```
|
|
265
439
|
|
|
266
|
-
|
|
440
|
+
</details>
|
|
267
441
|
|
|
268
|
-
|
|
442
|
+
<details>
|
|
443
|
+
<summary><small id="3">3. Tickets table columns</small></summary>
|
|
269
444
|
|
|
270
445
|
```
|
|
271
|
-
interface
|
|
272
|
-
|
|
273
|
-
|
|
446
|
+
interface ITicketsTableColumns {
|
|
447
|
+
id?: string | number;
|
|
448
|
+
key: keyof ITicketTypes & keyof IActionColumns;
|
|
449
|
+
label: string | number | null | undefined;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
interface IActionColumns {
|
|
453
|
+
download?: boolean;
|
|
454
|
+
sell_ticket?: boolean;
|
|
274
455
|
}
|
|
275
456
|
```
|
|
276
457
|
|
|
277
|
-
|
|
278
|
-
|
|
458
|
+
```
|
|
459
|
+
const defaultTicketsTableColumns = [
|
|
460
|
+
{ key: 'ticket_type', label: 'Ticket Type' },
|
|
461
|
+
{ key: 'holder_name', label: 'Ticket Holder' },
|
|
462
|
+
{ key: 'status', label: 'Status' },
|
|
463
|
+
{ key: 'download', label: '' },
|
|
464
|
+
{ key: 'sell_ticket', label: '' }
|
|
465
|
+
]
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
</details>
|
|
469
|
+
|
|
470
|
+
# Commands
|
|
279
471
|
|
|
280
472
|
TSDX scaffolds your new library inside `/src`, and also sets up a [Parcel-based](https://parceljs.org) playground for it inside `/example`.
|
|
281
473
|
|
|
@@ -300,11 +492,13 @@ The default example imports and live reloads whatever is in `/dist`, so if you a
|
|
|
300
492
|
To do a one-off build, use `npm run build` or `yarn build`.
|
|
301
493
|
|
|
302
494
|
|
|
495
|
+
|
|
303
496
|
### Rollup
|
|
304
497
|
|
|
305
498
|
TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details.
|
|
306
499
|
|
|
307
500
|
|
|
501
|
+
|
|
308
502
|
### TypeScript
|
|
309
503
|
|
|
310
504
|
`tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs.
|