tf-checkout-react 1.0.99 → 1.0.100-beta.2

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 (117) hide show
  1. package/README.md +278 -1
  2. package/dist/api/index.d.ts +31 -26
  3. package/dist/components/account-settings/index.d.ts +3 -0
  4. package/dist/components/billing-info-container/index.d.ts +5 -5
  5. package/dist/components/billing-info-container/utils.d.ts +1 -0
  6. package/dist/components/common/CustomField.d.ts +1 -1
  7. package/dist/components/common/DatePickerField.d.ts +14 -0
  8. package/dist/components/common/RedirectModal.d.ts +7 -0
  9. package/dist/components/common/SnackbarAlert.d.ts +13 -0
  10. package/dist/components/confirmationContainer/index.d.ts +2 -1
  11. package/dist/components/countdown/index.d.ts +4 -1
  12. package/dist/components/myTicketsContainer/tableConfig.d.ts +0 -1
  13. package/dist/components/orderDetailsContainer/index.d.ts +5 -1
  14. package/dist/components/orderDetailsContainer/ticketsTable.d.ts +4 -1
  15. package/dist/components/paymentContainer/index.d.ts +3 -1
  16. package/dist/components/rsvpContainer/index.d.ts +7 -0
  17. package/dist/components/stripePayment/index.d.ts +2 -1
  18. package/dist/components/ticketResale/index.d.ts +5 -3
  19. package/dist/components/ticketsContainer/AccessCodeSection.d.ts +7 -0
  20. package/dist/components/ticketsContainer/PromoCodeSection.d.ts +6 -9
  21. package/dist/components/ticketsContainer/TicketsSection.d.ts +5 -3
  22. package/dist/components/ticketsContainer/index.d.ts +13 -2
  23. package/dist/components/timerWidget/index.d.ts +3 -3
  24. package/dist/env.d.ts +1 -0
  25. package/dist/images/cross.svg +44 -0
  26. package/dist/images/done.svg +3 -3
  27. package/dist/index.d.ts +2 -0
  28. package/dist/tf-checkout-react.cjs.development.js +1400 -575
  29. package/dist/tf-checkout-react.cjs.development.js.map +1 -1
  30. package/dist/tf-checkout-react.cjs.production.min.js +1 -1
  31. package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
  32. package/dist/tf-checkout-react.esm.js +1409 -586
  33. package/dist/tf-checkout-react.esm.js.map +1 -1
  34. package/dist/tf-checkout-styles.css +1 -1
  35. package/dist/utils/cookies.d.ts +3 -0
  36. package/dist/utils/createCheckoutDataBodyWithDefaultHolder.d.ts +6 -1
  37. package/dist/utils/downloadPDF.d.ts +1 -1
  38. package/dist/utils/getDomain.d.ts +1 -0
  39. package/dist/utils/index.d.ts +2 -0
  40. package/package.json +89 -89
  41. package/src/.DS_Store +0 -0
  42. package/src/.d.ts +2 -2
  43. package/src/api/index.ts +313 -278
  44. package/src/assets/images/cross.svg +44 -0
  45. package/src/assets/images/done.svg +3 -3
  46. package/src/components/.DS_Store +0 -0
  47. package/src/components/account-settings/index.tsx +161 -0
  48. package/src/components/account-settings/style.css +200 -0
  49. package/src/components/billing-info-container/index.tsx +821 -777
  50. package/src/components/billing-info-container/style.css +106 -106
  51. package/src/components/billing-info-container/utils.ts +233 -223
  52. package/src/components/common/CheckboxField.tsx +41 -41
  53. package/src/components/common/CustomField.tsx +87 -84
  54. package/src/components/common/DatePickerField.tsx +98 -0
  55. package/src/components/common/FormikPhoneNumberField.tsx +51 -51
  56. package/src/components/common/Loader.tsx +9 -9
  57. package/src/components/common/RadioField.tsx +35 -35
  58. package/src/components/common/RedirectModal.tsx +43 -0
  59. package/src/components/common/SelectField.tsx +80 -80
  60. package/src/components/common/SnackbarAlert.tsx +54 -0
  61. package/src/components/common/dist/PhoneNumberField.js +96 -0
  62. package/src/components/common/index.tsx +4 -4
  63. package/src/components/confirmModal/index.tsx +51 -51
  64. package/src/components/confirmModal/style.css +21 -21
  65. package/src/components/confirmationContainer/config.ts +72 -72
  66. package/src/components/confirmationContainer/index.tsx +197 -194
  67. package/src/components/confirmationContainer/social-buttons.tsx +94 -94
  68. package/src/components/confirmationContainer/style.css +202 -202
  69. package/src/components/countdown/index.tsx +100 -89
  70. package/src/components/countdown/style.css +9 -9
  71. package/src/components/index.ts +7 -7
  72. package/src/components/loginModal/index.tsx +171 -209
  73. package/src/components/loginModal/style.css +71 -71
  74. package/src/components/myTicketsContainer/index.tsx +201 -137
  75. package/src/components/myTicketsContainer/row.tsx +41 -41
  76. package/src/components/myTicketsContainer/style.css +40 -40
  77. package/src/components/myTicketsContainer/tableConfig.tsx +32 -34
  78. package/src/components/orderDetailsContainer/index.tsx +289 -249
  79. package/src/components/orderDetailsContainer/style.css +73 -73
  80. package/src/components/orderDetailsContainer/ticketsTable.tsx +177 -124
  81. package/src/components/paymentContainer/index.tsx +352 -284
  82. package/src/components/registerModal/index.tsx +183 -190
  83. package/src/components/rsvpContainer/index.tsx +126 -0
  84. package/src/components/stripePayment/index.tsx +258 -253
  85. package/src/components/stripePayment/style.css +60 -60
  86. package/src/components/ticketResale/index.tsx +74 -56
  87. package/src/components/ticketResaleModal/index.tsx +213 -210
  88. package/src/components/ticketResaleModal/style.css +28 -28
  89. package/src/components/ticketsContainer/AccessCodeSection.tsx +50 -0
  90. package/src/components/ticketsContainer/PromoCodeSection.tsx +89 -99
  91. package/src/components/ticketsContainer/ReferralLogic.tsx +31 -33
  92. package/src/components/ticketsContainer/TicketRow.tsx +89 -83
  93. package/src/components/ticketsContainer/TicketsSection.tsx +87 -81
  94. package/src/components/ticketsContainer/index.tsx +506 -409
  95. package/src/components/ticketsContainer/style.css +181 -181
  96. package/src/components/ticketsContainer/utils.ts +11 -11
  97. package/src/components/timerWidget/index.tsx +87 -70
  98. package/src/components/timerWidget/style.css +34 -26
  99. package/src/components/waitingList/index.tsx +178 -178
  100. package/src/components/waitingList/style.css +26 -26
  101. package/src/env.ts +20 -19
  102. package/src/index.ts +15 -13
  103. package/src/normalizers/index.ts +45 -45
  104. package/src/types/billing-info-data.ts +37 -37
  105. package/src/types/payment-field.ts +7 -7
  106. package/src/types/referral-promotion.ts +7 -7
  107. package/src/utils/cookies.ts +42 -0
  108. package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +71 -59
  109. package/src/utils/downloadPDF.tsx +52 -30
  110. package/src/utils/formikErrorFocus.ts +24 -24
  111. package/src/utils/getDomain.ts +15 -0
  112. package/src/utils/getImage.ts +14 -14
  113. package/src/utils/getQueryVariable.ts +13 -13
  114. package/src/utils/index.ts +7 -5
  115. package/src/utils/setConfigs.ts +26 -26
  116. package/src/utils/showZero.tsx +10 -10
  117. package/src/validators/index.ts +20 -20
@@ -1,73 +1,73 @@
1
- .order-details {
2
- max-width: 940px;
3
- margin: 0 auto;
4
- }
5
- .order-details .loading {
6
- width: 100%;
7
- display: flex;
8
- justify-content: center;
9
- align-items: center;
10
- height: 100vh;
11
- position: fixed;
12
- top: 0;
13
- left: 0;
14
- background-color: rgba(0, 0, 0, .4);
15
- z-index: 1400;
16
- }
17
- .order-details .layout-title {
18
- font-size: 24px;
19
- font-weight: 400;
20
- }
21
- .order-details .sub-title {
22
- font-size: 18px;
23
- font-weight: 400;
24
- margin: 10px 0;
25
- }
26
- .order-details .order-summary-box {
27
- margin-top: 30px;
28
- }
29
- .order-details .total-row td {
30
- font-weight: 700;
31
- color: white;
32
- }
33
- .order-details th {
34
- font-weight: 700;
35
- color: white;
36
- }
37
- .order-details .tickets-box {
38
- margin-top: 30px;
39
- }
40
- .order-details .ticket-add-on-table {
41
- background-color: #fcf8e3;;
42
- }
43
- .order-details .action-button {
44
- width: max-content;
45
- font-weight: 400;
46
- font-size: 14px;
47
- line-height: normal;
48
- min-height: auto;
49
- padding: 12px;
50
- border: 1px solid white;
51
- margin-top: 20px;
52
- margin-bottom: 20px;
53
- background-color: #212529;
54
- border-radius: 0;
55
- color: #fff;
56
- position: relative;
57
- display: block;
58
- cursor: pointer;
59
- font-family: 'Bebas Neue';
60
- text-transform: uppercase;
61
- text-align: center;
62
- overflow: hidden;
63
- text-overflow: ellipsis;
64
- outline: none;
65
- text-decoration: none;
66
- }
67
- .order-details .download-button:hover {
68
- background-color: #505050;
69
- }
70
-
71
- .order-details .personal-link {
72
- padding: 20px 0;
73
- }
1
+ .order-details {
2
+ max-width: 940px;
3
+ margin: 0 auto;
4
+ }
5
+ .order-details .loading {
6
+ width: 100%;
7
+ display: flex;
8
+ justify-content: center;
9
+ align-items: center;
10
+ height: 100vh;
11
+ position: fixed;
12
+ top: 0;
13
+ left: 0;
14
+ background-color: rgba(0, 0, 0, 0.4);
15
+ z-index: 1400;
16
+ }
17
+ .order-details .layout-title {
18
+ font-size: 24px;
19
+ font-weight: 400;
20
+ }
21
+ .order-details .sub-title {
22
+ font-size: 18px;
23
+ font-weight: 400;
24
+ margin: 10px 0;
25
+ }
26
+ .order-details .order-summary-box {
27
+ margin-top: 30px;
28
+ }
29
+ .order-details .total-row td {
30
+ font-weight: 700;
31
+ color: white;
32
+ }
33
+ .order-details th {
34
+ font-weight: 700;
35
+ color: white;
36
+ }
37
+ .order-details .tickets-box {
38
+ margin-top: 30px;
39
+ }
40
+ .order-details .ticket-add-on-table {
41
+ background-color: #fcf8e3;
42
+ }
43
+ .order-details .action-button {
44
+ width: max-content;
45
+ font-weight: 400;
46
+ font-size: 14px;
47
+ line-height: normal;
48
+ min-height: auto;
49
+ padding: 12px;
50
+ border: 1px solid white;
51
+ margin-top: 20px;
52
+ margin-bottom: 20px;
53
+ background-color: #212529;
54
+ border-radius: 0;
55
+ color: #fff;
56
+ position: relative;
57
+ display: block;
58
+ cursor: pointer;
59
+ font-family: 'Bebas Neue';
60
+ text-transform: uppercase;
61
+ text-align: center;
62
+ overflow: hidden;
63
+ text-overflow: ellipsis;
64
+ outline: none;
65
+ text-decoration: none;
66
+ }
67
+ .order-details .download-button:hover {
68
+ background-color: #505050;
69
+ }
70
+
71
+ .order-details .personal-link {
72
+ padding: 20px 0;
73
+ }
@@ -1,124 +1,177 @@
1
- import React, { Fragment } from 'react'
2
- import Table from '@mui/material/Table'
3
- import TableBody from '@mui/material/TableBody'
4
- import TableCell from '@mui/material/TableCell'
5
- import TableContainer from '@mui/material/TableContainer'
6
- import TableHead from '@mui/material/TableHead'
7
- import TableRow from '@mui/material/TableRow'
8
- import Paper from '@mui/material/Paper'
9
- import { downloadPDF } from '../../utils'
10
-
11
- interface IAddOnTypes {
12
- name: string;
13
- status: string;
14
- }
15
- export interface ITicketTypes {
16
- add_ons?: IAddOnTypes[];
17
- hash: string;
18
- ticket_type: string;
19
- holder_name: string;
20
- status: string;
21
- pdf_link: string;
22
- is_sellable: boolean;
23
- is_on_sale?: boolean;
24
- event_name: string;
25
- currency: string;
26
- resale_fee_amount: number | string;
27
- }
28
-
29
- interface TicketsTableTypes {
30
- tickets: ITicketTypes[];
31
- handleSellTicket: (ticket: ITicketTypes) => void;
32
- handleRemoveFromResale: (ticket: ITicketTypes) => void;
33
- }
34
-
35
- const TicketsTable = ({
36
- tickets = [],
37
- handleSellTicket = () => {},
38
- handleRemoveFromResale = () => {}
39
- }: TicketsTableTypes) => (
40
- <div className="tickets-box">
41
- <h4 className="sub-title">Your Tickets</h4>
42
- <TableContainer component={Paper}>
43
- <Table aria-label="collapsible table">
44
- <TableHead>
45
- <TableRow>
46
- <TableCell>Ticket ID</TableCell>
47
- <TableCell>Ticket Type</TableCell>
48
- <TableCell>Ticket Holder Name</TableCell>
49
- <TableCell>Status</TableCell>
50
- <TableCell>Download</TableCell>
51
- <TableCell />
52
- </TableRow>
53
- </TableHead>
54
- <TableBody>
55
- {tickets.map((ticket: ITicketTypes, index: number) => (
56
- <Fragment key={index}>
57
- <TableRow>
58
- <TableCell>{ticket.hash}</TableCell>
59
- <TableCell>{ticket.ticket_type}</TableCell>
60
- <TableCell>{ticket.holder_name}</TableCell>
61
- <TableCell>{ticket.status}</TableCell>
62
- <TableCell>
63
- <span
64
- aria-hidden={true}
65
- className="action-button"
66
- onClick={() => downloadPDF(ticket.pdf_link)}
67
- >
68
- Download
69
- </span>
70
- </TableCell>
71
- <TableCell>
72
- {ticket.is_sellable && (
73
- <span
74
- aria-hidden={true}
75
- className="action-button"
76
- onClick={() => handleSellTicket(ticket)}
77
- >
78
- Sell Ticket
79
- </span>
80
- )}
81
- {ticket.is_on_sale && (
82
- <span
83
- aria-hidden={true}
84
- className="action-button"
85
- onClick={() => handleRemoveFromResale(ticket)}
86
- >
87
- Remove from Resale
88
- </span>
89
- )}
90
- </TableCell>
91
- </TableRow>
92
- {!!ticket.add_ons?.length && (
93
- <TableRow>
94
- <TableCell colSpan={6}>
95
- <Table className="ticket-add-on-table">
96
- <TableHead>
97
- <TableRow>
98
- <TableCell>Add-On</TableCell>
99
- <TableCell>Status</TableCell>
100
- </TableRow>
101
- </TableHead>
102
- <TableBody>
103
- {ticket.add_ons.map(
104
- (add_on: IAddOnTypes, index: number) => (
105
- <TableRow key={index}>
106
- <TableCell>{add_on.name}</TableCell>
107
- <TableCell>{add_on.status}</TableCell>
108
- </TableRow>
109
- )
110
- )}
111
- </TableBody>
112
- </Table>
113
- </TableCell>
114
- </TableRow>
115
- )}
116
- </Fragment>
117
- ))}
118
- </TableBody>
119
- </Table>
120
- </TableContainer>
121
- </div>
122
- )
123
-
124
- export default TicketsTable
1
+ import React, { Fragment, useState } from 'react'
2
+ import Table from '@mui/material/Table'
3
+ import TableBody from '@mui/material/TableBody'
4
+ import TableCell from '@mui/material/TableCell'
5
+ import TableContainer from '@mui/material/TableContainer'
6
+ import TableHead from '@mui/material/TableHead'
7
+ import TableRow from '@mui/material/TableRow'
8
+ import Paper from '@mui/material/Paper'
9
+ import { downloadPDF } from '../../utils'
10
+ import SnackbarAlert from '../common/SnackbarAlert'
11
+
12
+ interface IAddOnTypes {
13
+ name: string
14
+ status: string
15
+ }
16
+ export interface ITicketTypes {
17
+ add_ons?: IAddOnTypes[]
18
+ hash: string
19
+ ticket_type: string
20
+ holder_name: string
21
+ status: string
22
+ pdf_link: string
23
+ is_sellable: boolean
24
+ is_on_sale?: boolean
25
+ event_name: string
26
+ currency: string
27
+ resale_fee_amount: number | string
28
+ ticket_type_hash: string
29
+ ticket_type_is_active?: boolean
30
+ }
31
+
32
+ interface TicketsTableTypes {
33
+ tickets: ITicketTypes[];
34
+ handleSellTicket: (ticket: ITicketTypes) => void;
35
+ handleRemoveFromResale: (ticket: ITicketTypes) => void;
36
+
37
+ icon?: string;
38
+ }
39
+
40
+ const TicketsTable = ({
41
+ tickets = [],
42
+ handleSellTicket = () => {},
43
+ handleRemoveFromResale = () => {},
44
+ icon = '',
45
+ }: TicketsTableTypes) => {
46
+ const [pdfError, setPdfError] = useState<any>(null)
47
+ return (
48
+ <div className="tickets-box">
49
+ <SnackbarAlert
50
+ type="error"
51
+ isOpen={!!pdfError}
52
+ message={pdfError || ''}
53
+ onClose={() => setPdfError(null)}
54
+ />
55
+ <h4 className="sub-title">Your Tickets</h4>
56
+ <TableContainer component={Paper}>
57
+ <Table aria-label="collapsible table">
58
+ <TableHead>
59
+ <TableRow>
60
+ <TableCell></TableCell>
61
+ <TableCell></TableCell>
62
+ <TableCell></TableCell>
63
+ <TableCell></TableCell>
64
+ <TableCell></TableCell>
65
+ <TableCell />
66
+ </TableRow>
67
+ </TableHead>
68
+ <TableBody>
69
+ {tickets.map((ticket: ITicketTypes, index: number) => (
70
+ <Fragment key={index}>
71
+ <TableRow>
72
+ <TableCell>
73
+ <div className="cell-block">
74
+ <span>Ticket ID</span>
75
+ <span>{ticket.hash}</span>
76
+ </div>
77
+ </TableCell>
78
+ <TableCell>
79
+ <div className="cell-block">
80
+ <span>Ticket Type</span>
81
+ <span>{ticket.ticket_type}</span>
82
+ </div>
83
+ </TableCell>
84
+ <TableCell>
85
+ <div className="cell-block">
86
+ <span>Ticket Holder</span>
87
+ <span>{ticket.holder_name}</span>
88
+ </div>
89
+ </TableCell>
90
+ <TableCell>
91
+ <div className="cell-block">
92
+ <span>Status</span>
93
+ <span>{ticket.status}</span>
94
+ </div>
95
+ </TableCell>
96
+ <TableCell>
97
+ {ticket.status !== 'Sold' && (
98
+ <div className="tb-download">
99
+ {Boolean(icon) && <img src={icon} alt="" />}
100
+ <span
101
+ aria-hidden={true}
102
+ className="action-button"
103
+ onClick={async () => {
104
+ try {
105
+ const pdfDownloadError = await downloadPDF(
106
+ ticket.pdf_link
107
+ )
108
+ if (pdfDownloadError) {
109
+ setPdfError(pdfDownloadError?.message)
110
+ }
111
+ } catch (err) {
112
+ if (err && typeof err === 'string') {
113
+ setPdfError(err)
114
+ }
115
+ }
116
+ }}
117
+ >
118
+ Download
119
+ </span>
120
+ </div>
121
+ )}
122
+ </TableCell>
123
+ <TableCell>
124
+ {ticket.is_sellable && (
125
+ <span
126
+ aria-hidden={true}
127
+ className="action-button"
128
+ onClick={() => handleSellTicket(ticket)}
129
+ >
130
+ Sell Ticket
131
+ </span>
132
+ )}
133
+ {ticket.is_on_sale && (
134
+ <span
135
+ aria-hidden={true}
136
+ className="action-button"
137
+ onClick={() => handleRemoveFromResale(ticket)}
138
+ >
139
+ Remove from Resale
140
+ </span>
141
+ )}
142
+ </TableCell>
143
+ </TableRow>
144
+ {!!ticket.add_ons?.length && (
145
+ <TableRow>
146
+ <TableCell colSpan={6}>
147
+ <Table className="ticket-add-on-table">
148
+ <TableHead>
149
+ <TableRow>
150
+ <TableCell>Add-On</TableCell>
151
+ <TableCell>Status</TableCell>
152
+ </TableRow>
153
+ </TableHead>
154
+ <TableBody>
155
+ {ticket.add_ons.map(
156
+ (add_on: IAddOnTypes, index: number) => (
157
+ <TableRow key={index}>
158
+ <TableCell>{add_on.name}</TableCell>
159
+ <TableCell>{add_on.status}</TableCell>
160
+ </TableRow>
161
+ )
162
+ )}
163
+ </TableBody>
164
+ </Table>
165
+ </TableCell>
166
+ </TableRow>
167
+ )}
168
+ </Fragment>
169
+ ))}
170
+ </TableBody>
171
+ </Table>
172
+ </TableContainer>
173
+ </div>
174
+ )
175
+ }
176
+
177
+ export default TicketsTable