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.
Files changed (137) hide show
  1. package/README.md +401 -59
  2. package/dist/adapters/customFields.d.ts +1 -0
  3. package/dist/api/checkout.d.ts +2 -0
  4. package/dist/api/common.d.ts +1 -0
  5. package/dist/api/index.d.ts +2 -0
  6. package/dist/api/preRegistrationComplete.d.ts +1 -1
  7. package/dist/components/addonsContainer/AddonComponent.d.ts +6 -1
  8. package/dist/components/addonsContainer/SimpleAddonsContainer.d.ts +17 -0
  9. package/dist/components/addonsContainer/index.d.ts +6 -1
  10. package/dist/components/billing-info-container/hooks/index.d.ts +3 -0
  11. package/dist/components/billing-info-container/hooks/usePaymentContext.d.ts +5 -0
  12. package/dist/components/billing-info-container/hooks/usePaymentRedirect.d.ts +14 -0
  13. package/dist/components/billing-info-container/hooks/useStripePayment.d.ts +18 -0
  14. package/dist/components/billing-info-container/index.d.ts +13 -2
  15. package/dist/components/billing-info-container/utils.d.ts +26 -1
  16. package/dist/components/common/DatePickerField.d.ts +7 -1
  17. package/dist/components/common/PhoneNumberField.d.ts +1 -1
  18. package/dist/components/confirmationContainer/index.d.ts +4 -1
  19. package/dist/components/countdown/index.d.ts +1 -1
  20. package/dist/components/forgotPasswordModal/index.d.ts +2 -1
  21. package/dist/components/myTicketsContainer/index.d.ts +3 -2
  22. package/dist/components/orderDetailsContainer/index.d.ts +8 -1
  23. package/dist/components/paymentContainer/OrderDetails.d.ts +9 -0
  24. package/dist/components/paymentContainer/handlePayment.d.ts +15 -0
  25. package/dist/components/paymentContainer/index.d.ts +12 -6
  26. package/dist/components/preRegistration/FieldsSection.d.ts +7 -1
  27. package/dist/components/preRegistration/PreRegistrationComplete.d.ts +8 -0
  28. package/dist/components/preRegistration/constants.d.ts +2 -2
  29. package/dist/components/preRegistration/index.d.ts +6 -0
  30. package/dist/components/resetPasswordContainer/index.d.ts +2 -2
  31. package/dist/components/ticketsContainer/InfoIcon.d.ts +5 -0
  32. package/dist/components/ticketsContainer/TicketsSection.d.ts +3 -2
  33. package/dist/components/ticketsContainer/TimeSlotsSection.d.ts +25 -0
  34. package/dist/components/ticketsContainer/index.d.ts +29 -5
  35. package/dist/components/timerWidget/index.d.ts +2 -1
  36. package/dist/constants/index.d.ts +5 -0
  37. package/dist/index.d.ts +4 -1
  38. package/dist/tf-checkout-react.cjs.development.js +11284 -9565
  39. package/dist/tf-checkout-react.cjs.development.js.map +1 -1
  40. package/dist/tf-checkout-react.cjs.production.min.js +1 -1
  41. package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
  42. package/dist/tf-checkout-react.esm.js +11293 -9577
  43. package/dist/tf-checkout-react.esm.js.map +1 -1
  44. package/dist/tf-checkout-styles.css +1 -1
  45. package/dist/types/add_on.d.ts +1 -0
  46. package/dist/types/checkoutPageConfigs.d.ts +1 -1
  47. package/dist/types/order-data.d.ts +3 -1
  48. package/dist/utils/auth.d.ts +8 -0
  49. package/dist/utils/createCheckoutDataBodyWithDefaultHolder.d.ts +1 -0
  50. package/dist/utils/customFields.d.ts +11 -0
  51. package/dist/utils/getDomain.d.ts +1 -1
  52. package/dist/utils/index.d.ts +1 -1
  53. package/dist/utils/setConfigs.d.ts +1 -0
  54. package/package.json +14 -8
  55. package/src/adapters/customFields.ts +7 -1
  56. package/src/api/auth.ts +2 -1
  57. package/src/api/checkout.ts +9 -4
  58. package/src/api/common.ts +49 -2
  59. package/src/api/index.ts +1 -0
  60. package/src/api/interceptors.ts +7 -23
  61. package/src/api/preRegistrationComplete.ts +1 -1
  62. package/src/api/publicRequest.ts +10 -0
  63. package/src/components/addonsContainer/AddonComponent.tsx +96 -11
  64. package/src/components/addonsContainer/SimpleAddonsContainer.tsx +420 -0
  65. package/src/components/addonsContainer/index.tsx +198 -47
  66. package/src/components/billing-info-container/hooks/index.ts +3 -0
  67. package/src/components/billing-info-container/hooks/usePaymentContext.ts +22 -0
  68. package/src/components/billing-info-container/hooks/usePaymentRedirect.ts +147 -0
  69. package/src/components/billing-info-container/hooks/useStripePayment.ts +121 -0
  70. package/src/components/billing-info-container/index.tsx +859 -418
  71. package/src/components/billing-info-container/{utils.ts → utils.tsx} +124 -1
  72. package/src/components/common/CheckboxField/index.tsx +1 -1
  73. package/src/components/common/CustomField.tsx +39 -3
  74. package/src/components/common/DatePickerField.tsx +25 -10
  75. package/src/components/common/PhoneNumberField.tsx +4 -2
  76. package/src/components/common/SnackbarAlert.tsx +32 -34
  77. package/src/components/confirmationContainer/config.ts +3 -3
  78. package/src/components/confirmationContainer/index.tsx +20 -1
  79. package/src/components/confirmationContainer/social-buttons.tsx +5 -3
  80. package/src/components/confirmationContainer/style.css +9 -5
  81. package/src/components/countdown/index.tsx +22 -22
  82. package/src/components/delegationsContainer/IssueComponent.tsx +2 -1
  83. package/src/components/forgotPasswordModal/index.tsx +44 -13
  84. package/src/components/loginForm/index.tsx +1 -1
  85. package/src/components/loginModal/index.tsx +19 -27
  86. package/src/components/loginModal/style.css +3 -1
  87. package/src/components/myTicketsContainer/index.tsx +13 -9
  88. package/src/components/orderDetailsContainer/index.tsx +206 -174
  89. package/src/components/paymentContainer/OrderDetails.tsx +257 -0
  90. package/src/components/paymentContainer/handlePayment.ts +86 -0
  91. package/src/components/paymentContainer/index.tsx +299 -259
  92. package/src/components/paymentContainer/style.css +141 -0
  93. package/src/components/preRegistration/FieldsSection.tsx +8 -0
  94. package/src/components/preRegistration/PreRegistrationComplete.tsx +138 -118
  95. package/src/components/preRegistration/PreRegistrationInformations.tsx +21 -15
  96. package/src/components/preRegistration/constants.tsx +10 -4
  97. package/src/components/preRegistration/index.tsx +233 -179
  98. package/src/components/preRegistration/style.css +3 -0
  99. package/src/components/registerForm/constants.tsx +3 -1
  100. package/src/components/registerForm/index.tsx +3 -3
  101. package/src/components/registerModal/index.tsx +47 -72
  102. package/src/components/resetPasswordContainer/index.tsx +20 -14
  103. package/src/components/seatMapContainer/TicketsSection.tsx +2 -2
  104. package/src/components/signupModal/index.tsx +13 -6
  105. package/src/components/ticketResale/index.tsx +7 -0
  106. package/src/components/ticketsContainer/InfoIcon.tsx +35 -0
  107. package/src/components/ticketsContainer/PromoCodeSection.tsx +34 -28
  108. package/src/components/ticketsContainer/TicketRow.tsx +1 -1
  109. package/src/components/ticketsContainer/TicketsSection.tsx +189 -57
  110. package/src/components/ticketsContainer/TimeSlotsSection.tsx +120 -0
  111. package/src/components/ticketsContainer/index.tsx +268 -106
  112. package/src/components/timerWidget/index.tsx +15 -3
  113. package/src/components/timerWidget/style.css +2 -1
  114. package/src/constants/index.ts +2 -0
  115. package/src/env.ts +14 -6
  116. package/src/hoc/CustomFields/index.tsx +9 -1
  117. package/src/index.ts +7 -2
  118. package/src/types/add_on.ts +1 -0
  119. package/src/types/api/cart.d.ts +8 -0
  120. package/src/types/api/checkout.d.ts +58 -7
  121. package/src/types/api/common.d.ts +30 -0
  122. package/src/types/api/orders.d.ts +19 -3
  123. package/src/types/api/payment.d.ts +6 -2
  124. package/src/types/api/preRegistrationComplete.d.ts +2 -2
  125. package/src/types/checkoutPageConfigs.ts +1 -1
  126. package/src/types/order-data.ts +3 -1
  127. package/src/types/pre-registration-complete.d.ts +6 -1
  128. package/src/utils/auth.ts +32 -0
  129. package/src/utils/cookies.ts +42 -11
  130. package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +3 -1
  131. package/src/utils/customFields.ts +22 -0
  132. package/src/utils/getDomain.ts +10 -4
  133. package/src/utils/index.ts +1 -1
  134. package/src/utils/setConfigs.ts +3 -1
  135. package/dist/components/stripePayment/index.d.ts +0 -24
  136. package/src/components/stripePayment/index.tsx +0 -281
  137. 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
- getPreRegistrationInfluancers,
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
- const localStorageHash = isWindowDefined
39
- ? localStorage.getItem('pre-registration-hash')
40
- : ''
41
- const queryHash = getQueryVariable('hash') || ''
42
- queryHash &&
43
- isWindowDefined &&
44
- window.localStorage.setItem('pre-registration-hash', queryHash)
45
- const hash = queryHash || localStorageHash
46
- const [isLoggedIn, setIsLoggedIn] = useState(Boolean(getCookieByName(X_TF_ECOMMERCE)))
47
- const [showModalLogin, setShowModalLogin] = useState(!isLoggedIn)
48
- const [showCopyModal, setShowCopyModal] = useState(false)
49
- const [prizes, setPrizes] = useState([] as Array<IPrizeData>)
50
- const [shareOptions, setShareOptions] = useState({} as IShareOptionsData)
51
- const [shareActionData, setShareActionData] = useState(
52
- {} as ISubmitShareActionAttributes
53
- )
54
- const [error, setError] = useState({} as AxiosError)
55
- useCookieListener(X_TF_ECOMMERCE, value => setIsLoggedIn(Boolean(value)))
56
- useEffect(() => {
57
- const fetchConfirmationData = async () => {
58
- try {
59
- if (hash && isLoggedIn) {
60
- const shareOptionsData = await getPreRegistrationShareOptions({
61
- hash,
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
- } catch (error) {
79
- if (axios.isAxiosError(error)) {
80
- setError(error.response?.data)
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
- fetchConfirmationData()
85
- }, [
86
- pEventId,
87
- hash,
88
- onGetConfirmationDataError,
89
- onGetConfirmationDataSuccess,
90
- isLoggedIn,
91
- ])
103
+ fetchConfirmationData()
104
+ }, [
105
+ pEventId,
106
+ hash,
107
+ onGetConfirmationDataError,
108
+ onGetConfirmationDataSuccess,
109
+ isLoggedIn,
110
+ skipInitialValidation,
111
+ ])
92
112
 
93
- const onClose = () => {
94
- setShowCopyModal(false)
95
- }
113
+ const onClose = () => {
114
+ setShowCopyModal(false)
115
+ }
96
116
 
97
- const updateShareActionData = async () => {
98
- if (hash) {
99
- const shareOptionsData = await getPreRegistrationShareOptions({
100
- hash,
101
- })
102
- setShareOptions(shareOptionsData.data)
103
- setShareActionData({
104
- shareActionToken: shareOptionsData.data.attributes.shareActionToken,
105
- tokenShuffleMethod: shareOptionsData.data.attributes.tokenShuffleMethod,
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
- return (
110
- <>
111
- {isLoggedIn && _isEmpaty(error) ? (
112
- <div className={`${classNamePrefix}_pre_registration_complete_container`}>
113
- <CopyMessageModal showCopyModal={showCopyModal} onClose={onClose} />
114
- <p className={`${classNamePrefix}_pre_registration_complete_header`}>
115
- {pageHeader}
116
- </p>
117
- <div className={`${classNamePrefix}_pre_registration_complete_message`}>
118
- {pageMessage}
119
- </div>
120
- <div className={`${classNamePrefix}_pre_registration_complete_body`}>
121
- {!_isEmpaty(prizes) && (
122
- <Prewards classNamePrefix={classNamePrefix} data={prizes} />
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
- {!_isEmpaty(shareOptions) && (
126
- <ShareOptions
127
- classNamePrefix={classNamePrefix}
128
- data={shareOptions}
129
- onLinkCopied={() => {
130
- setShowCopyModal(true)
131
- onLinkCopied()
132
- }}
133
- shareActionData={shareActionData}
134
- updateShareActionData={updateShareActionData}
135
- hasCopyIcon={hasCopyIcon}
136
- hash={hash}
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
- </div>
141
- ) : (
142
- showModalLogin && (
143
- <LoginModal
144
- logo={logo}
145
- onClose={() => {
146
- setShowModalLogin(false)
147
- }}
148
- onLogin={res => {
149
- setShowModalLogin(false)
150
- onLoginSuccess(res)
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
- {!_isEmpaty(error) && (
156
- <ConfirmModal
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 { getPreRegistrationInfluancers } from '../../api/preRegistrationComplete'
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<IInfluancerData>)
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 getPreRegistrationInfluancers({
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
- <div className={`${classNamePrefix}_pre_registration_info_container`}>
42
- <Prewards
43
- headerNode={prewardsHeaderNode}
44
- data={prizes}
45
- classNamePrefix={classNamePrefix}
46
- />
47
- <Influancers
48
- headerNode={influancersHeaderNode}
49
- data={topInfluancers}
50
- classNamePrefix={classNamePrefix}
51
- />
52
- </div>
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 formFieldsNotLoggedIn: IFormFieldsSection[] = [
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 formFieldsLoggedIn: IFormFieldsSection[] = [
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: 'I would like to be updated on Mana Common news, events and offers.',
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
  ],