tf-checkout-react 1.6.6 → 1.7.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 +401 -59
- package/dist/adapters/customFields.d.ts +1 -0
- package/dist/api/checkout.d.ts +2 -0
- package/dist/api/common.d.ts +1 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/api/preRegistrationComplete.d.ts +1 -1
- package/dist/components/addonsContainer/AddonComponent.d.ts +6 -1
- package/dist/components/addonsContainer/SimpleAddonsContainer.d.ts +17 -0
- package/dist/components/addonsContainer/index.d.ts +6 -1
- package/dist/components/billing-info-container/hooks/index.d.ts +3 -0
- package/dist/components/billing-info-container/hooks/usePaymentContext.d.ts +5 -0
- package/dist/components/billing-info-container/hooks/usePaymentRedirect.d.ts +14 -0
- package/dist/components/billing-info-container/hooks/useStripePayment.d.ts +18 -0
- package/dist/components/billing-info-container/index.d.ts +13 -2
- package/dist/components/billing-info-container/utils.d.ts +26 -1
- package/dist/components/common/DatePickerField.d.ts +7 -1
- package/dist/components/common/PhoneNumberField.d.ts +1 -1
- package/dist/components/confirmationContainer/index.d.ts +4 -1
- package/dist/components/countdown/index.d.ts +1 -1
- package/dist/components/forgotPasswordModal/index.d.ts +2 -1
- package/dist/components/myTicketsContainer/index.d.ts +3 -2
- package/dist/components/orderDetailsContainer/index.d.ts +8 -1
- package/dist/components/paymentContainer/OrderDetails.d.ts +9 -0
- package/dist/components/paymentContainer/handlePayment.d.ts +15 -0
- package/dist/components/paymentContainer/index.d.ts +12 -6
- package/dist/components/preRegistration/FieldsSection.d.ts +7 -1
- package/dist/components/preRegistration/PreRegistrationComplete.d.ts +8 -0
- package/dist/components/preRegistration/constants.d.ts +2 -2
- package/dist/components/preRegistration/index.d.ts +6 -0
- package/dist/components/resetPasswordContainer/index.d.ts +2 -2
- package/dist/components/ticketsContainer/InfoIcon.d.ts +5 -0
- package/dist/components/ticketsContainer/TicketsSection.d.ts +3 -2
- package/dist/components/ticketsContainer/TimeSlotsSection.d.ts +25 -0
- package/dist/components/ticketsContainer/index.d.ts +29 -5
- package/dist/components/timerWidget/index.d.ts +2 -1
- package/dist/constants/index.d.ts +5 -0
- package/dist/index.d.ts +4 -1
- package/dist/tf-checkout-react.cjs.development.js +11284 -9565
- 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 +11293 -9577
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/dist/types/add_on.d.ts +1 -0
- package/dist/types/checkoutPageConfigs.d.ts +1 -1
- package/dist/types/order-data.d.ts +3 -1
- package/dist/utils/auth.d.ts +8 -0
- package/dist/utils/createCheckoutDataBodyWithDefaultHolder.d.ts +1 -0
- package/dist/utils/customFields.d.ts +11 -0
- package/dist/utils/getDomain.d.ts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/setConfigs.d.ts +1 -0
- package/package.json +14 -8
- package/src/adapters/customFields.ts +7 -1
- package/src/api/auth.ts +2 -1
- package/src/api/checkout.ts +9 -4
- package/src/api/common.ts +49 -2
- package/src/api/index.ts +1 -0
- package/src/api/interceptors.ts +7 -23
- package/src/api/preRegistrationComplete.ts +1 -1
- package/src/api/publicRequest.ts +10 -0
- package/src/components/addonsContainer/AddonComponent.tsx +96 -11
- package/src/components/addonsContainer/SimpleAddonsContainer.tsx +420 -0
- package/src/components/addonsContainer/index.tsx +198 -47
- package/src/components/billing-info-container/hooks/index.ts +3 -0
- package/src/components/billing-info-container/hooks/usePaymentContext.ts +22 -0
- package/src/components/billing-info-container/hooks/usePaymentRedirect.ts +147 -0
- package/src/components/billing-info-container/hooks/useStripePayment.ts +121 -0
- package/src/components/billing-info-container/index.tsx +859 -418
- package/src/components/billing-info-container/{utils.ts → utils.tsx} +124 -1
- package/src/components/common/CheckboxField/index.tsx +1 -1
- package/src/components/common/CustomField.tsx +39 -3
- package/src/components/common/DatePickerField.tsx +25 -10
- package/src/components/common/PhoneNumberField.tsx +4 -2
- package/src/components/common/SnackbarAlert.tsx +32 -34
- package/src/components/confirmationContainer/config.ts +3 -3
- package/src/components/confirmationContainer/index.tsx +20 -1
- package/src/components/confirmationContainer/social-buttons.tsx +5 -3
- package/src/components/confirmationContainer/style.css +9 -5
- package/src/components/countdown/index.tsx +22 -22
- package/src/components/delegationsContainer/IssueComponent.tsx +2 -1
- package/src/components/forgotPasswordModal/index.tsx +44 -13
- package/src/components/loginForm/index.tsx +1 -1
- package/src/components/loginModal/index.tsx +19 -27
- package/src/components/loginModal/style.css +3 -1
- package/src/components/myTicketsContainer/index.tsx +13 -9
- package/src/components/orderDetailsContainer/index.tsx +206 -174
- package/src/components/paymentContainer/OrderDetails.tsx +257 -0
- package/src/components/paymentContainer/handlePayment.ts +86 -0
- package/src/components/paymentContainer/index.tsx +299 -259
- package/src/components/paymentContainer/style.css +141 -0
- package/src/components/preRegistration/FieldsSection.tsx +8 -0
- package/src/components/preRegistration/PreRegistrationComplete.tsx +138 -118
- package/src/components/preRegistration/PreRegistrationInformations.tsx +21 -15
- package/src/components/preRegistration/constants.tsx +10 -4
- package/src/components/preRegistration/index.tsx +233 -179
- package/src/components/preRegistration/style.css +3 -0
- package/src/components/registerForm/constants.tsx +3 -1
- package/src/components/registerForm/index.tsx +3 -3
- package/src/components/registerModal/index.tsx +47 -72
- package/src/components/resetPasswordContainer/index.tsx +20 -14
- package/src/components/seatMapContainer/TicketsSection.tsx +2 -2
- package/src/components/signupModal/index.tsx +13 -6
- package/src/components/ticketResale/index.tsx +7 -0
- package/src/components/ticketsContainer/InfoIcon.tsx +35 -0
- package/src/components/ticketsContainer/PromoCodeSection.tsx +34 -28
- package/src/components/ticketsContainer/TicketRow.tsx +1 -1
- package/src/components/ticketsContainer/TicketsSection.tsx +189 -57
- package/src/components/ticketsContainer/TimeSlotsSection.tsx +120 -0
- package/src/components/ticketsContainer/index.tsx +268 -106
- package/src/components/timerWidget/index.tsx +15 -3
- package/src/components/timerWidget/style.css +2 -1
- package/src/constants/index.ts +2 -0
- package/src/env.ts +14 -6
- package/src/hoc/CustomFields/index.tsx +9 -1
- package/src/index.ts +7 -2
- package/src/types/add_on.ts +1 -0
- package/src/types/api/cart.d.ts +8 -0
- package/src/types/api/checkout.d.ts +58 -7
- package/src/types/api/common.d.ts +30 -0
- package/src/types/api/orders.d.ts +19 -3
- package/src/types/api/payment.d.ts +6 -2
- package/src/types/api/preRegistrationComplete.d.ts +2 -2
- package/src/types/checkoutPageConfigs.ts +1 -1
- package/src/types/order-data.ts +3 -1
- package/src/types/pre-registration-complete.d.ts +6 -1
- package/src/utils/auth.ts +32 -0
- package/src/utils/cookies.ts +42 -11
- package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +3 -1
- package/src/utils/customFields.ts +22 -0
- package/src/utils/getDomain.ts +10 -4
- package/src/utils/index.ts +1 -1
- package/src/utils/setConfigs.ts +3 -1
- package/dist/components/stripePayment/index.d.ts +0 -24
- package/src/components/stripePayment/index.tsx +0 -281
- package/src/components/stripePayment/style.css +0 -60
|
@@ -46,10 +46,151 @@
|
|
|
46
46
|
text-align: center;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
.payment_page .payment_method_selector {
|
|
50
|
+
display: flex;
|
|
51
|
+
gap: 12px;
|
|
52
|
+
margin-bottom: 20px;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.payment_page .payment_method_option {
|
|
57
|
+
padding: 12px 24px;
|
|
58
|
+
border: 2px solid #e0e0e0;
|
|
59
|
+
border-radius: 8px;
|
|
60
|
+
background: #fff;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
font-size: 14px;
|
|
63
|
+
font-weight: 500;
|
|
64
|
+
transition: all 0.2s ease;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.payment_page .payment_method_option:hover {
|
|
68
|
+
border-color: #999;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.payment_page .payment_method_option.selected {
|
|
72
|
+
border-color: #1976d2;
|
|
73
|
+
background-color: #e3f2fd;
|
|
74
|
+
color: #1976d2;
|
|
75
|
+
}
|
|
76
|
+
|
|
49
77
|
.payment_page .payment_plan .payment_plan_block .payment_plan_text {
|
|
50
78
|
padding-bottom: 10px;
|
|
51
79
|
}
|
|
52
80
|
|
|
53
81
|
.payment_page .payment_plan .payment_plan_highlight {
|
|
54
82
|
font-weight: bold;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
/* Default styles - mobile section is hidden on desktop */
|
|
87
|
+
.mobile-order-summary {
|
|
88
|
+
display: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Mobile-specific styles */
|
|
92
|
+
@media (max-width: 767px) {
|
|
93
|
+
/* Show mobile summary on mobile devices */
|
|
94
|
+
.mobile-order-summary {
|
|
95
|
+
display: block;
|
|
96
|
+
margin-bottom: 15px;
|
|
97
|
+
background-color: #f8f8f8;
|
|
98
|
+
border-radius: 8px;
|
|
99
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.mobile-order-summary-content {
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: flex-start;
|
|
105
|
+
padding: 15px;
|
|
106
|
+
cursor: pointer;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.mobile-order-info-container:after {
|
|
110
|
+
display: inline-block;
|
|
111
|
+
content: "⌃";
|
|
112
|
+
font-weight: 900;
|
|
113
|
+
font-size: 15px;
|
|
114
|
+
top: -2px;
|
|
115
|
+
left: 6px;
|
|
116
|
+
float: right;
|
|
117
|
+
position: relative;
|
|
118
|
+
transform: rotate(180deg);
|
|
119
|
+
transition: transform 0.25s, top 0.25s;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.mobile-order-info-container.open:after {
|
|
123
|
+
top: 2px;
|
|
124
|
+
transform: rotate(0deg);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.mobile-order-info-container.order-info-container-left {
|
|
128
|
+
text-align: left;
|
|
129
|
+
}
|
|
130
|
+
.mobile-order-info-container.order-info-container-right {
|
|
131
|
+
text-align: right;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
.mobile-order-icon {
|
|
136
|
+
margin-right: 15px;
|
|
137
|
+
color: #1976d2;
|
|
138
|
+
padding-top: 2px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.mobile-order-info {
|
|
142
|
+
flex: 1;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.mobile-order-text {
|
|
146
|
+
font-size: 14px;
|
|
147
|
+
color: #666;
|
|
148
|
+
margin-bottom: 4px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.mobile-order-total {
|
|
152
|
+
font-size: 18px;
|
|
153
|
+
font-weight: bold;
|
|
154
|
+
color: #333;
|
|
155
|
+
margin-bottom: 8px;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.mobile-order-timer {
|
|
159
|
+
display: flex;
|
|
160
|
+
align-items: center;
|
|
161
|
+
margin-top: 8px;
|
|
162
|
+
padding-top: 8px;
|
|
163
|
+
border-top: 1px dashed #ddd;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.mobile-timer-icon {
|
|
167
|
+
margin-right: 8px;
|
|
168
|
+
color: #f44336;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.mobile-timer-text {
|
|
172
|
+
font-size: 13px;
|
|
173
|
+
color: #666;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.mobile-timer-countdown {
|
|
177
|
+
font-weight: bold;
|
|
178
|
+
color: #f44336;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.mobile-order-expand {
|
|
182
|
+
color: #666;
|
|
183
|
+
padding-top: 2px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Hide the original content when collapsed on mobile */
|
|
187
|
+
.order_info_section.collapsed {
|
|
188
|
+
display: none !important;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* Show the original content when expanded on mobile */
|
|
192
|
+
.order_info_section.expanded {
|
|
193
|
+
display: grid !important;
|
|
194
|
+
margin-top: 10px;
|
|
195
|
+
}
|
|
55
196
|
}
|
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
} from '../common'
|
|
12
12
|
import { DatePickerField } from '../common/DatePickerField'
|
|
13
13
|
import { getValidateFunctions } from './utils'
|
|
14
|
+
import {ThemeOptions} from "@mui/material";
|
|
15
|
+
import {CSSProperties} from "@mui/styles";
|
|
14
16
|
|
|
15
17
|
const isDocumentDefined = typeof document !== 'undefined'
|
|
16
18
|
|
|
@@ -25,6 +27,10 @@ export interface IFieldsSectionProps {
|
|
|
25
27
|
|
|
26
28
|
countries?: { [key: string]: string | number }[];
|
|
27
29
|
theme?: 'dark' | 'light';
|
|
30
|
+
themeOptions?: ThemeOptions & {
|
|
31
|
+
input?: CSSProperties;
|
|
32
|
+
checkbox?: CSSProperties;
|
|
33
|
+
};
|
|
28
34
|
containerClass?: string;
|
|
29
35
|
}
|
|
30
36
|
|
|
@@ -66,6 +72,7 @@ export const FieldsSection = ({
|
|
|
66
72
|
setFieldValue,
|
|
67
73
|
theme,
|
|
68
74
|
containerClass = '',
|
|
75
|
+
themeOptions,
|
|
69
76
|
}: IFieldsSectionProps) => (
|
|
70
77
|
<>
|
|
71
78
|
{_map(formFields, (item, index) => {
|
|
@@ -129,6 +136,7 @@ export const FieldsSection = ({
|
|
|
129
136
|
}
|
|
130
137
|
selectOptions={name === 'country' ? countries : options}
|
|
131
138
|
theme={theme}
|
|
139
|
+
themeOptions={themeOptions}
|
|
132
140
|
/>
|
|
133
141
|
</div>
|
|
134
142
|
)
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import { ThemeOptions } from '@mui/material'
|
|
2
|
+
import { createTheme, ThemeProvider } from '@mui/material/styles'
|
|
3
|
+
import { CSSProperties } from '@mui/styles'
|
|
1
4
|
import axios, { AxiosError } from 'axios'
|
|
2
5
|
import _get from 'lodash/get'
|
|
3
6
|
import _identity from 'lodash/identity'
|
|
4
7
|
import _isEmpaty from 'lodash/isEmpty'
|
|
5
8
|
import React, { FC, useEffect, useState } from 'react'
|
|
9
|
+
import "./style.css"
|
|
6
10
|
|
|
7
11
|
import {
|
|
8
|
-
|
|
12
|
+
getPreRegistrationInfluencers,
|
|
9
13
|
getPreRegistrationShareOptions,
|
|
10
14
|
} from '../../api/preRegistrationComplete'
|
|
11
15
|
import { X_TF_ECOMMERCE } from '../../constants'
|
|
@@ -22,6 +26,11 @@ const isWindowDefined = typeof window !== 'undefined'
|
|
|
22
26
|
export const PreRegistrationComplete: FC<
|
|
23
27
|
IPreRegistrationCompleteProps & {
|
|
24
28
|
onGetConfirmationDataError?: (error: AxiosError) => void;
|
|
29
|
+
skipInitialValidation?: boolean;
|
|
30
|
+
themeOptions?: ThemeOptions & {
|
|
31
|
+
input?: CSSProperties;
|
|
32
|
+
checkbox?: CSSProperties;
|
|
33
|
+
};
|
|
25
34
|
}
|
|
26
35
|
> = ({
|
|
27
36
|
eventId: pEventId,
|
|
@@ -34,131 +43,142 @@ export const PreRegistrationComplete: FC<
|
|
|
34
43
|
pageMessage = 'Pre registration was successful!',
|
|
35
44
|
onLoginSuccess = _identity,
|
|
36
45
|
logo,
|
|
46
|
+
themeOptions,
|
|
47
|
+
skipInitialValidation = false,
|
|
37
48
|
}) => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
{} as
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
})
|
|
63
|
-
const { attributes } = shareOptionsData.data
|
|
64
|
-
setShareOptions(shareOptionsData.data)
|
|
65
|
-
setShareActionData({
|
|
66
|
-
shareActionToken: attributes.shareActionToken,
|
|
67
|
-
tokenShuffleMethod: attributes.tokenShuffleMethod,
|
|
68
|
-
})
|
|
69
|
-
const eventId = _get(shareOptionsData, 'data.attributes.eventId')
|
|
70
|
-
if (eventId || pEventId) {
|
|
71
|
-
const influencersData = await getPreRegistrationInfluancers({
|
|
72
|
-
eventId: eventId || pEventId,
|
|
73
|
-
})
|
|
74
|
-
setPrizes(influencersData.data.attributes.prizes)
|
|
75
|
-
}
|
|
49
|
+
const themeMui = createTheme(themeOptions)
|
|
50
|
+
|
|
51
|
+
const localStorageHash = isWindowDefined
|
|
52
|
+
? localStorage.getItem('pre-registration-hash')
|
|
53
|
+
: ''
|
|
54
|
+
const queryHash = getQueryVariable('hash') || ''
|
|
55
|
+
queryHash &&
|
|
56
|
+
isWindowDefined &&
|
|
57
|
+
window.localStorage.setItem('pre-registration-hash', queryHash)
|
|
58
|
+
const hash = queryHash || localStorageHash
|
|
59
|
+
const [isLoggedIn, setIsLoggedIn] = useState(Boolean(getCookieByName(X_TF_ECOMMERCE)))
|
|
60
|
+
const [showModalLogin, setShowModalLogin] = useState(!isLoggedIn)
|
|
61
|
+
const [showCopyModal, setShowCopyModal] = useState(false)
|
|
62
|
+
const [prizes, setPrizes] = useState([] as Array<IPrizeData>)
|
|
63
|
+
const [shareOptions, setShareOptions] = useState({} as IShareOptionsData)
|
|
64
|
+
const [shareActionData, setShareActionData] = useState(
|
|
65
|
+
{} as ISubmitShareActionAttributes
|
|
66
|
+
)
|
|
67
|
+
const [error, setError] = useState({} as AxiosError)
|
|
68
|
+
useCookieListener(X_TF_ECOMMERCE, value => setIsLoggedIn(Boolean(value)))
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
const fetchConfirmationData = async () => {
|
|
71
|
+
// Skip validation if this is a freshly completed pre-registration
|
|
72
|
+
if (skipInitialValidation) {
|
|
76
73
|
onGetConfirmationDataSuccess()
|
|
74
|
+
return
|
|
77
75
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
|
|
77
|
+
try {
|
|
78
|
+
if (hash && isLoggedIn) {
|
|
79
|
+
const shareOptionsData = await getPreRegistrationShareOptions({
|
|
80
|
+
hash,
|
|
81
|
+
})
|
|
82
|
+
const { attributes } = shareOptionsData.data
|
|
83
|
+
setShareOptions(shareOptionsData.data)
|
|
84
|
+
setShareActionData({
|
|
85
|
+
shareActionToken: attributes.shareActionToken,
|
|
86
|
+
tokenShuffleMethod: attributes.tokenShuffleMethod,
|
|
87
|
+
})
|
|
88
|
+
const eventId = _get(shareOptionsData, 'data.attributes.eventId')
|
|
89
|
+
if (eventId || pEventId) {
|
|
90
|
+
const influencersData = await getPreRegistrationInfluencers({
|
|
91
|
+
eventId: eventId || pEventId,
|
|
92
|
+
})
|
|
93
|
+
setPrizes(influencersData.data.attributes.prizes)
|
|
94
|
+
}
|
|
95
|
+
onGetConfirmationDataSuccess()
|
|
96
|
+
}
|
|
97
|
+
} catch (error) {
|
|
98
|
+
if (axios.isAxiosError(error)) {
|
|
99
|
+
setError(error.response?.data as AxiosError)
|
|
100
|
+
}
|
|
81
101
|
}
|
|
82
102
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
103
|
+
fetchConfirmationData()
|
|
104
|
+
}, [
|
|
105
|
+
pEventId,
|
|
106
|
+
hash,
|
|
107
|
+
onGetConfirmationDataError,
|
|
108
|
+
onGetConfirmationDataSuccess,
|
|
109
|
+
isLoggedIn,
|
|
110
|
+
skipInitialValidation,
|
|
111
|
+
])
|
|
92
112
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
113
|
+
const onClose = () => {
|
|
114
|
+
setShowCopyModal(false)
|
|
115
|
+
}
|
|
96
116
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
117
|
+
const updateShareActionData = async () => {
|
|
118
|
+
if (hash) {
|
|
119
|
+
const shareOptionsData = await getPreRegistrationShareOptions({
|
|
120
|
+
hash,
|
|
121
|
+
})
|
|
122
|
+
setShareOptions(shareOptionsData.data)
|
|
123
|
+
setShareActionData({
|
|
124
|
+
shareActionToken: shareOptionsData.data.attributes.shareActionToken,
|
|
125
|
+
tokenShuffleMethod: shareOptionsData.data.attributes.tokenShuffleMethod,
|
|
126
|
+
})
|
|
127
|
+
}
|
|
107
128
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
)}
|
|
129
|
+
return (
|
|
130
|
+
<ThemeProvider theme={themeMui}>
|
|
131
|
+
{isLoggedIn && _isEmpaty(error) ? (
|
|
132
|
+
<div className={`${classNamePrefix}_pre_registration_complete_container`}>
|
|
133
|
+
<CopyMessageModal showCopyModal={showCopyModal} onClose={onClose} />
|
|
134
|
+
<h2 className={`${classNamePrefix}_pre_registration_complete_header preregistration_confirmation_header`}>
|
|
135
|
+
{pageHeader}
|
|
136
|
+
</h2>
|
|
137
|
+
<div className={`${classNamePrefix}_pre_registration_complete_message`}>
|
|
138
|
+
{pageMessage}
|
|
139
|
+
</div>
|
|
140
|
+
<div className={`${classNamePrefix}_pre_registration_complete_body`}>
|
|
141
|
+
{!_isEmpaty(prizes) && (
|
|
142
|
+
<Prewards classNamePrefix={classNamePrefix} data={prizes} />
|
|
143
|
+
)}
|
|
124
144
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
145
|
+
{!_isEmpaty(shareOptions) && (
|
|
146
|
+
<ShareOptions
|
|
147
|
+
classNamePrefix={classNamePrefix}
|
|
148
|
+
data={shareOptions}
|
|
149
|
+
onLinkCopied={() => {
|
|
150
|
+
setShowCopyModal(true)
|
|
151
|
+
onLinkCopied()
|
|
152
|
+
}}
|
|
153
|
+
shareActionData={shareActionData}
|
|
154
|
+
updateShareActionData={updateShareActionData}
|
|
155
|
+
hasCopyIcon={hasCopyIcon}
|
|
156
|
+
hash={hash}
|
|
157
|
+
/>
|
|
158
|
+
)}
|
|
159
|
+
</div>
|
|
139
160
|
</div>
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
161
|
+
) : (
|
|
162
|
+
showModalLogin && (
|
|
163
|
+
<LoginModal
|
|
164
|
+
logo={logo}
|
|
165
|
+
onClose={() => {
|
|
166
|
+
setShowModalLogin(false)
|
|
167
|
+
}}
|
|
168
|
+
onLogin={res => {
|
|
169
|
+
setShowModalLogin(false)
|
|
170
|
+
onLoginSuccess(res)
|
|
171
|
+
}}
|
|
172
|
+
/>
|
|
173
|
+
)
|
|
174
|
+
)}
|
|
175
|
+
{!_isEmpaty(error) && (
|
|
176
|
+
<ConfirmModal
|
|
177
|
+
hideCancelBtn
|
|
178
|
+
message={error.message}
|
|
179
|
+
onConfirm={() => onGetConfirmationDataError(error)}
|
|
152
180
|
/>
|
|
153
|
-
)
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
hideCancelBtn
|
|
158
|
-
message={error.message}
|
|
159
|
-
onConfirm={() => onGetConfirmationDataError(error)}
|
|
160
|
-
/>
|
|
161
|
-
)}
|
|
162
|
-
</>
|
|
163
|
-
)
|
|
164
|
-
}
|
|
181
|
+
)}
|
|
182
|
+
</ThemeProvider>
|
|
183
|
+
)
|
|
184
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { createTheme, ThemeProvider } from '@mui/material/styles'
|
|
1
2
|
import _identity from 'lodash/identity'
|
|
2
3
|
import _slice from 'lodash/slice'
|
|
3
4
|
import React, { useEffect, useState } from 'react'
|
|
4
5
|
|
|
5
|
-
import {
|
|
6
|
+
import { getPreRegistrationInfluencers } from '../../api/preRegistrationComplete'
|
|
6
7
|
import { Influancers } from './Influancers'
|
|
7
8
|
import { Prewards } from './Prewards'
|
|
8
9
|
|
|
@@ -14,15 +15,18 @@ export const PreRegistrationInformations = (props: IPreRegistrationInformationPr
|
|
|
14
15
|
onGetPreregistrationDataError = _identity,
|
|
15
16
|
influancersHeaderNode,
|
|
16
17
|
prewardsHeaderNode,
|
|
18
|
+
themeOptions,
|
|
17
19
|
} = props
|
|
18
20
|
|
|
21
|
+
const themeMui = createTheme(themeOptions)
|
|
22
|
+
|
|
19
23
|
const [prizes, setPrizes] = useState([] as Array<IPrizeData>)
|
|
20
|
-
const [influencers, setInfluencers] = useState([] as Array<
|
|
24
|
+
const [influencers, setInfluencers] = useState([] as Array<IInfluencerData>)
|
|
21
25
|
const topInfluancers = _slice(influencers, 0, 10)
|
|
22
26
|
useEffect(() => {
|
|
23
27
|
const fetchPreregistrationData = async () => {
|
|
24
28
|
try {
|
|
25
|
-
const preregistrationData = await
|
|
29
|
+
const preregistrationData = await getPreRegistrationInfluencers({
|
|
26
30
|
eventId,
|
|
27
31
|
})
|
|
28
32
|
setPrizes(preregistrationData.data.attributes.prizes)
|
|
@@ -38,17 +42,19 @@ export const PreRegistrationInformations = (props: IPreRegistrationInformationPr
|
|
|
38
42
|
}, [eventId, onGetPreregistrationDataError, onGetPreregistrationDataSuccess])
|
|
39
43
|
|
|
40
44
|
return (
|
|
41
|
-
<
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
<ThemeProvider theme={themeMui}>
|
|
46
|
+
<div className={`${classNamePrefix}_pre_registration_info_container`}>
|
|
47
|
+
<Prewards
|
|
48
|
+
headerNode={prewardsHeaderNode}
|
|
49
|
+
data={prizes}
|
|
50
|
+
classNamePrefix={classNamePrefix}
|
|
51
|
+
/>
|
|
52
|
+
<Influancers
|
|
53
|
+
headerNode={influancersHeaderNode}
|
|
54
|
+
data={topInfluancers}
|
|
55
|
+
classNamePrefix={classNamePrefix}
|
|
56
|
+
/>
|
|
57
|
+
</div>
|
|
58
|
+
</ThemeProvider>
|
|
53
59
|
)
|
|
54
60
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const getFormFieldsNotLoggedIn = (
|
|
4
|
+
clientName?: string | number
|
|
5
|
+
): IFormFieldsSection[] => [
|
|
4
6
|
{
|
|
5
7
|
name: 'basic-info',
|
|
6
8
|
groupLabel: (
|
|
@@ -76,7 +78,7 @@ export const formFieldsNotLoggedIn: IFormFieldsSection[] = [
|
|
|
76
78
|
groupLabel: (
|
|
77
79
|
<div className="email-info-block">
|
|
78
80
|
<span>Choose a password for your new</span>
|
|
79
|
-
<b> Mana Common </b>
|
|
81
|
+
<b> {clientName || 'Mana Common'} </b>
|
|
80
82
|
<span>account</span>
|
|
81
83
|
</div>
|
|
82
84
|
),
|
|
@@ -103,7 +105,9 @@ export const formFieldsNotLoggedIn: IFormFieldsSection[] = [
|
|
|
103
105
|
},
|
|
104
106
|
]
|
|
105
107
|
|
|
106
|
-
export const
|
|
108
|
+
export const getFormFieldsLoggedIn = (
|
|
109
|
+
clientName?: string | number
|
|
110
|
+
): IFormFieldsSection[] => [
|
|
107
111
|
{
|
|
108
112
|
name: 'basic-info-logged-in',
|
|
109
113
|
groupLabel:
|
|
@@ -153,7 +157,9 @@ export const formFieldsLoggedIn: IFormFieldsSection[] = [
|
|
|
153
157
|
},
|
|
154
158
|
{
|
|
155
159
|
name: 'brandOptIn',
|
|
156
|
-
label:
|
|
160
|
+
label: `I would like to be updated on ${
|
|
161
|
+
clientName || 'Mana Common'
|
|
162
|
+
} news, events and offers.`,
|
|
157
163
|
type: 'checkbox',
|
|
158
164
|
},
|
|
159
165
|
],
|