tf-checkout-react 1.4.20 → 1.4.21

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 (59) hide show
  1. package/README.md +462 -229
  2. package/dist/api/guestTicketDelegation.d.ts +47 -0
  3. package/dist/api/index.d.ts +2 -2
  4. package/dist/components/common/CustomField.d.ts +1 -1
  5. package/dist/components/common/FieldSection/index.d.ts +19 -0
  6. package/dist/components/common/FieldSection/utils/index.d.ts +8 -0
  7. package/dist/components/common/index.d.ts +2 -2
  8. package/dist/components/confirmModal/index.d.ts +2 -2
  9. package/dist/components/delegationsContainer/IssueComponent.d.ts +10 -0
  10. package/dist/components/delegationsContainer/IssueTicketForm.d.ts +9 -0
  11. package/dist/components/delegationsContainer/TicketsAssignedTable.d.ts +11 -0
  12. package/dist/components/delegationsContainer/TicketsAvailableTable.d.ts +11 -0
  13. package/dist/components/delegationsContainer/index.d.ts +10 -0
  14. package/dist/components/idVerificationContainer/constants.d.ts +1 -0
  15. package/dist/components/index.d.ts +1 -0
  16. package/dist/components/loginForm/index.d.ts +45 -0
  17. package/dist/components/registerForm/adapters/index.d.ts +4 -0
  18. package/dist/components/registerForm/constants.d.ts +1 -0
  19. package/dist/components/registerForm/index.d.ts +16 -0
  20. package/dist/index.d.ts +3 -1
  21. package/dist/tf-checkout-react.cjs.development.js +1413 -283
  22. package/dist/tf-checkout-react.cjs.development.js.map +1 -1
  23. package/dist/tf-checkout-react.cjs.production.min.js +1 -1
  24. package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
  25. package/dist/tf-checkout-react.esm.js +1416 -288
  26. package/dist/tf-checkout-react.esm.js.map +1 -1
  27. package/dist/utils/form.d.ts +3 -0
  28. package/dist/utils/index.d.ts +3 -1
  29. package/dist/utils/replaceVarInString.d.ts +1 -0
  30. package/package.json +1 -1
  31. package/src/api/guestTicketDelegation.ts +79 -0
  32. package/src/api/index.ts +3 -2
  33. package/src/components/billing-info-container/utils.ts +1 -1
  34. package/src/components/common/CustomField.tsx +2 -0
  35. package/src/components/common/FieldSection/index.tsx +141 -0
  36. package/src/components/common/FieldSection/utils/index.tsx +92 -0
  37. package/src/components/common/SelectField/index.tsx +1 -1
  38. package/src/components/common/index.tsx +2 -2
  39. package/src/components/confirmModal/index.tsx +2 -2
  40. package/src/components/delegationsContainer/IssueComponent.tsx +155 -0
  41. package/src/components/delegationsContainer/IssueTicketForm.tsx +109 -0
  42. package/src/components/delegationsContainer/TicketsAssignedTable.tsx +55 -0
  43. package/src/components/delegationsContainer/TicketsAvailableTable.tsx +54 -0
  44. package/src/components/delegationsContainer/index.tsx +83 -0
  45. package/src/components/forgotPasswordModal/index.tsx +3 -9
  46. package/src/components/idVerificationContainer/constants.ts +5 -2
  47. package/src/components/index.ts +1 -0
  48. package/src/components/loginForm/index.tsx +195 -0
  49. package/src/components/registerForm/adapters/index.tsx +10 -0
  50. package/src/components/registerForm/constants.tsx +96 -0
  51. package/src/components/registerForm/index.tsx +192 -0
  52. package/src/index.ts +3 -4
  53. package/src/types/api/auth.d.ts +55 -0
  54. package/src/types/api/guestTicketDelegation.d.ts +18 -0
  55. package/src/types/formFields.d.ts +29 -0
  56. package/src/utils/form.ts +34 -0
  57. package/src/utils/index.ts +3 -1
  58. package/src/utils/replaceVarInString.ts +9 -0
  59. package/src/validators/index.ts +2 -2
package/README.md CHANGED
@@ -2,70 +2,85 @@
2
2
 
3
3
   
4
4
 
5
- <details>
5
+ <details open>
6
6
  <summary><strong>Table of Contents</strong></summary>
7
7
 
8
- - [About The Project](#about-the-project)
8
+ - [tf-checkout-react](#tf-checkout-react)
9
+ - [Introduction](#introduction)
9
10
  - [Intergrations](#intergrations)
10
11
  - [WebFlow](#webflow)
11
- - [Getting started](#getting-started)
12
- - [Prerequisites](#prerequisites)
13
- - [Installation](#installation)
14
- - [Existing project](#existing-project)
15
- - [Run Independently](#run-independently)
12
+ - [Prerequisites](#prerequisites)
13
+ - [Installation](#installation)
14
+ - [Run Independently](#run-independently)
16
15
  - [Usage](#usage)
17
16
  - [Set configuration](#set-configuration)
18
- - [Features/Functionalities](#featuresfunctionalities)
17
+ - [Configurations for production](#configurations-for-production)
18
+ - [Configurations for development/testing](#configurations-for-developmenttesting)
19
+ - [Functionalities](#functionalities)
19
20
  - [Login](#login)
20
- - [Login Modal Interface](#login-modal-interface)
21
- - [Tickets Container](#tickets-container)
22
- - [Tickets Container Interface](#tickets-container-interface)
23
- - [Billing Container](#billing-container)
24
- - [Billing Container Interface](#billing-container-interface)
25
- - [Checkout Container](#checkout-container)
26
- - [Checkout Container Interface](#checkout-container-interface)
27
- - [Confirmation Container](#confirmation-container)
28
- - [Confirmation Container Interface](#confirmation-container-interface)
21
+ - [Register](#register)
22
+ - [Forgot Password](#forgot-password)
23
+ - [Promo Code](#promo-code)
24
+ - [__Note that package automatically calls component in `TicketsContainer`__](#note-that-package-automatically-calls-component-in-ticketscontainer)
25
+ - [Access Code](#access-code)
26
+ - [__Note that package automatically calls component in `TicketsContainer`__](#note-that-package-automatically-calls-component-in-ticketscontainer-1)
27
+ - [Waiting List](#waiting-list)
28
+ - [__Note that package automatically calls component in `TicketsContainer`__](#note-that-package-automatically-calls-component-in-ticketscontainer-2)
29
+ - [Pixel Usage](#pixel-usage)
30
+ - [Components](#components)
31
+ - [`TicketsContainer`](#ticketscontainer)
32
+ - [`AddOnsContainer`](#addonscontainer)
33
+ - [`BillingInfoContainer`](#billinginfocontainer)
34
+ - [`PaymentContainer`](#paymentcontainer)
35
+ - [`ConfirmationContainer`](#confirmationcontainer)
36
+ - [`MyTicketsContainer`](#myticketscontainer)
29
37
  - [Orders Container](#orders-container)
30
- - [Orders Container Interface](#orders-container-interface)
31
38
  - [Order Details Container](#order-details-container)
32
- - [Order Details Container Interface](#order-details-container-interface)
39
+ - [Ticket Resale Container](#ticket-resale-container)
33
40
  - [Commands](#commands)
34
- - [Rollup](#rollup)
35
- - [TypeScript](#typescript)
36
- - [GitHub Actions](#github-actions)
41
+ - [Rollup](#rollup)
42
+ - [TypeScript](#typescript)
43
+ - [GitHub Actions](#github-actions)
37
44
 
38
45
  </details>
39
46
 
40
47
  &nbsp;
41
-
42
- # About The Project
43
-
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.
45
-
48
+ # Introduction
49
+
50
+ This package includes TicketFairy's checkout functionality, as well as various related functionalities. These functionalities include login/register, order management, resale, referrals, and more.
51
+
52
+ This package provides a set of components and functionalities designed to manage various aspects of the TicketFairy event experience. These include:
53
+
54
+ - `AccountSettings`: A component for managing user account settings, such as email address and password.
55
+ - `AddonsContainter`: A component for displaying a list of available add-ons and allowing the user to purchase them.
56
+ - `BillingInfoContainer`: A component for managing billing information, such as addresses and ticket holders.
57
+ - `ConfirmationContainer`: A component for displaying a confirmation page after a purchase is made.
58
+ - `IDVerification`: A component for verifying the identity of the user during the checkout process.
59
+ - `MyTicketsContainer`: A component for displaying a list of purchased orders.
60
+ - `OrderDetailsContainer`: A component for displaying detailed information about a purchase, such as the ticket types, add-ons and pricing.
61
+ - `PaymentContainer`: A component for managing payment processing during the checkout process.
62
+ - `ResetPasswordContainer`: A component for resetting a user's password.
63
+ - `SeatMapContainer`: A component for displaying and selecting seats on a venue map.
64
+ - `TicketResaleContainer`: A component for managing the resale of tickets or add-ons by the user.
65
+ - `TicketsContainer`: A component for displaying a list of available tickets and allowing the user to purchase them.
66
+
67
+ Together, these components and functionalities provide a comprehensive set of tools to manage the checkout process and related activities for a TicketFairy-powered event.
68
+ &nbsp;
46
69
  &nbsp;
47
70
 
48
71
  # Intergrations
49
72
 
50
73
  ## [WebFlow](/webflow/public/INTEGRATION.md)
51
74
 
52
- ## Clients (Minimal version required)
53
-
54
- - Mana Common (1.3.19)
55
- - Restlesnites (1.3.3)
56
-
57
75
  &nbsp;
58
76
 
59
- # Getting started
60
77
 
61
- ## Prerequisites
78
+ # Prerequisites
62
79
 
63
- - node >= 12.14.1
64
- - npm >= 6.13.4
80
+ - node >= v16.19.0
81
+ - npm >= 8.19.3
65
82
 
66
- ## Installation
67
-
68
- ### Existing project
83
+ # Installation
69
84
 
70
85
  ```
71
86
  npm i tf-checkout-react
@@ -77,7 +92,7 @@ or
77
92
  yarn add tf-checkout-react
78
93
  ```
79
94
 
80
- ### Run Independently
95
+ ## Run Independently
81
96
 
82
97
  - Clone this repo: `git clone https://github.com/theticketfairy/tf-checkout-react.git`
83
98
  - Install dependencies: `npm install`
@@ -115,31 +130,56 @@ Call it in the root and pass neccesary options. Here are available options:
115
130
 
116
131
  &nbsp;
117
132
 
118
- # Features/Functionalities
133
+ # Functionalities
119
134
 
120
135
  ## Login
121
136
 
122
- ### Used to authenticate user. Contains `email` and `password` fields.
123
137
 
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.
138
+ The `LoginModal` component is designed to be used inside package to authenticate users. <br /> To use the `LoginModal`, simply include it in your React component and pass in the required __onLogin__ and __onClose__ callbacks as props.
139
+
140
+ You can authenticate users from the Billing page too, here you can either provide __onLogin__ callback as a prop to the [`BillingInfoContainer`](#billinginfocontainer) component so that you can open your custom component for authentication or you can ommit it and the package inside provided `LoginModal` component will be called and opened.
141
+
142
+ Package can detect whether a user is logged in or not by checking for the presence of the __X-TF-ECOMMERCE__ cookie, which is automatically set by the system when the user successfully logs in. If the __X-TF-ECOMMERCE__ cookie is present, the package assumes that the user is logged in and displays the appropriate content.
143
+
144
+ The `LoginModal` component also is used in [`MyTicketsContainer`](#myticketscontainer) and [`TicketsContainer`](#ticketscontainer).
125
145
 
126
- ### Login Modal Interface
146
+ To detect whether a user is logged in or not, you can use the __useCookieListener__ hook provided by the package.
147
+ Here's an example of how to use the __useCookieListener__ hook to automatically detect whether the user is logged in:
127
148
 
128
- <details>
129
- <summary><b>props</b></summary>
149
+ ```jsx
150
+ import { useEffect, useRef, useState } from 'react'
151
+ import { useCookieListener } from 'tf-checkout-react'
130
152
 
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. |
153
+ const MyComponent = () => {
154
+ const [isLogged, setIsLogged] = useState(false)
155
+
156
+ // Listen for changes to the __X-TF-ECOMMERCE__ cookie
157
+ useCookieListener("X_TF_ECOMMERCE", value => setIsLogged(Boolean(value)))
158
+
159
+ // ... rest of component logic
160
+ }
161
+ ```
162
+
163
+ <br />
164
+
165
+ <details open>
166
+ <summary><b>Login Modal Props Interface:</b></summary>
167
+
168
+ | Property | Type | Required | Default Value | Description |
169
+ | ------------------------ | ------------------- | -------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
170
+ | onLogin | () => void | yes | N/A | Called after the user successfully authorizes. |
171
+ | onClose | () => void | yes | N/A | Called on modal close. |
172
+ | onGetProfileDataSuccess | (data) => void | no | value => value | A callback function that is called when the profile data is successfully retrieved. |
173
+ | onGetProfileDataError | (error) => void | no | value => value | A callback function that is called when retrieving the profile data fails. |
174
+ | onForgotPassword | () => void | no | value => value | Called on “Forgot Password” button click. |
175
+ | onSignup | () => void | no | value => value | Called on “Sign Up” button click. |
176
+ | modalClassname | string | no | " " | Login modal main container class. |
177
+ | logo | string / URL / path | no | TheTicketFairy black logo (URL) | Login modal top section’s logo. |
178
+ | showForgotPasswordButton | boolean | no | false | Display “Forgot Password” button. |
179
+ | showSignUpButton | boolean | no | false | Display “Sign Up” button. |
180
+ | alreadyHasUser | boolean | no | false | Whether or not to show the "email is already attached to an account" message block. |
181
+ | userExpired | boolean | no | false | Whether or not to show the "session expired" message block. |
182
+ | showPoweredByImage | boolean | no | false | Whether or not to show the <a href="https://cdn-checkout.s3.us-east-2.amazonaws.com/IconTicketFairy.svg">Powered image</a>. |
143
183
 
144
184
  </details>
145
185
 
@@ -147,21 +187,20 @@ Import `LoginModal` from package. `LoginModal` component provides login form wit
147
187
 
148
188
  ## Register
149
189
 
150
- ### Used to register new user. Contains `firstName`, `lastName`, `email`, `password` and `confirmPassword` fields.
190
+ The `RegisterModal` component is designed to be used inside package to allows users to register for an account. <br />
151
191
 
152
- `RegisterModal` component provides register form with validations and error handlings. Also it provides callback functions for every action and API call.
192
+ When the user submits the form, the component calls the register API function to create the user's account. If account creation is successful, the component then retrieves the user's profile data. The __onGetProfileDataSuccess__ and __onGetProfileDataError__ callbacks are then called depending on whether the profile data retrieval succeeds or fails. If profile data retrieval succeeds, the component maps the profile data to a format used by the application and saves the resulting data to the browser's localStorage. Finally, the __onClose__ callback is called to close the modal.
153
193
 
154
- ### Register Modal Interface
194
+ <details open>
195
+ <summary><b>Register Modal Props Interface:</b></summary>
155
196
 
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. |
197
+ | Property | Type | Required | Default Value | Description |
198
+ | ----------------------- | --------------- | -------- | -------------- | --------------------------------------------------------------------------------------------------------------------------- |
199
+ | onRegister (deprecated) | () => void | no | N/A | - |
200
+ | onClose | () => void | yes | N/A | Called on modal close, after register request's success. |
201
+ | onGetProfileDataSuccess | (data) => void | no | value => value | A callback function that is called when the profile data is successfully retrieved. |
202
+ | onGetProfileDataError | (error) => void | no | value => value | A callback function that is called when retrieving the profile data fails. |
203
+ | showPoweredByImage | boolean | no | false | Whether or not to show the <a href="https://cdn-checkout.s3.us-east-2.amazonaws.com/IconTicketFairy.svg">Powered image</a>. |
165
204
 
166
205
  </details>
167
206
 
@@ -169,178 +208,370 @@ Import `LoginModal` from package. `LoginModal` component provides login form wit
169
208
 
170
209
  ## Forgot Password
171
210
 
172
- ### Used to recover forgot password of user. Contains `email` field.
211
+ The `ForgotPasswordModal` component is a modal dialog for users to reset their passwords. To use it, simply import the component, manage its open state, and provide callback functions for closing the modal, navigating back to the login page or component, handling successful password reset requests, and handling errors in password reset requests. Optionally, you can also display a "Powered By" image within the modal by setting the __showPoweredByImage__ prop to true.
212
+
213
+ <details open>
214
+ <summary><b>Forgot Password Modal Props Interface:</b></summary>
215
+
216
+ | Property | Type | Required | Default Value | Description |
217
+ | ----------------------- | --------------- | -------- | -------------- | --------------------------------------------------------------------------------------------------------------------------- |
218
+ | onLogin | () => void | yes | N/A | Called on "Back to Log In" button click. |
219
+ | onClose | () => void | yes | N/A | Called on modal close, after register request's success. |
220
+ | onForgotPasswordSuccess | (data) => void | no | value => value | A callback function that is called when the user successfully resets their password. |
221
+ | onForgotPasswordError | (error) => void | no | value => value | A callback function that is called when there is an error resetting the password. |
222
+ | showPoweredByImage | boolean | no | false | Whether or not to show the <a href="https://cdn-checkout.s3.us-east-2.amazonaws.com/IconTicketFairy.svg">Powered image</a>. |
223
+
224
+ </details>
225
+ &nbsp;
226
+
227
+ ## Promo Code
228
+
229
+ The `PromoCodeSection` is a React component for handling promo code input, validation, and displaying success or error messages. It accepts various props to control its appearance and behavior, such as the promo code value, validation status, input visibility, and callback functions for updating the state which you can see in the below provided table.
230
+
231
+ To use this component, simply import it and include it in your JSX with the required props, managing the component's state and callback functions in the parent component as needed.
173
232
 
174
- `ForgotPasswordModal` component provides forgot password form with validations and error handlings. Also it provides callback functions for every action and API call.
233
+ ### __Note that package automatically calls component in [`TicketsContainer`](#ticketscontainer)__
234
+ <br />
175
235
 
176
- ### Forgot Password Modal Interface
177
236
 
178
- <details>
179
- <summary><b>props</b></summary>
237
+ <details open>
238
+ <summary><b>Promo Code Props Interface:</b></summary>
180
239
 
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. |
240
+ | Property | Type | Required | Default Value | Description |
241
+ | ----------------- | -------------------------------------- | -------- | ------------- | --------------------------------------------------------------------- |
242
+ | code | string | yes | ' ' | The promo code. |
243
+ | codeIsApplied | boolean | yes | false | Whether or not the promo code is currently applied. |
244
+ | showPromoInput | boolean | yes | false | Whether or not to show the promo code input field. |
245
+ | codeIsInvalid | boolean | yes | false | Whether or not the promo code is invalid. |
246
+ | showAlertIcons | boolean | no | false | Whether or not to show the alert icons. |
247
+ | promoText | string | no | false | Button label, which click displays promo code input. |
248
+ | - | - | - | - | - |
249
+ | setCode | (value: string) => void | yes | - | A function to set the promo code. |
250
+ | setCodeIsApplied | (value: boolean) => void | yes | - | A function to set whether or not the promo code is currently applied. |
251
+ | setCodeIsInvalid | (value: boolean) => void | yes | - | A function to set whether or not the promo code is invalid. |
252
+ | setShowPromoInput | (value: boolean) => void | yes | - | A function to set whether or not to show the promo code input field. |
253
+ | updateTickets | (value: boolean, type: string) => void | yes | - | A function to update the tickets based on the promo code. |
187
254
 
188
255
  </details>
256
+ &nbsp;
257
+
258
+ ## Access Code
259
+
260
+ The `AccessCodeSection` is a React component designed for handling access code input and submission. It allows users to enter an access code and triggers an update to the ticket information based on the submitted access code. The component accepts a set of props to manage the access code value and provide callback functions for updating the state which you can see in below table.
261
+
262
+ To integrate the `AccessCodeSection` component, import it into your JSX and provide the required props, such as the access code value, and callback functions for updating the state. Make sure to manage the component's state and callback functions within the parent component as needed. <br />
189
263
 
264
+ ### __Note that package automatically calls component in [`TicketsContainer`](#ticketscontainer)__
265
+
266
+ <br />
267
+
268
+ <details open>
269
+ <summary><b>Access Code Props Interface:</b></summary>
270
+
271
+ | Property | Type | Required | Default Value | Description |
272
+ | ------------- | ------------------------ | -------- | ------------- | ---------------------------------------------------------- |
273
+ | code | string | yes | ' ' | The access code. |
274
+ | - | - | - | - | - |
275
+ | setCode | (value: string) => void | yes | - | A function to set the access code. |
276
+ | updateTickets | (value: boolean) => void | yes | - | A function to update the tickets based on the access code. |
277
+
278
+ </details>
190
279
  &nbsp;
191
280
 
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. |
281
+ ## Waiting List
282
+
283
+ The `WaitingList` component is a React component designed to handle user registration for a waiting list. It displays a form that allows users to input their information, including first name, last name, email, ticket type, and quantity. Upon submission, the component adds the user to the waiting list and displays a success message.
284
+
285
+
286
+ ### __Note that package automatically calls component in [`TicketsContainer`](#ticketscontainer)__
287
+
288
+ <br />
289
+
290
+ <details open>
291
+ <summary><b>Waiting List Props Interface:</b></summary>
292
+
293
+ | Property | Type | Required | Default Value | Description |
294
+ | ------------------ | --------------- | -------- | ------------- | ------------------------------------------------------------- |
295
+ | tickets | Object | yes | ' ' | The list of tickets to be displayed. |
296
+ | eventId | string / number | yes | N/A | The ID of the event for which the tickets are displayed. |
297
+ | defaultMaxQuantity | number | yes | 10 | The default maximum quantity of tickets that can be selected. |
230
298
 
231
299
  </details>
232
300
 
301
+ <br />
302
+
303
+ ## Pixel Usage
304
+
305
+ The `usePixel` hook is a utility function used to load a pixel script for tracking events on the page. It is commonly used in multiple components throughout the application to track various user actions, such as the completion of a checkout or a purchase. <br />
306
+
307
+ The purpose of the `usePixel` hook is to enable event tracking and analytics for various user actions within the application.
308
+
309
+ Here is the list of pages where the `usePixel` function is automatically used:
310
+
311
+ - Billing Info Container
312
+ - Confirmation Container
313
+ - Payment Container
314
+ - Tickets Container
315
+
233
316
  &nbsp;
234
317
 
235
- ## Billing Container
236
-
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.
238
-
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. |
318
+ # Components
319
+
320
+
321
+ ## `TicketsContainer`
322
+
323
+ Tickets component will retrieve and show a list of tickets corresponding to selected event,
324
+ which allows the user to select the desired ticket type and quantity.
325
+
326
+ The __"Get Tickets"__ button which name is also customizable, allows the user to add the selected tickets to their cart and proceed to the checkout process.<br />
327
+ Other buttons can be displayed to handle various actions, such as viewing the user's orders or logging out.
328
+
329
+ Tickets component provides a section for entering an [Access Code](#access-code) or [Promo Code](#promo-code) that applies a discount to the ticket price or hide/unhide some tickets via [Access Code](#access-code).<br />
330
+ It also containes `WaitingLsit` that manages and displays waiting list functionality for the event.<br />
331
+ Props interface partially extends [Promo Code Props Interface](#promo-code), [Access Code Props Interface](#access-code), [Waiting List Props Interface](#waiting-list).
332
+
333
+ Tickets component displays a list of the top influencers who have promoted the event.
334
+
335
+ Tickets component is flexible and customizable, allowing for different layouts and behaviors depending on the event's requirements.
336
+
337
+ ___Example of usage___:
338
+ ```jsx
339
+
340
+ import { TicketsContainer } from 'tf-checkout-react'
341
+
342
+ <TicketsContainer
343
+ theme="light"
344
+ eventId={event?.id}
345
+ handleNotInvitedModalClose={() => { }}
346
+ handleInvalidLinkModalClose={() => { }}
347
+ onAddToCartSuccess={() => {}}
348
+ isPromotionsEnabled={event?.is_promotions_enabled}
349
+ isAccessCodeEnabled={event?.is_access_code}
350
+ onLogoutSuccess={() => {}}
351
+ hideSessionButtons={true}
352
+ enableAddOns={false}
353
+ showGroupNameBlock={true}
354
+ tableTicketsHeaderComponent={<div className="tickets-container-header">RESERVE TABLES</div>}
355
+ onPendingVerification={() => {}}
356
+ />
357
+ ```
358
+
359
+ <details open>
360
+ <summary><b>Tickets Container Props Interface</b></summary>
361
+
362
+ | Property | Type | Required | Default value | Description |
363
+ | ---------------------------------------- | ---------------- | -------- | -------------- | ---------------------------------------------------------------------------------------------- |
364
+ | eventId | string / number | yes | N/A | The unique identifier for the event that the tickets belong to. |
365
+ | getTicketsLabel | string | no | “Get Tickets" | The label for the "Get Tickets" button. |
366
+ | contentStyle | CSSProperties | no | {} | An object containing styles to apply to the tickets list container. |
367
+ | theme | ‘light’, ‘dark' | no | ‘light' | The theme to use for the tickets list container. Sets as `className`. |
368
+ | themeOptions | MUI ThemeOptions | no | N/A | MUI Theme Provider’s theme options. |
369
+ | queryPromoCode (deprecated) | - | - | - | - |
370
+ | isButtonScrollable (deprecated) | - | - | - | - |
371
+ | disableCountdownLeadingZero (deprecated) | - | - | - | - |
372
+ | isLoggedIn (deprecated) | - | - | - | - |
373
+ | isPromotionsEnabled | boolean | no | false | Whether or not promotions are enabled for the tickets list. |
374
+ | isAccessCodeEnabled | boolean | no | false | Whether or not access codes are enabled for the tickets list. |
375
+ | hideTicketsHeader | boolean | no | false | Whether to hide the tickets header. |
376
+ | hideSessionButtons | boolean | no | false | Whether to hide “My Tickets” and “Log Out” buttons. |
377
+ | hideWaitingList | boolean | no | false | Whether to hide the waiting list. |
378
+ | enableBillingInfoAutoCreate | boolean | no | true | Whether to enable auto-creation of billing information, instead of manually creation by user. |
379
+ | enableInfluencersSection | boolean | no | true | Whether to display the influencers section. |
380
+ | enableAddOns | boolean | no | true | Whether to enable add-ons. |
381
+ | sortBySoldOut | boolean | no | false | Whether to sort tickets by sold-out status. By default tickets will be sorted by sort order. |
382
+ | hideTableTicketsHeader | boolean | no | false | Whether to hide table type tickets section header. |
383
+ | showPoweredByImage | boolean | no | false | Whether to show the "Powered by TheTicketFairy" image. |
384
+ | showGroupNameBlock | boolean | no | false | Whether to show the ticket group name block. |
385
+ | actionsSectionComponent | ReactNode | no | N/A | Custom component instead of “Get Tickets” button. |
386
+ | ticketsHeaderComponent | ReactNode | no | N/A | A React component to render the tickets section header. |
387
+ | tableTicketsHeaderComponent | ReactNode | no | N/A | A React component to render the table type tickets section header. |
388
+ | ordersPath | string | no | '/orders' | The URL path to the orders page. |
389
+ | currencySybmol | string | no | ' ' | The currency symbol to use. |
390
+ | - | - | - | - | - |
391
+ | onAddToCartSuccess | (data) => void | no | value => value | A callback function to be called when a ticket is successfully added to the cart. |
392
+ | onAddToCartError | (error) => void | no | value => value | A callback function to be called when there is an error adding a ticket to the cart. |
393
+ | onGetTicketsSuccess | (data) => void | no | value => value | A callback function to be called when the tickets are successfully retrieved. |
394
+ | onGetTicketsError | (error) => void | no | value => value | A callback function to be called when there is an error retrieving the tickets. |
395
+ | onLogoutSuccess | () => void | no | value => value | A callback function to be called when the user successfully logs out. |
396
+ | onLogoutError | (error) => void | no | value => value | A callback function to be called when there is an error logging out. |
397
+ | onLoginSuccess | () => void | no | value => value | A callback function to be called when the user successfully logs in. |
398
+ | handleNotInvitedModalClose | () => void | no | value => value | A callback function to be called when the "Not Invited" modal is closed. |
399
+ | handleInvalidLinkModalClose | () => void | no | value => value | A callback function to be called when the "Invalid Link" modal is closed. |
400
+ | onReserveButtonClick | () => void | no | value => value | A callback function to be called when the 'Select on map' button is clicked. |
401
+ | onPendingVerification | () => void | no | value => value | A callback function to be called when the verification process is passed and pending response. |
269
402
 
270
403
  </details>
271
404
 
272
405
  &nbsp;
273
406
 
274
- ## Checkout Container
275
-
276
- Will show the order details and a card form that the user will need to fill with its card details.
277
- TicketFairy doesn't store any card related data, we use [Stripe](https://stripe.com/) as payments solution.
278
-
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. |
407
+ ## `AddOnsContainer`
408
+
409
+ Add-Ons component will retrieve and show a list of add-ons corresponding to selected event.
410
+
411
+ <details open>
412
+ <summary><b>Add-Ons Container Props Interface</b></summary>
413
+
414
+ | Property | Type | Required | Default value | Description |
415
+ | --------------------------- | --------------- | -------- | -------------- | ---------------------------------------------------------------------------------------------------- |
416
+ | classNamePrefix | string | no | 'add_on' | Prefix to use for the CSS class names of the component. |
417
+ | enableBillingInfoAutoCreate | boolean | no | true | Whether to enable auto-creation of billing information, instead of manually creation by user. |
418
+ | enableTimer | boolean | no | true | Whether to show a timer for the user. |
419
+ | - | - | - | - | - |
420
+ | onGetAddonsPageInfoSuccess | (data) => void | no | value => value | A callback function to be called when the add-ons page information is successfully fetched. |
421
+ | onGetAddonsPageInfoError | (error) => void | no | value => value | A callback function to be called when there is an error while fetching the add-ons page information. |
422
+ | onPostCheckoutSuccess | (data) => void | no | value => value | A callback function to be called when the add-ons are successfully added to the cart. |
423
+ | onPostCheckoutError | (error) => void | no | value => value | A callback function to be called when there is an error while adding add-ons to the cart. |
424
+ | onConfirmSelectionSuccess | (data) => void | no | value => value | A callback function to be called when the add-ons selection is successfully confirmed. |
425
+ | onConfirmSelectionError | (error) => void | no | value => value | A callback function to be called when there is an error while confirming the add-ons selection. |
426
+ | onCountdownFinish | () => void | no | value => value | A callback function that is called when the countdown timer finishes. |
427
+ | onPendingVerification | () => void | no | value => value | A callback function to be called when the verification process is passed and pending response. |
303
428
 
304
429
  </details>
305
430
 
306
431
  &nbsp;
307
432
 
308
- ## Confirmation Container
433
+ ## `BillingInfoContainer`
434
+ The component is responsible for managing the billing information during the checkout process. It provides a form that allows users to enter their billing information, including addresses and ticket holders' information.
435
+
436
+ Component includes also phone field, which validation functionality is provided by Twilio and integrated into the component. It provides an additional layer of verification and security during the ticket purchase process.
437
+
438
+ Props interface extends [Login Modal Interface](#login), [Register Modal Interface](#register), [Forgot Password Modal Interface](#forgot-password).
439
+
440
+ <details open>
441
+
442
+ | Property | Type | Required | Default Value | Description |
443
+ | --------------------------------- | -------------------------------------------- | -------- | ----------------------- | --------------------------------------------------------------------------------------------------- |
444
+ | data | IBillingInfoData[] | no | [] | Form fields list to be rendered to collect billing info data. |
445
+ | ticketHoldersFields | IBillingInfoData[] | no | [{ id: 1, fields: [] }] | Form fields list to be rendered to collect ticket holders data. |
446
+ | initialValues (deprecated) | { [key: string]: any } | no | {} | Form’s initial values. |
447
+ | theme | 'light' / 'dark' | no | 'light' | MUI Theme Provider’s theme. |
448
+ | isLoggedIn (deprecated) | - | - | - | - |
449
+ | onLogin (deprecated) | - | - | - | - |
450
+ | brandOptIn (deprecated) | - | - | - | - |
451
+ | shouldFetchCountries (deprecated) | - | - | - | - |
452
+ | accountInfoTitle | string / JSX.Element | no | “” | Render some text or JSX component above Login section. Do not available if there is logged in user. |
453
+ | hideLogo | boolean | no | false | Hide TicketFairy logo under “Login” button. |
454
+ | themeOptions | MUI ThemeOptions | no | N/A | MUI Theme Provider’s theme. |
455
+ | hideErrorsAlertSection | boolean | no | false | Hide form submit errors rendered by package. |
456
+ | skipPage | boolean | no | false | Enable skipping Billing Info page. |
457
+ | canSkipHolderNames | boolean | no | false | Allows the user to skip entering ticket holders' names. |
458
+ | enableTimer | boolean | no | false | Enables the countdown timer. |
459
+ | buttonName | string | no | false | The text to display on the submit button. |
460
+ | showPoweredByImage | boolean | no | false | Displays the "Powered by TheTicketFairy" image. |
461
+ | isCountryCodeEditable | boolean | no | true | Allows the user to edit the country code. |
462
+ | - | - | - | - | - |
463
+ | handleSubmit | (values, helpers, eventId, response) => void | no | value => value | A callback function that is called when the form is submitted. |
464
+ | onSubmitError | (error) => void | no | value => value | A callback function that is called when form submission fails. |
465
+ | onGetCartSuccess | (data) => void | no | value => value | A callback function that is called when the cart data is successfully retrieved. |
466
+ | onGetCartError | (error) => void | no | value => value | A callback function that is called when retrieving the cart data fails. |
467
+ | onErrorClose | () => void | no | value => value | A callback function that is called when the error message is closed. |
468
+ | onSkipBillingPage | (data) => void | no | value => value | A callback function that is called when the billing page skips. |
469
+ | onGetCountriesSuccess | (data) => void | no | value => value | A callback function that is called when the list of countries is successfully retrieved. |
470
+ | onGetCountriesError | (error) => void | no | value => value | A callback function that is called when retrieving the list of countries fails. |
471
+ | onGetStatesSuccess | (data) => void | no | value => value | A callback function that is called when the list of states is successfully retrieved. |
472
+ | onGetCountriesError | (error) => void | no | value => value | A callback function that is called when retrieving the list of states fails. |
473
+ | onAuthorizeSuccess | (data) => void | no | value => value | A callback function that is called when authorization is successful. |
474
+ | onAuthorizeError | (error) => void | no | value => value | A callback function that is called when authorization fails. |
475
+ | onCountdownFinish | () => void | no | value => value | A callback function that is called when the countdown timer finishes. |
476
+ | onPendingVerification | () => void | no | value => value | A callback function that is called when the verification process is passed and pending response. |
309
477
 
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.
478
+ </details>
311
479
 
312
- ### Confirmation Container Interface
480
+ &nbsp;
313
481
 
314
- <details>
315
- <summary><b>props</b></summary>
482
+ ## `PaymentContainer`
483
+ The component provides a form for users to enter their payment information and checkout. It accepts various props to customize the form and handle the checkout process.
484
+
485
+ <details open>
486
+
487
+ | Property | Type | Required | Default Value | Description |
488
+ | ----------------------- | ------------------------------- | -------- | -------------------- | ----------------------------------------------------------------------------------- |
489
+ | paymentFields | IPaymentField[] | yes | [] | An array of payment fields to render in the form. |
490
+ | checkoutData | { hash: string, total: number } | yes | N/A | An object containing checkout data, such as the order total and hash. |
491
+ | formTitle | string | no | 'Get Your Tickets' | Text to display above the payment form. |
492
+ | errorText | string | no | '' | Text to display if there is an error during the payment process. |
493
+ | paymentButtonText | string | no | 'Pay' | Text to display on the payment button. |
494
+ | paymentInfoLabel | string | no | 'Order Confirmation' | Text to display above the payment information section. |
495
+ | orderInfoLabel | string | no | 'Order Review' | Text to display above the order information section. |
496
+ | stripeCardOptions | StripeCardNumberElementOptions | no | {} | Options for the Stripe card input element. |
497
+ | elementsOptions | StripeElementsOptions | no | {} | Options for the Stripe Elements instance. |
498
+ | themeOptions | ThemeOptions | no | {} | An object containing theme options for the payment form. |
499
+ | enableTimer | boolean | no | false | Whether to show a timer for the user. |
500
+ | disableZipSection | boolean | no | false | Whether to show the zip code input field. |
501
+ | enablePaymentPlan | boolean | no | true | Whether to enable payment plans. |
502
+ | - | - | - | - | - |
503
+ | handlePayment | (data) => void | yes | value => value | A callback function to handle the payment process. |
504
+ | onPaymentError | (error) => void | no | value => value | A callback function that is called when the payment process fails. |
505
+ | onErrorClose | () => void | no | value => value | A callback function that is called when the error message is closed. |
506
+ | onGetPaymentDataSuccess | (data) => void | no | value => value | A callback function that is called when the payment data is successfully retrieved. |
507
+ | onGetPaymentDataError | (error) => void | no | value => value | A callback function that is called when retrieving the payment data fails. |
508
+ | onCountdownFinish | () => void | no | value => value | A callback function that is called when the countdown timer finishes. |
316
509
 
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 | - |
510
+ </details>
511
+
512
+ &nbsp;
513
+
514
+ ## `ConfirmationContainer`
515
+ The component is responsible for displaying the confirmation page after a successful payment.
516
+
517
+ <details open>
518
+
519
+ | Property | Type | Required | Default Value | Description |
520
+ | ---------------------------- | ------------------- | -------- | -------------- | ---------------------------------------------------------------------------------------- |
521
+ | isReferralEnabled | boolean | yes | false | Whether referral functionality is enabled. |
522
+ | showDefaultShareButtons | boolean | yes | false | Whether to display default share buttons. |
523
+ | shareButtons | IShareButton[] | yes | [] | Array of objects representing the share buttons. |
524
+ | messengerAppId | string | yes | N/A | Messenger App ID for Facebook share button. |
525
+ | orderHash | string | no | N/A | Hash value of the order. |
526
+ | clientLabel | string | no | 'Ticket Fairy' | Client's name. |
527
+ | confirmationLabels | IConfirmationLabels | no | {} | Object containing labels for the confirmation page. |
528
+ | hasCopyIcon | boolean | no | true | Whether to display a copy icon beside the referral link. |
529
+ | showReferralsInfoText | boolean | no | false | Whether to display referral information text. |
530
+ | showCopyInfoModal | boolean | no | false | Whether to display a copy info modal after the link is copied. |
531
+ | showPricingNoteSection | boolean | no | false | Whether to display the pricing note section. |
532
+ | - | - | - | - | - |
533
+ | onGetConfirmationDataSuccess | (data) => void | yes | value => value | A callback function that is called when the confirmation data is successfully retrieved. |
534
+ | onGetConfirmationDataError | (error) => void | yes | value => value | A callback function that is called when retrieving the confirmation data fails. |
535
+ | onLinkCopied | () => void | no | value => value | A callback function that is called when the referral link is copied. |
329
536
 
330
537
  </details>
331
538
 
332
539
  &nbsp;
333
540
 
334
- ## Orders Container
541
+ ## `MyTicketsContainer`
542
+ The component is responsible for rendering a list of orders with details and some customization options.
543
+
544
+ <details open>
545
+
546
+ | Property | Type | Required | Default Value | Description |
547
+ | ---------------------------- | ------------------- | -------- | -------------- | ---------------------------------------------------------------------------------------- |
548
+ | isReferralEnabled | boolean | yes | false | Whether referral functionality is enabled. |
549
+ | showDefaultShareButtons | boolean | yes | false | Whether to display default share buttons. |
550
+ | shareButtons | IShareButton[] | yes | [] | Array of objects representing the share buttons. |
551
+ | messengerAppId | string | yes | N/A | Messenger App ID for Facebook share button. |
552
+ | orderHash | string | no | N/A | Hash value of the order. |
553
+ | clientLabel | string | no | 'Ticket Fairy' | Client's name. |
554
+ | confirmationLabels | IConfirmationLabels | no | {} | Object containing labels for the confirmation page. |
555
+ | hasCopyIcon | boolean | no | true | Whether to display a copy icon beside the referral link. |
556
+ | showReferralsInfoText | boolean | no | false | Whether to display referral information text. |
557
+ | showCopyInfoModal | boolean | no | false | Whether to display a copy info modal after the link is copied. |
558
+ | showPricingNoteSection | boolean | no | false | Whether to display the pricing note section. |
559
+ | - | - | - | - | - |
560
+ | onGetConfirmationDataSuccess | (data) => void | yes | value => value | A callback function that is called when the confirmation data is successfully retrieved. |
561
+ | onGetConfirmationDataError | (error) => void | yes | value => value | A callback function that is called when retrieving the confirmation data fails. |
562
+ | onLinkCopied | () => void | no | value => value | A callback function that is called when the referral link is copied. |
563
+
564
+ </details>
335
565
 
336
- Will show the purchased orders for the logged user.
566
+ &nbsp;
337
567
 
338
- ### Orders Container Interface
568
+ ## Orders Container
339
569
 
570
+ Will show the purchased orders for the logged user.
340
571
  Orders container interface extends [Login Modal Interface](#login-modal-interface).
341
572
 
342
- <details>
343
- <summary><b>props</b></summary>
573
+ <details open>
574
+ <summary><b>Orders Container Props Interface:</b></summary>
344
575
 
345
576
  | Property | Type | Required | Default Value | Description |
346
577
  | ------------------ | ------------------------------ | -------- | -------------- | ---------------------------------------------------- |
@@ -357,24 +588,28 @@ Orders container interface extends [Login Modal Interface](#login-modal-interfac
357
588
 
358
589
  Will show the purchased order details. Contains `order PDF download` and `ticket resale` functionalities. Currently both functionalities are enabled by default.
359
590
 
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’. |
591
+ <details open>
592
+ <summary><b>Order Container Props Interface:</b></summary>
593
+
594
+ | Property | Type | Required | Default Value | Description |
595
+ | ------------------------- | ----------------------------------------- | -------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
596
+ | columns | [ { label: string } ] | yes | [] | Order details table’s columns’ labels. |
597
+ | ticketsTableColumns | ITicketsTableColumns[] <sup>[3](#3)</sup> | no | defaultTicketsTableColumns<sup>[3](#3)</sup> | Order’s tickets table’s columns. |
598
+ | displayColumnNameInRow | boolean | no | false | Display column’s names in row, instead of table header. |
599
+ | canSellTicket | boolean | no | true | A boolean value indicating whether the user can sell tickets. |
600
+ | ordersPath | string | no | | A string representing the URL of the page to which the "Back to Orders" and "Return to Order History" buttons will redirect the user. |
601
+ | orderId | string or number | no | | A string or number representing the ID of the order to be displayed. If this prop is not provided, the component will try to get the order ID from the query parameters of the URL. |
602
+ | referralTitle | string | no | "" | A string representing the title of the referral section. |
603
+ | itemsTitle | string | no | "" | A string representing the title of the items section. |
604
+ | ticketsTitle | string | no | "Your Tickets" | A string representing the title of the tickets table section. |
605
+ | personalLinkIcon | string | no | “” | Custom icon to display near personal share link. |
606
+ | onGetOrdersSuccess | Function: (data) => void | no | value => value | Called after fetching order data request’s success. |
607
+ | onGetOrdersError | Function: (error) => void | no | value => value | Called after fetching order data request’s failure. |
608
+ | onResaleTicketSuccess | Function: (data) => void | no | value => value | Called after resale ticket request’s success. |
609
+ | onResaleTicketError | Function: (error) => void | no | value => value | Called after resale ticket request’s failure. |
610
+ | onRemoveFromResaleSuccess | Function: (data) => void | no | value => value | Called after remove from resale ticket request’s success. |
611
+ | onRemoveFromResaleError | Function: (error) => void | no | value => value | Called after remove from resale ticket request’s failure. |
612
+ | onReturnButtonClick | Function: () => void | no | N/A | Called on “Return” button click. If not passed, button click will redirect to ‘/orders’. |
378
613
 
379
614
  </details>
380
615
 
@@ -384,10 +619,8 @@ Will show the purchased order details. Contains `order PDF download` and `ticket
384
619
 
385
620
  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
621
 
387
- ### Ticket Resale Container Interface
388
-
389
- <details>
390
- <summary><b>props</b></summary>
622
+ <details open>
623
+ <summary><b>Ticket Resale Container Props Interface:</b></summary>
391
624
 
392
625
  | Property | Type | Required | Default Value | Description |
393
626
  | ------------------------------ | ------------------------- | -------- | -------------- | ---------------------------------------------- |
@@ -400,7 +633,7 @@ Container renders information about accepting or declining of resold tickets. It
400
633
 
401
634
  &nbsp;
402
635
 
403
- <details>
636
+ <details open>
404
637
  <summary><small id="1">1. Share buttons</small></summary>
405
638
 
406
639
  ```
@@ -418,7 +651,7 @@ Default share options if `showDefaultShareButtons` is true, are: "Share on Faceb
418
651
 
419
652
  </details>
420
653
 
421
- <details>
654
+ <details open>
422
655
  <summary><small id="2">2. Confirmation Labels</small></summary>
423
656
 
424
657
  ```
@@ -439,7 +672,7 @@ const defaultConfirmationLabels = {
439
672
 
440
673
  </details>
441
674
 
442
- <details>
675
+ <details open>
443
676
  <summary><small id="3">3. Tickets table columns</small></summary>
444
677
 
445
678
  ```