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.
- package/README.md +278 -1
- package/dist/api/index.d.ts +31 -26
- package/dist/components/account-settings/index.d.ts +3 -0
- package/dist/components/billing-info-container/index.d.ts +5 -5
- package/dist/components/billing-info-container/utils.d.ts +1 -0
- package/dist/components/common/CustomField.d.ts +1 -1
- package/dist/components/common/DatePickerField.d.ts +14 -0
- package/dist/components/common/RedirectModal.d.ts +7 -0
- package/dist/components/common/SnackbarAlert.d.ts +13 -0
- package/dist/components/confirmationContainer/index.d.ts +2 -1
- package/dist/components/countdown/index.d.ts +4 -1
- package/dist/components/myTicketsContainer/tableConfig.d.ts +0 -1
- package/dist/components/orderDetailsContainer/index.d.ts +5 -1
- package/dist/components/orderDetailsContainer/ticketsTable.d.ts +4 -1
- package/dist/components/paymentContainer/index.d.ts +3 -1
- package/dist/components/rsvpContainer/index.d.ts +7 -0
- package/dist/components/stripePayment/index.d.ts +2 -1
- package/dist/components/ticketResale/index.d.ts +5 -3
- package/dist/components/ticketsContainer/AccessCodeSection.d.ts +7 -0
- package/dist/components/ticketsContainer/PromoCodeSection.d.ts +6 -9
- package/dist/components/ticketsContainer/TicketsSection.d.ts +5 -3
- package/dist/components/ticketsContainer/index.d.ts +13 -2
- package/dist/components/timerWidget/index.d.ts +3 -3
- package/dist/env.d.ts +1 -0
- package/dist/images/cross.svg +44 -0
- package/dist/images/done.svg +3 -3
- package/dist/index.d.ts +2 -0
- package/dist/tf-checkout-react.cjs.development.js +1400 -575
- 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 +1409 -586
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/dist/utils/cookies.d.ts +3 -0
- package/dist/utils/createCheckoutDataBodyWithDefaultHolder.d.ts +6 -1
- package/dist/utils/downloadPDF.d.ts +1 -1
- package/dist/utils/getDomain.d.ts +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/package.json +89 -89
- package/src/.DS_Store +0 -0
- package/src/.d.ts +2 -2
- package/src/api/index.ts +313 -278
- package/src/assets/images/cross.svg +44 -0
- package/src/assets/images/done.svg +3 -3
- package/src/components/.DS_Store +0 -0
- package/src/components/account-settings/index.tsx +161 -0
- package/src/components/account-settings/style.css +200 -0
- package/src/components/billing-info-container/index.tsx +821 -777
- package/src/components/billing-info-container/style.css +106 -106
- package/src/components/billing-info-container/utils.ts +233 -223
- package/src/components/common/CheckboxField.tsx +41 -41
- package/src/components/common/CustomField.tsx +87 -84
- package/src/components/common/DatePickerField.tsx +98 -0
- package/src/components/common/FormikPhoneNumberField.tsx +51 -51
- package/src/components/common/Loader.tsx +9 -9
- package/src/components/common/RadioField.tsx +35 -35
- package/src/components/common/RedirectModal.tsx +43 -0
- package/src/components/common/SelectField.tsx +80 -80
- package/src/components/common/SnackbarAlert.tsx +54 -0
- package/src/components/common/dist/PhoneNumberField.js +96 -0
- package/src/components/common/index.tsx +4 -4
- package/src/components/confirmModal/index.tsx +51 -51
- package/src/components/confirmModal/style.css +21 -21
- package/src/components/confirmationContainer/config.ts +72 -72
- package/src/components/confirmationContainer/index.tsx +197 -194
- package/src/components/confirmationContainer/social-buttons.tsx +94 -94
- package/src/components/confirmationContainer/style.css +202 -202
- package/src/components/countdown/index.tsx +100 -89
- package/src/components/countdown/style.css +9 -9
- package/src/components/index.ts +7 -7
- package/src/components/loginModal/index.tsx +171 -209
- package/src/components/loginModal/style.css +71 -71
- package/src/components/myTicketsContainer/index.tsx +201 -137
- package/src/components/myTicketsContainer/row.tsx +41 -41
- package/src/components/myTicketsContainer/style.css +40 -40
- package/src/components/myTicketsContainer/tableConfig.tsx +32 -34
- package/src/components/orderDetailsContainer/index.tsx +289 -249
- package/src/components/orderDetailsContainer/style.css +73 -73
- package/src/components/orderDetailsContainer/ticketsTable.tsx +177 -124
- package/src/components/paymentContainer/index.tsx +352 -284
- package/src/components/registerModal/index.tsx +183 -190
- package/src/components/rsvpContainer/index.tsx +126 -0
- package/src/components/stripePayment/index.tsx +258 -253
- package/src/components/stripePayment/style.css +60 -60
- package/src/components/ticketResale/index.tsx +74 -56
- package/src/components/ticketResaleModal/index.tsx +213 -210
- package/src/components/ticketResaleModal/style.css +28 -28
- package/src/components/ticketsContainer/AccessCodeSection.tsx +50 -0
- package/src/components/ticketsContainer/PromoCodeSection.tsx +89 -99
- package/src/components/ticketsContainer/ReferralLogic.tsx +31 -33
- package/src/components/ticketsContainer/TicketRow.tsx +89 -83
- package/src/components/ticketsContainer/TicketsSection.tsx +87 -81
- package/src/components/ticketsContainer/index.tsx +506 -409
- package/src/components/ticketsContainer/style.css +181 -181
- package/src/components/ticketsContainer/utils.ts +11 -11
- package/src/components/timerWidget/index.tsx +87 -70
- package/src/components/timerWidget/style.css +34 -26
- package/src/components/waitingList/index.tsx +178 -178
- package/src/components/waitingList/style.css +26 -26
- package/src/env.ts +20 -19
- package/src/index.ts +15 -13
- package/src/normalizers/index.ts +45 -45
- package/src/types/billing-info-data.ts +37 -37
- package/src/types/payment-field.ts +7 -7
- package/src/types/referral-promotion.ts +7 -7
- package/src/utils/cookies.ts +42 -0
- package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +71 -59
- package/src/utils/downloadPDF.tsx +52 -30
- package/src/utils/formikErrorFocus.ts +24 -24
- package/src/utils/getDomain.ts +15 -0
- package/src/utils/getImage.ts +14 -14
- package/src/utils/getQueryVariable.ts +13 -13
- package/src/utils/index.ts +7 -5
- package/src/utils/setConfigs.ts +26 -26
- package/src/utils/showZero.tsx +10 -10
- package/src/validators/index.ts +20 -20
|
@@ -1,249 +1,289 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import './style.css'
|
|
3
|
-
|
|
4
|
-
import Table from '@mui/material/Table'
|
|
5
|
-
import TableBody from '@mui/material/TableBody'
|
|
6
|
-
import TableCell from '@mui/material/TableCell'
|
|
7
|
-
import TableContainer from '@mui/material/TableContainer'
|
|
8
|
-
import TableHead from '@mui/material/TableHead'
|
|
9
|
-
import TableRow from '@mui/material/TableRow'
|
|
10
|
-
import Paper from '@mui/material/Paper'
|
|
11
|
-
import CircularProgress from '@mui/material/CircularProgress'
|
|
12
|
-
import _get from 'lodash/get'
|
|
13
|
-
import _has from 'lodash/has'
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
className="
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import './style.css'
|
|
3
|
+
|
|
4
|
+
import Table from '@mui/material/Table'
|
|
5
|
+
import TableBody from '@mui/material/TableBody'
|
|
6
|
+
import TableCell from '@mui/material/TableCell'
|
|
7
|
+
import TableContainer from '@mui/material/TableContainer'
|
|
8
|
+
import TableHead from '@mui/material/TableHead'
|
|
9
|
+
import TableRow from '@mui/material/TableRow'
|
|
10
|
+
import Paper from '@mui/material/Paper'
|
|
11
|
+
import CircularProgress from '@mui/material/CircularProgress'
|
|
12
|
+
import _get from 'lodash/get'
|
|
13
|
+
import _has from 'lodash/has'
|
|
14
|
+
import _find from 'lodash/find'
|
|
15
|
+
import _map from 'lodash/map'
|
|
16
|
+
import { getOrderDetails } from '../../api'
|
|
17
|
+
import TicketsTable, { ITicketTypes } from './ticketsTable'
|
|
18
|
+
import { TicketResaleModal, InitialValuesTypes } from '../ticketResaleModal'
|
|
19
|
+
import ConfirmModal from '../confirmModal'
|
|
20
|
+
import { resaleTicket, removeFromResale } from '../../api'
|
|
21
|
+
|
|
22
|
+
interface TicketTypes {
|
|
23
|
+
currency: string;
|
|
24
|
+
discount: string;
|
|
25
|
+
name: string;
|
|
26
|
+
price: string;
|
|
27
|
+
quantity: string;
|
|
28
|
+
total: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface OrderDetailsTypes {
|
|
32
|
+
columns: Array<{ label: string }>;
|
|
33
|
+
onGetOrdersSuccess: (res: any) => void;
|
|
34
|
+
onGetOrdersError: (err: any) => void;
|
|
35
|
+
personalLinkIcon?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const getTotal = (data: any) => {
|
|
39
|
+
if (!data?.total || !_has(data, 'items.ticket_types.length')) return ''
|
|
40
|
+
|
|
41
|
+
return data.items.ticket_types[0].currency + data.total
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const OrderDetailsContainer = ({
|
|
45
|
+
columns = [],
|
|
46
|
+
onGetOrdersSuccess = () => {},
|
|
47
|
+
onGetOrdersError = () => {},
|
|
48
|
+
personalLinkIcon = '',
|
|
49
|
+
}: OrderDetailsTypes) => {
|
|
50
|
+
const [data, setData] = useState<any>({})
|
|
51
|
+
const [loading, setLoading] = useState(true)
|
|
52
|
+
const [showResaleModal, setShowResaleModal] = useState(false)
|
|
53
|
+
const [showRemoveResaleModal, setShowRemoveResaleModal] = useState(false)
|
|
54
|
+
const [activeTicket, setActiveTicket] = useState<any>(null)
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
(async () => {
|
|
58
|
+
try {
|
|
59
|
+
setLoading(true)
|
|
60
|
+
let orderId = ''
|
|
61
|
+
if (typeof window !== 'undefined') {
|
|
62
|
+
const params: URLSearchParams = new URL(`${window.location}`)
|
|
63
|
+
.searchParams
|
|
64
|
+
orderId = params.get('o') || ''
|
|
65
|
+
}
|
|
66
|
+
const response = await getOrderDetails(orderId)
|
|
67
|
+
onGetOrdersSuccess(response)
|
|
68
|
+
|
|
69
|
+
const data = _get(response, 'data.data.attributes')
|
|
70
|
+
|
|
71
|
+
setData(data)
|
|
72
|
+
} catch (error) {
|
|
73
|
+
onGetOrdersError(error)
|
|
74
|
+
} finally {
|
|
75
|
+
setLoading(false)
|
|
76
|
+
}
|
|
77
|
+
})()
|
|
78
|
+
}, [])
|
|
79
|
+
|
|
80
|
+
const handleSellTicket = (ticket: ITicketTypes) => {
|
|
81
|
+
const ticketTypesArr = data.items.ticket_types
|
|
82
|
+
const sellTicketType = _find(
|
|
83
|
+
ticketTypesArr,
|
|
84
|
+
ticketType => ticketType.hash === ticket.ticket_type_hash
|
|
85
|
+
)
|
|
86
|
+
setActiveTicket({
|
|
87
|
+
...ticket,
|
|
88
|
+
ticket_type_is_active: sellTicketType?.active,
|
|
89
|
+
})
|
|
90
|
+
setShowResaleModal(true)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const handleOnClose = () => {
|
|
94
|
+
setShowResaleModal(false)
|
|
95
|
+
setActiveTicket(null)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const handleOnSubmit = async (values: InitialValuesTypes) => {
|
|
99
|
+
try {
|
|
100
|
+
setLoading(true)
|
|
101
|
+
const {
|
|
102
|
+
to,
|
|
103
|
+
first_name,
|
|
104
|
+
last_name,
|
|
105
|
+
email,
|
|
106
|
+
confirm_email,
|
|
107
|
+
confirm,
|
|
108
|
+
} = values
|
|
109
|
+
const formData = new FormData()
|
|
110
|
+
formData.append('to', to)
|
|
111
|
+
formData.append('first_name', first_name)
|
|
112
|
+
formData.append('last_name', last_name)
|
|
113
|
+
formData.append('email', email)
|
|
114
|
+
formData.append('confirm_email', confirm_email)
|
|
115
|
+
formData.append('confirm', String(confirm))
|
|
116
|
+
|
|
117
|
+
await resaleTicket(formData, activeTicket.hash)
|
|
118
|
+
const updatedData = { ...data }
|
|
119
|
+
updatedData?.tickets?.forEach((ticket: ITicketTypes) => {
|
|
120
|
+
if (ticket.hash === activeTicket.hash) {
|
|
121
|
+
ticket.is_sellable = false
|
|
122
|
+
ticket.is_on_sale = true
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
setData(updatedData)
|
|
127
|
+
} catch (error) {
|
|
128
|
+
// ...
|
|
129
|
+
} finally {
|
|
130
|
+
setShowResaleModal(false)
|
|
131
|
+
setLoading(false)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const handleRemoveFromResale = (ticket: ITicketTypes) => {
|
|
136
|
+
setShowRemoveResaleModal(true)
|
|
137
|
+
setActiveTicket(ticket)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const onCloseRemoveResale = () => {
|
|
141
|
+
setShowRemoveResaleModal(false)
|
|
142
|
+
setActiveTicket(null)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const onConfirmRemoveResale = async () => {
|
|
146
|
+
try {
|
|
147
|
+
setLoading(true)
|
|
148
|
+
await removeFromResale(activeTicket.hash)
|
|
149
|
+
const updatedData = { ...data }
|
|
150
|
+
updatedData?.tickets?.forEach((ticket: ITicketTypes) => {
|
|
151
|
+
if (ticket.hash === activeTicket.hash) {
|
|
152
|
+
ticket.is_sellable = true
|
|
153
|
+
ticket.is_on_sale = false
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
setData(updatedData)
|
|
158
|
+
} catch (error) {
|
|
159
|
+
// ...
|
|
160
|
+
} finally {
|
|
161
|
+
setShowRemoveResaleModal(false)
|
|
162
|
+
setLoading(false)
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
let orderSummery = `ID ${data.id}, placed`
|
|
167
|
+
if (data.date) {
|
|
168
|
+
orderSummery += ` ${data.date}`
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return (
|
|
172
|
+
<div className="order-details">
|
|
173
|
+
{loading ? (
|
|
174
|
+
<div className="loading">
|
|
175
|
+
<CircularProgress />
|
|
176
|
+
</div>
|
|
177
|
+
) : (
|
|
178
|
+
<>
|
|
179
|
+
<h1 className="layout-title">Order Details</h1>
|
|
180
|
+
<div className="order-summary-box">
|
|
181
|
+
<div className="summary-block">
|
|
182
|
+
<div className="summary-item">
|
|
183
|
+
<h6 className="sub-title">Order Summary</h6>
|
|
184
|
+
<p>{orderSummery}</p>
|
|
185
|
+
</div>
|
|
186
|
+
<div className="summary-item">
|
|
187
|
+
<div className="return-button-container">
|
|
188
|
+
<button
|
|
189
|
+
type="button"
|
|
190
|
+
className="return-button"
|
|
191
|
+
onClick={() => {
|
|
192
|
+
if (typeof window !== 'undefined') {
|
|
193
|
+
window.location.assign('/orders')
|
|
194
|
+
}
|
|
195
|
+
}}
|
|
196
|
+
>
|
|
197
|
+
Back to Orders
|
|
198
|
+
</button>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
<div className="personal-link">
|
|
203
|
+
<div className="link-item">
|
|
204
|
+
<span>Personal Share Link: </span>
|
|
205
|
+
<a
|
|
206
|
+
href={data?.personal_share_link}
|
|
207
|
+
target="_blank"
|
|
208
|
+
rel="noreferrer"
|
|
209
|
+
>
|
|
210
|
+
{Boolean(personalLinkIcon) && (
|
|
211
|
+
<img src={personalLinkIcon} alt="Icon" />
|
|
212
|
+
)}
|
|
213
|
+
{data?.personal_share_link}
|
|
214
|
+
</a>
|
|
215
|
+
</div>
|
|
216
|
+
<div className="link-item">
|
|
217
|
+
<p>{`So far, you’ve referred ${data.sales_referred} tickets`}</p>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
<TableContainer component={Paper}>
|
|
221
|
+
<Table className="tt-type" aria-label="collapsible table">
|
|
222
|
+
<TableHead>
|
|
223
|
+
<TableRow>
|
|
224
|
+
{_map(columns, item => (
|
|
225
|
+
<TableCell>{item.label || ''}</TableCell>
|
|
226
|
+
))}
|
|
227
|
+
</TableRow>
|
|
228
|
+
</TableHead>
|
|
229
|
+
<TableBody>
|
|
230
|
+
{data?.items?.ticket_types?.map(
|
|
231
|
+
(ticket: TicketTypes, index: number) => (
|
|
232
|
+
<TableRow key={index}>
|
|
233
|
+
<TableCell>
|
|
234
|
+
<b>Ticket Type: </b>
|
|
235
|
+
{ticket.name}
|
|
236
|
+
</TableCell>
|
|
237
|
+
<TableCell>{ticket.currency + ticket.price}</TableCell>
|
|
238
|
+
<TableCell>{ticket.quantity}</TableCell>
|
|
239
|
+
<TableCell>{ticket.currency + ticket.total}</TableCell>
|
|
240
|
+
</TableRow>
|
|
241
|
+
)
|
|
242
|
+
)}
|
|
243
|
+
{data?.items?.add_ons?.map(
|
|
244
|
+
(ticket: TicketTypes, index: number) => (
|
|
245
|
+
<TableRow key={index}>
|
|
246
|
+
<TableCell>
|
|
247
|
+
<b>Add-On: </b>
|
|
248
|
+
{ticket.name}
|
|
249
|
+
</TableCell>
|
|
250
|
+
<TableCell>{ticket.currency + ticket.price}</TableCell>
|
|
251
|
+
<TableCell>{ticket.quantity}</TableCell>
|
|
252
|
+
<TableCell>{ticket.currency + ticket.total}</TableCell>
|
|
253
|
+
</TableRow>
|
|
254
|
+
)
|
|
255
|
+
)}
|
|
256
|
+
<TableRow className="total-row">
|
|
257
|
+
<TableCell />
|
|
258
|
+
<TableCell />
|
|
259
|
+
<TableCell>Total</TableCell>
|
|
260
|
+
<TableCell>{getTotal(data)}</TableCell>
|
|
261
|
+
</TableRow>
|
|
262
|
+
</TableBody>
|
|
263
|
+
</Table>
|
|
264
|
+
</TableContainer>
|
|
265
|
+
</div>
|
|
266
|
+
<TicketsTable
|
|
267
|
+
tickets={data.tickets}
|
|
268
|
+
handleSellTicket={handleSellTicket}
|
|
269
|
+
handleRemoveFromResale={handleRemoveFromResale}
|
|
270
|
+
/>
|
|
271
|
+
</>
|
|
272
|
+
)}
|
|
273
|
+
{showResaleModal && (
|
|
274
|
+
<TicketResaleModal
|
|
275
|
+
ticket={activeTicket}
|
|
276
|
+
onClose={handleOnClose}
|
|
277
|
+
onSubmit={handleOnSubmit}
|
|
278
|
+
/>
|
|
279
|
+
)}
|
|
280
|
+
{showRemoveResaleModal && (
|
|
281
|
+
<ConfirmModal
|
|
282
|
+
message="Are you sure you want to withdraw your ticket from resale?"
|
|
283
|
+
onClose={onCloseRemoveResale}
|
|
284
|
+
onConfirm={onConfirmRemoveResale}
|
|
285
|
+
/>
|
|
286
|
+
)}
|
|
287
|
+
</div>
|
|
288
|
+
)
|
|
289
|
+
}
|