tf-checkout-react 1.4.26 → 1.5.0
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/dist/api/index.d.ts +1 -0
- package/dist/api/preRegistrationComplete.d.ts +3 -0
- package/dist/components/billing-info-container/index.d.ts +1 -3
- package/dist/components/common/CopyField.d.ts +12 -0
- package/dist/components/common/CopyMessageModal.d.ts +7 -0
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/common/socials.d.ts +10 -0
- package/dist/components/confirmationContainer/index.d.ts +7 -7
- package/dist/components/confirmationContainer/social-buttons.d.ts +5 -2
- package/dist/components/forgotPasswordModal/index.d.ts +2 -3
- package/dist/components/loginForm/index.d.ts +1 -0
- package/dist/components/loginModal/index.d.ts +2 -3
- package/dist/components/preRegistration/FieldsSection.d.ts +13 -0
- package/dist/components/preRegistration/Influancers.d.ts +2 -0
- package/dist/components/preRegistration/PreRegistrationComplete.d.ts +5 -0
- package/dist/components/preRegistration/PreRegistrationInformations.d.ts +2 -0
- package/dist/components/preRegistration/Prewards.d.ts +2 -0
- package/dist/components/preRegistration/ShareOptions.d.ts +2 -0
- package/dist/components/preRegistration/constants.d.ts +2 -0
- package/dist/components/preRegistration/index.d.ts +17 -0
- package/dist/components/preRegistration/utils.d.ts +12 -0
- package/dist/components/ticketsContainer/TicketRow.d.ts +3 -2
- package/dist/components/ticketsContainer/utils.d.ts +9 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useEventListener.d.ts +1 -0
- package/dist/hooks/useLocalStorageListener.d.ts +1 -0
- package/dist/images/instagram.svg +5 -0
- package/dist/images/spotify.svg +6 -0
- package/dist/index.d.ts +4 -1
- package/dist/tf-checkout-react.cjs.development.js +1508 -157
- 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 +1509 -157
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/utils/isValidNumber.d.ts +1 -0
- package/package.json +1 -1
- package/src/api/index.ts +28 -0
- package/src/api/preRegistrationComplete.ts +37 -0
- package/src/assets/images/instagram.svg +5 -0
- package/src/assets/images/spotify.svg +6 -0
- package/src/components/billing-info-container/index.tsx +1 -7
- package/src/components/common/CopyField.tsx +53 -0
- package/src/components/common/CopyMessageModal.tsx +34 -0
- package/src/components/common/NativeSelectFeild/index.tsx +1 -1
- package/src/components/common/index.tsx +1 -0
- package/src/components/common/socials.tsx +33 -0
- package/src/components/confirmationContainer/config.ts +62 -55
- package/src/components/confirmationContainer/index.tsx +11 -31
- package/src/components/confirmationContainer/social-buttons.tsx +43 -20
- package/src/components/forgotPasswordModal/index.tsx +4 -4
- package/src/components/loginForm/index.tsx +4 -0
- package/src/components/loginModal/index.tsx +5 -4
- package/src/components/preRegistration/FieldsSection.tsx +142 -0
- package/src/components/preRegistration/Influancers.tsx +34 -0
- package/src/components/preRegistration/PreRegistrationComplete.tsx +164 -0
- package/src/components/preRegistration/PreRegistrationInformations.tsx +54 -0
- package/src/components/preRegistration/Prewards.tsx +41 -0
- package/src/components/preRegistration/ShareOptions.tsx +77 -0
- package/src/components/preRegistration/constants.tsx +161 -0
- package/src/components/preRegistration/index.tsx +274 -0
- package/src/components/preRegistration/utils.ts +155 -0
- package/src/components/ticketsContainer/ReferralLogic.tsx +1 -1
- package/src/components/ticketsContainer/TicketRow.tsx +17 -14
- package/src/components/ticketsContainer/TicketsSection.tsx +2 -0
- package/src/components/ticketsContainer/index.tsx +77 -8
- package/src/components/ticketsContainer/utils.ts +30 -6
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useEventListener.ts +32 -0
- package/src/hooks/useLocalStorageListener.ts +27 -0
- package/src/index.ts +6 -2
- package/src/types/api/preRegistration.d.ts +11 -0
- package/src/types/api/preRegistrationComplete.d.ts +95 -0
- package/src/types/pre-registration-complete.d.ts +42 -0
- package/src/utils/cookies.ts +7 -7
- package/src/utils/isValidNumber.ts +8 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isValidNumber: (value?: string | number | undefined) => boolean;
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -164,6 +164,34 @@ export const getCheckoutPageConfigs = async (): Promise<ResponseConfigs> => {
|
|
|
164
164
|
return response.data
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
+
export const confirmPreRegistration = async (
|
|
168
|
+
eventId: string | number,
|
|
169
|
+
data: IConfirmPreRegistrationRequestData
|
|
170
|
+
) => {
|
|
171
|
+
const response = await publicRequest.post(
|
|
172
|
+
`v1/event/${eventId}/pre-registration/confirm`,
|
|
173
|
+
{
|
|
174
|
+
data: {
|
|
175
|
+
attributes: data,
|
|
176
|
+
},
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
return response.data
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// seat map <--start-->
|
|
183
|
+
|
|
184
|
+
// const makeId = (length = 20) => {
|
|
185
|
+
// let result = ''
|
|
186
|
+
// const characters =
|
|
187
|
+
// 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
|
|
188
|
+
// const charactersLength = characters.length
|
|
189
|
+
// for (let i = 0; i < length; i++) {
|
|
190
|
+
// result += characters.charAt(Math.floor(Math.random() * charactersLength))
|
|
191
|
+
// }
|
|
192
|
+
// return result
|
|
193
|
+
// }
|
|
194
|
+
|
|
167
195
|
export const getSeatMapData = async (
|
|
168
196
|
eventId: string | number
|
|
169
197
|
): Promise<SeatMapDataResponse> => {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AxiosRequestConfig, AxiosResponse } from 'axios'
|
|
2
|
+
|
|
3
|
+
import { publicRequest } from '../api/publicRequest'
|
|
4
|
+
|
|
5
|
+
export const getPreRegistrationInfluancers = async (
|
|
6
|
+
data: IInfluancersRequestData
|
|
7
|
+
): Promise<IInfluancersResponseData> => {
|
|
8
|
+
const response: AxiosResponse<IInfluancersResponseData, AxiosRequestConfig> =
|
|
9
|
+
await publicRequest.get(`v1/event/${data.eventId}/pre-registration/influencers`)
|
|
10
|
+
return response.data
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const getPreRegistrationShareOptions = async (
|
|
14
|
+
data: IShareOptionsRequestData
|
|
15
|
+
): Promise<IShareOptionsResponseData> => {
|
|
16
|
+
const response: AxiosResponse<IShareOptionsResponseData, AxiosRequestConfig> =
|
|
17
|
+
await publicRequest.get(`/v1/pre-registration/${data.hash}/confirmation-page`)
|
|
18
|
+
return response.data
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const submitShareAction = async (
|
|
22
|
+
data: ISubmitShareActionRequestData
|
|
23
|
+
): Promise<ISubmitShareActionResponseData> => {
|
|
24
|
+
const { eventActionId, accessToken, hash } = data
|
|
25
|
+
|
|
26
|
+
const response: AxiosResponse<ISubmitShareActionResponseData, AxiosRequestConfig> =
|
|
27
|
+
await publicRequest.post(`/v1/pre-registration/${hash}/submit-action`, {
|
|
28
|
+
data: {
|
|
29
|
+
attributes: {
|
|
30
|
+
phase: 'pre-registration',
|
|
31
|
+
eventActionId: Number(eventActionId),
|
|
32
|
+
accessToken,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
})
|
|
36
|
+
return response.data
|
|
37
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg fill="#ffffff" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="32px" height="32px">
|
|
2
|
+
<circle cx="32" cy="32" r="31" fill='#A01173' />
|
|
3
|
+
<path
|
|
4
|
+
d="M 23.8513 12.0905 C 17.3957 12.0905 12.0905 17.3886 12.0905 23.8513 L 12.0905 40.3279 C 12.0905 46.7835 17.3886 52.0887 23.8513 52.0887 L 40.3279 52.0887 C 46.7835 52.0887 52.0887 46.7906 52.0887 40.3279 L 52.0887 23.8513 C 52.0887 17.3957 46.7906 12.0905 40.3279 12.0905 Z M 23.8513 15.7267 L 40.3279 15.7267 C 44.8234 15.7267 48.4525 19.3558 48.4525 23.8513 L 48.4525 40.3279 C 48.4525 44.8234 44.8234 48.4525 40.3279 48.4525 L 23.8513 48.4525 C 19.3558 48.4525 15.7267 44.8234 15.7267 40.3279 L 15.7267 23.8513 C 15.7267 19.3558 19.3558 15.7267 23.8513 15.7267 Z M 42.8278 19.7038 C 41.9116 19.7038 41.1801 20.4353 41.1801 21.3514 C 41.1801 22.2676 41.9116 22.9991 42.8278 22.9991 C 43.7439 22.9991 44.4754 22.2676 44.4754 21.3514 C 44.4754 20.4353 43.7439 19.7038 42.8278 19.7038 Z M 32.0896 21.181 C 26.0885 21.181 21.181 26.0885 21.181 32.0896 C 21.181 38.0907 26.0885 42.9982 32.0896 42.9982 C 38.0907 42.9982 42.9982 38.0907 42.9982 32.0896 C 42.9982 26.0885 38.0907 21.181 32.0896 21.181 Z M 32.0896 24.8172 C 36.1306 24.8172 39.362 28.0486 39.362 32.0896 C 39.362 36.1306 36.1306 39.362 32.0896 39.362 C 28.0486 39.362 24.8172 36.1306 24.8172 32.0896 C 24.8172 28.0486 28.0486 24.8172 32.0896 24.8172 Z" />
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0"?><svg fill="#ffffff" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="32px"
|
|
2
|
+
height="32px">
|
|
3
|
+
<circle cx="32" cy="32" r="31" fill='#60BD82' />
|
|
4
|
+
<path
|
|
5
|
+
d="M 11 25 z M 45.3205 48.134 c -0.4019 0.6035 -1.0638 0.9289 -1.7382 0.9289 c -0.3977 0 -0.7996 -0.1126 -1.1556 -0.3504 C 38.9877 46.4194 33.1556 44.8897 28.2885 44.8911 c -5.1647 0.0028 -9.0361 1.271 -9.075 1.2835 c -1.0902 0.3699 -2.2736 -0.2253 -2.638 -1.3183 s 0.2267 -2.275 1.3197 -2.638 c 0.1836 -0.0612 4.5598 -1.4949 10.3933 -1.4977 C 33.1556 40.718 39.925 42.0307 44.742 45.2416 C 45.7015 45.8812 45.9602 47.1759 45.3205 48.134 z M 49.4812 39.5957 c -0.4519 0.7259 -1.2321 1.125 -2.0289 1.125 c -0.4311 0 -0.8677 -0.1154 -1.2599 -0.3616 c -6.2354 -3.8853 -12.6433 -4.7072 -18.164 -4.6585 c -6.2327 0.0556 -11.2166 1.2446 -11.3014 1.2696 c -1.2613 0.3588 -2.5879 -0.3782 -2.9481 -1.6451 c -0.3602 -1.2696 0.3782 -2.5893 1.6465 -2.9481 c 0.3852 -0.1099 5.3594 -1.3336 12.1691 -1.3906 c 6.209 -0.0515 13.9463 0.8483 21.1246 5.3204 C 49.8358 37.0023 50.1793 38.4763 49.4812 39.5957 z M 53.6321 29.6112 C 53.1134 30.4929 52.1845 30.9838 51.2306 30.9838 c -0.4784 0 -0.9623 -0.1238 -1.4059 -0.3824 c -7.2673 -4.2664 -16.1031 -5.1716 -22.2357 -5.18 c -0.0292 0 -0.0584 0 -0.0876 0 c -7.4161 0 -13.1272 1.3044 -13.1843 1.3183 c -1.4991 0.3435 -2.9912 -0.5827 -3.3388 -2.0789 c -0.3476 -1.4949 0.5799 -2.9884 2.0748 -3.3374 C 13.3103 21.2635 19.4123 19.859 27.5014 19.859 c 0.032 0 0.064 0 0.096 0 c 6.8209 0.0097 16.7025 1.0471 25.0447 5.9448 C 53.9659 26.5825 54.4095 28.2874 53.6321 29.6112 z" />
|
|
6
|
+
</svg>
|
|
@@ -75,8 +75,6 @@ export interface IBillingInfoPage {
|
|
|
75
75
|
onGetStatesError?: (e: AxiosError) => void;
|
|
76
76
|
onGetProfileDataSuccess?: (res: any) => void;
|
|
77
77
|
onGetProfileDataError?: (e: AxiosError) => void;
|
|
78
|
-
onAuthorizeSuccess?: () => void;
|
|
79
|
-
onAuthorizeError?: (e: AxiosError) => void;
|
|
80
78
|
onLogin?: () => void;
|
|
81
79
|
onLoginSuccess?: () => void;
|
|
82
80
|
onErrorClose?: () => void;
|
|
@@ -219,8 +217,6 @@ export const BillingInfoContainer = React.memo(
|
|
|
219
217
|
onGetStatesError = _identity,
|
|
220
218
|
onGetProfileDataSuccess = _identity,
|
|
221
219
|
onGetProfileDataError = _identity,
|
|
222
|
-
onAuthorizeSuccess = _identity,
|
|
223
|
-
onAuthorizeError = _identity,
|
|
224
220
|
onLogin,
|
|
225
221
|
onLoginSuccess = _identity,
|
|
226
222
|
isLoggedIn: pIsLoggedIn = false,
|
|
@@ -1068,8 +1064,6 @@ export const BillingInfoContainer = React.memo(
|
|
|
1068
1064
|
}}
|
|
1069
1065
|
alreadyHasUser={alreadyHasUser}
|
|
1070
1066
|
userExpired={userExpired}
|
|
1071
|
-
onAuthorizeSuccess={onAuthorizeSuccess}
|
|
1072
|
-
onAuthorizeError={onAuthorizeError}
|
|
1073
1067
|
onGetProfileDataSuccess={(data: any) => {
|
|
1074
1068
|
fetchCart()
|
|
1075
1069
|
onGetProfileDataSuccess(data)
|
|
@@ -1107,7 +1101,7 @@ export const BillingInfoContainer = React.memo(
|
|
|
1107
1101
|
onClose={() => {
|
|
1108
1102
|
setShowModalForgotPassword(false)
|
|
1109
1103
|
}}
|
|
1110
|
-
|
|
1104
|
+
onLoginButtonClick={() => {
|
|
1111
1105
|
setShowModalForgotPassword(false)
|
|
1112
1106
|
setShowModalLogin(true)
|
|
1113
1107
|
}}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _get from 'lodash/get'
|
|
2
|
+
import _identity from 'lodash/identity'
|
|
3
|
+
import React, { useRef } from 'react'
|
|
4
|
+
|
|
5
|
+
interface ICopyFieldProps {
|
|
6
|
+
copyValue: string;
|
|
7
|
+
onLinkCopied?: () => void;
|
|
8
|
+
copyIconSrc?: string;
|
|
9
|
+
copyTitle?: string;
|
|
10
|
+
hasCopyIcon: boolean;
|
|
11
|
+
classNamePrefix?: string;
|
|
12
|
+
messageText?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const CopyField = (props: ICopyFieldProps) => {
|
|
16
|
+
const {
|
|
17
|
+
copyValue,
|
|
18
|
+
copyIconSrc = 'https://img.icons8.com/office/50/000000/copy.png',
|
|
19
|
+
copyTitle = 'Copy',
|
|
20
|
+
hasCopyIcon = false,
|
|
21
|
+
onLinkCopied = _identity,
|
|
22
|
+
classNamePrefix = '',
|
|
23
|
+
messageText = '',
|
|
24
|
+
} = props
|
|
25
|
+
|
|
26
|
+
const inputRef = useRef(null)
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<>
|
|
30
|
+
{messageText && <span className="message-text">{messageText}</span>}
|
|
31
|
+
<input
|
|
32
|
+
ref={inputRef}
|
|
33
|
+
className={`${classNamePrefix}_share-input`}
|
|
34
|
+
defaultValue={copyValue}
|
|
35
|
+
readOnly={true}
|
|
36
|
+
/>
|
|
37
|
+
<div
|
|
38
|
+
className={`${classNamePrefix}_share-by-link-copy-icon`}
|
|
39
|
+
aria-hidden={true}
|
|
40
|
+
onClick={() => {
|
|
41
|
+
navigator.clipboard.writeText(_get(inputRef, 'current.value'))
|
|
42
|
+
onLinkCopied()
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
{hasCopyIcon ? (
|
|
46
|
+
<img src={copyIconSrc} alt="copy" />
|
|
47
|
+
) : (
|
|
48
|
+
<span className={`${classNamePrefix}_copy-icon`}>{copyTitle}</span>
|
|
49
|
+
)}
|
|
50
|
+
</div>
|
|
51
|
+
</>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Modal from '@mui/material/Modal'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
interface ICopyMessageModalProps {
|
|
5
|
+
showCopyModal: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const CopyMessageModal = (props: ICopyMessageModalProps) => {
|
|
10
|
+
const { showCopyModal = false, onClose } = props
|
|
11
|
+
return (
|
|
12
|
+
<Modal
|
|
13
|
+
open={showCopyModal}
|
|
14
|
+
onClose={onClose}
|
|
15
|
+
aria-labelledby="modal-modal-title"
|
|
16
|
+
aria-describedby="modal-modal-description"
|
|
17
|
+
className="success-copy-modal"
|
|
18
|
+
>
|
|
19
|
+
<div className="message-copy-success-box">
|
|
20
|
+
<div className="message-copy-success">
|
|
21
|
+
<span>
|
|
22
|
+
Copied to your clipboard! Now paste your link in a Snapchat message,
|
|
23
|
+
</span>
|
|
24
|
+
<span>your Instagram bio, Whatsapp, Facebook or a text :)</span>
|
|
25
|
+
</div>
|
|
26
|
+
<div className="footer">
|
|
27
|
+
<button className="footer-button" type="button" onClick={onClose}>
|
|
28
|
+
OK
|
|
29
|
+
</button>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</Modal>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
@@ -4,6 +4,7 @@ export { FormikPhoneNumberField } from './FormikPhoneNumberField'
|
|
|
4
4
|
export { PhoneNumberField } from './PhoneNumberField'
|
|
5
5
|
export { Loader } from './Loader'
|
|
6
6
|
export { SelectField } from './SelectField'
|
|
7
|
+
export { CopyMessageModal } from './CopyMessageModal'
|
|
7
8
|
export { DatePickerField } from './DatePickerField'
|
|
8
9
|
export { NativeSelectField } from './NativeSelectFeild'
|
|
9
10
|
export { RadioGroupField } from './RadioGroupField'
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import _identity from 'lodash/identity'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import SVG from 'react-inlinesvg'
|
|
4
|
+
|
|
5
|
+
import { getImage } from '../../utils/getImage'
|
|
6
|
+
|
|
7
|
+
interface IShareButtonProps {
|
|
8
|
+
url: string;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
children: Node;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const SpotifyIcon = () => <SVG src={getImage('spotify.svg')} />
|
|
14
|
+
|
|
15
|
+
export const InstagramIcon = () => <SVG src={getImage('instagram.svg')} />
|
|
16
|
+
|
|
17
|
+
export const SocialButton = (props: IShareButtonProps) => {
|
|
18
|
+
const { children, url, disabled } = props
|
|
19
|
+
|
|
20
|
+
const handleClick = () => {
|
|
21
|
+
window.open(url)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<button
|
|
26
|
+
className={`react-share__ShareButton ${disabled ? 'disabled-action' : ''}`}
|
|
27
|
+
type="button"
|
|
28
|
+
onClick={!disabled ? handleClick : _identity}
|
|
29
|
+
>
|
|
30
|
+
{children}
|
|
31
|
+
</button>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
@@ -1,72 +1,79 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
FacebookMessengerShareButton,
|
|
4
|
-
TwitterShareButton,
|
|
5
|
-
LinkedinShareButton,
|
|
6
|
-
PinterestShareButton,
|
|
7
|
-
VKShareButton,
|
|
8
|
-
OKShareButton,
|
|
9
|
-
TelegramShareButton,
|
|
10
|
-
WhatsappShareButton,
|
|
11
|
-
RedditShareButton,
|
|
12
|
-
TumblrShareButton,
|
|
13
|
-
MailruShareButton,
|
|
2
|
+
EmailIcon,
|
|
14
3
|
EmailShareButton,
|
|
15
|
-
LivejournalShareButton,
|
|
16
|
-
ViberShareButton,
|
|
17
|
-
WorkplaceShareButton,
|
|
18
|
-
LineShareButton,
|
|
19
|
-
PocketShareButton,
|
|
20
|
-
InstapaperShareButton,
|
|
21
|
-
WeiboShareButton,
|
|
22
|
-
HatenaShareButton,
|
|
23
4
|
FacebookIcon,
|
|
24
5
|
FacebookMessengerIcon,
|
|
25
|
-
|
|
6
|
+
FacebookMessengerShareButton,
|
|
7
|
+
FacebookShareButton,
|
|
8
|
+
HatenaIcon,
|
|
9
|
+
HatenaShareButton,
|
|
10
|
+
InstapaperIcon,
|
|
11
|
+
InstapaperShareButton,
|
|
12
|
+
LineIcon,
|
|
13
|
+
LineShareButton,
|
|
26
14
|
LinkedinIcon,
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
LinkedinShareButton,
|
|
16
|
+
LivejournalIcon,
|
|
17
|
+
LivejournalShareButton,
|
|
18
|
+
MailruIcon,
|
|
19
|
+
MailruShareButton,
|
|
29
20
|
OKIcon,
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
OKShareButton,
|
|
22
|
+
PinterestIcon,
|
|
23
|
+
PinterestShareButton,
|
|
24
|
+
PocketIcon,
|
|
25
|
+
PocketShareButton,
|
|
32
26
|
RedditIcon,
|
|
27
|
+
RedditShareButton,
|
|
28
|
+
TelegramIcon,
|
|
29
|
+
TelegramShareButton,
|
|
33
30
|
TumblrIcon,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
TumblrShareButton,
|
|
32
|
+
TwitterIcon,
|
|
33
|
+
TwitterShareButton,
|
|
37
34
|
ViberIcon,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
InstapaperIcon,
|
|
35
|
+
ViberShareButton,
|
|
36
|
+
VKIcon,
|
|
37
|
+
VKShareButton,
|
|
42
38
|
WeiboIcon,
|
|
43
|
-
|
|
39
|
+
WeiboShareButton,
|
|
40
|
+
WhatsappIcon,
|
|
41
|
+
WhatsappShareButton,
|
|
42
|
+
WorkplaceIcon,
|
|
43
|
+
WorkplaceShareButton,
|
|
44
44
|
} from 'react-share'
|
|
45
45
|
|
|
46
|
+
import { InstagramIcon, SocialButton, SpotifyIcon } from '../common/socials'
|
|
47
|
+
|
|
46
48
|
const config: any = {
|
|
47
|
-
facebook:
|
|
48
|
-
messenger:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
49
|
+
facebook: { component: FacebookShareButton, icon: FacebookIcon },
|
|
50
|
+
messenger: {
|
|
51
|
+
component: FacebookMessengerShareButton,
|
|
52
|
+
icon: FacebookMessengerIcon,
|
|
53
|
+
},
|
|
54
|
+
twitter: { component: TwitterShareButton, icon: TwitterIcon },
|
|
55
|
+
linkedin: { component: LinkedinShareButton, icon: LinkedinIcon },
|
|
56
|
+
pinterest: { component: PinterestShareButton, icon: PinterestIcon },
|
|
57
|
+
vk: { component: VKShareButton, icon: VKIcon },
|
|
58
|
+
ok: { component: OKShareButton, icon: OKIcon },
|
|
59
|
+
telegram: { component: TelegramShareButton, icon: TelegramIcon },
|
|
60
|
+
whatsapp: { component: WhatsappShareButton, icon: WhatsappIcon },
|
|
61
|
+
reddit: { component: RedditShareButton, icon: RedditIcon },
|
|
62
|
+
tumblr: { component: TumblrShareButton, icon: TumblrIcon },
|
|
63
|
+
mailru: { component: MailruShareButton, icon: MailruIcon },
|
|
64
|
+
email: { component: EmailShareButton, icon: EmailIcon },
|
|
65
|
+
livejournal: { component: LivejournalShareButton, icon: LivejournalIcon },
|
|
66
|
+
viber: { component: ViberShareButton, icon: ViberIcon },
|
|
67
|
+
workplace: { component: WorkplaceShareButton, icon: WorkplaceIcon },
|
|
68
|
+
line: { component: LineShareButton, icon: LineIcon },
|
|
69
|
+
pocket: { component: PocketShareButton, icon: PocketIcon },
|
|
70
|
+
instapaper: { component: InstapaperShareButton, icon: InstapaperIcon },
|
|
71
|
+
weibo: { component: WeiboShareButton, icon: WeiboIcon },
|
|
72
|
+
hatena: { component: HatenaShareButton, icon: HatenaIcon },
|
|
73
|
+
instagram: { component: SocialButton, icon: InstagramIcon },
|
|
74
|
+
spotify: { component: SocialButton, icon: SpotifyIcon },
|
|
68
75
|
}
|
|
69
76
|
|
|
70
|
-
export default function
|
|
77
|
+
export default function(key: string) {
|
|
71
78
|
return config[key]
|
|
72
79
|
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
2
|
import './style.css'
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import { AxiosError } from 'axios'
|
|
4
|
+
import axios, { AxiosError } from 'axios'
|
|
6
5
|
import _get from 'lodash/get'
|
|
7
6
|
import _identity from 'lodash/identity'
|
|
8
7
|
import _map from 'lodash/map'
|
|
9
|
-
import React, { useEffect, useRef, useState } from 'react'
|
|
8
|
+
import React, { SyntheticEvent, useEffect, useRef, useState } from 'react'
|
|
10
9
|
|
|
11
10
|
import { getConfirmationData } from '../../api'
|
|
12
11
|
import { usePixel } from '../../hooks/usePixel'
|
|
13
12
|
import { IReferralPromotion } from '../../types'
|
|
14
13
|
import { createMarkup, isBrowser } from '../../utils'
|
|
14
|
+
import { CopyMessageModal } from '../common'
|
|
15
15
|
import SocialButtons from './social-buttons'
|
|
16
16
|
|
|
17
17
|
export interface IShareButton {
|
|
18
18
|
mainLabel: string;
|
|
19
19
|
subLabel: string;
|
|
20
20
|
platform: string;
|
|
21
|
-
shareData:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
shareData: any;
|
|
22
|
+
points?: number | string;
|
|
23
|
+
onAfterShare?: (event: SyntheticEvent) => void;
|
|
24
|
+
eventActionId?: string;
|
|
25
|
+
oneTimeAction?: boolean;
|
|
26
|
+
alreadyApplied?: boolean;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export interface IConfirmationLabels {
|
|
@@ -103,7 +103,7 @@ export const ConfirmationContainer = ({
|
|
|
103
103
|
setData(data)
|
|
104
104
|
onGetConfirmationDataSuccess(confirmationDataResponse.data.attributes)
|
|
105
105
|
} catch (error) {
|
|
106
|
-
onGetConfirmationDataError(error
|
|
106
|
+
if (axios.isAxiosError(error)) onGetConfirmationDataError(error)
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
})()
|
|
@@ -137,27 +137,7 @@ export const ConfirmationContainer = ({
|
|
|
137
137
|
return (
|
|
138
138
|
<div className="confirmation-page">
|
|
139
139
|
{showCopyInfoModal && (
|
|
140
|
-
<
|
|
141
|
-
open={showCopyModal}
|
|
142
|
-
onClose={onClose}
|
|
143
|
-
aria-labelledby="modal-modal-title"
|
|
144
|
-
aria-describedby="modal-modal-description"
|
|
145
|
-
className="success-copy-modal"
|
|
146
|
-
>
|
|
147
|
-
<div className="message-copy-success-box">
|
|
148
|
-
<div className="message-copy-success">
|
|
149
|
-
<span>
|
|
150
|
-
Copied to your clipboard! Now paste your link in a Snapchat message,
|
|
151
|
-
</span>
|
|
152
|
-
<span>your Instagram bio, Whatsapp, Facebook or a text :)</span>
|
|
153
|
-
</div>
|
|
154
|
-
<div className="footer">
|
|
155
|
-
<button className="footer-button" type="button" onClick={onClose}>
|
|
156
|
-
OK
|
|
157
|
-
</button>
|
|
158
|
-
</div>
|
|
159
|
-
</div>
|
|
160
|
-
</Modal>
|
|
140
|
+
<CopyMessageModal onClose={onClose} showCopyModal={showCopyModal} />
|
|
161
141
|
)}
|
|
162
142
|
{data && (
|
|
163
143
|
<>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _identity from 'lodash/identity'
|
|
2
|
+
import React, { ReactElement } from 'react'
|
|
2
3
|
|
|
4
|
+
import { isValidNumber } from '../../utils/isValidNumber'
|
|
3
5
|
import config from './config'
|
|
4
6
|
import { IShareButton } from './index'
|
|
5
7
|
|
|
@@ -8,22 +10,36 @@ const SocialComponent = ({
|
|
|
8
10
|
subLabel,
|
|
9
11
|
platform,
|
|
10
12
|
shareData,
|
|
13
|
+
points,
|
|
14
|
+
onAfterShare,
|
|
15
|
+
alreadyApplied,
|
|
16
|
+
oneTimeAction,
|
|
11
17
|
}: IShareButton) => {
|
|
12
18
|
const Component = config(platform)?.component
|
|
13
19
|
const Icon = config(platform)?.icon
|
|
14
|
-
|
|
20
|
+
const isActionDisabled = alreadyApplied && oneTimeAction
|
|
15
21
|
return (
|
|
16
22
|
<>
|
|
17
23
|
{Component && (
|
|
18
|
-
<Component {...shareData}>
|
|
19
|
-
<div
|
|
24
|
+
<Component {...shareData} disabled={isActionDisabled}>
|
|
25
|
+
<div
|
|
26
|
+
onKeyDown={_identity}
|
|
27
|
+
onClick={!isActionDisabled ? onAfterShare : _identity}
|
|
28
|
+
className={`social-media-sharing ${platform}`}
|
|
29
|
+
>
|
|
20
30
|
<div className="share-icon">
|
|
21
31
|
<Icon size={32} round />
|
|
22
32
|
</div>
|
|
23
33
|
<span className="share-text">
|
|
24
|
-
{mainLabel}
|
|
25
|
-
<
|
|
34
|
+
<span className="main-label">{mainLabel} </span>
|
|
35
|
+
<span className="sub-label">{subLabel}</span>
|
|
26
36
|
</span>
|
|
37
|
+
{isValidNumber(points) && (
|
|
38
|
+
<div className="share-points">
|
|
39
|
+
<span className="points-count">{points}</span>
|
|
40
|
+
<span className="points-text">Points</span>
|
|
41
|
+
</div>
|
|
42
|
+
)}
|
|
27
43
|
</div>
|
|
28
44
|
</Component>
|
|
29
45
|
)}
|
|
@@ -37,8 +53,11 @@ interface SocialButtonsTypes {
|
|
|
37
53
|
appId: string;
|
|
38
54
|
showDefaultShareButtons: boolean;
|
|
39
55
|
shareButtons: IShareButton[];
|
|
56
|
+
titleText?: string;
|
|
57
|
+
footerText?: string | ReactElement;
|
|
40
58
|
clientLabel?: string;
|
|
41
59
|
showReferralsInfoText?: boolean;
|
|
60
|
+
onAfterShare?: (eventActionId: string | undefined) => void;
|
|
42
61
|
}
|
|
43
62
|
|
|
44
63
|
const SocialButtons = ({
|
|
@@ -47,13 +66,18 @@ const SocialButtons = ({
|
|
|
47
66
|
name,
|
|
48
67
|
appId,
|
|
49
68
|
shareButtons,
|
|
69
|
+
titleText = 'or use one of these convenient buttons:',
|
|
70
|
+
footerText = (
|
|
71
|
+
<p>
|
|
72
|
+
We <strong>never</strong> post on Facebook without your permission!
|
|
73
|
+
</p>
|
|
74
|
+
) as ReactElement,
|
|
50
75
|
clientLabel,
|
|
51
|
-
|
|
76
|
+
onAfterShare = _identity,
|
|
77
|
+
showReferralsInfoText = false,
|
|
52
78
|
}: SocialButtonsTypes) => (
|
|
53
79
|
<>
|
|
54
|
-
<div className="convenient_buttons">
|
|
55
|
-
or use one of these convenient buttons:
|
|
56
|
-
</div>
|
|
80
|
+
{titleText && <div className="convenient_buttons">{titleText}</div>}
|
|
57
81
|
<div className="social-media-btns">
|
|
58
82
|
{showDefaultShareButtons && (
|
|
59
83
|
<>
|
|
@@ -96,25 +120,24 @@ const SocialButtons = ({
|
|
|
96
120
|
</>
|
|
97
121
|
)}
|
|
98
122
|
{shareButtons.map((shareButton: IShareButton, index: number) => (
|
|
99
|
-
<SocialComponent
|
|
123
|
+
<SocialComponent
|
|
124
|
+
onAfterShare={() => onAfterShare(shareButton.eventActionId)}
|
|
125
|
+
key={index}
|
|
126
|
+
{...shareButton}
|
|
127
|
+
/>
|
|
100
128
|
))}
|
|
101
129
|
</div>
|
|
102
|
-
{
|
|
103
|
-
<p>
|
|
104
|
-
We <strong>never</strong> post on Facebook without your permission!
|
|
105
|
-
</p>
|
|
106
|
-
)}
|
|
130
|
+
{showDefaultShareButtons || shareButtons.length ? footerText : null}
|
|
107
131
|
{(showReferralsInfoText || Boolean(clientLabel)) && (
|
|
108
132
|
<p className="note-message">
|
|
109
133
|
<span>
|
|
110
134
|
*Please note, only purchases made from a different{' '}
|
|
111
|
-
{clientLabel || 'Ticket Fairy'} account can count towards your
|
|
112
|
-
referrals
|
|
135
|
+
{clientLabel || 'Ticket Fairy'} account can count towards your referrals
|
|
113
136
|
</span>
|
|
114
137
|
<span>
|
|
115
138
|
{' '}
|
|
116
|
-
so please make sure you ask your friends to buy their own tickets
|
|
117
|
-
|
|
139
|
+
so please make sure you ask your friends to buy their own tickets using their
|
|
140
|
+
own {clientLabel || 'Ticket Fairy'} account!
|
|
118
141
|
</span>
|
|
119
142
|
</p>
|
|
120
143
|
)}
|
|
@@ -10,9 +10,9 @@ import { forgotPassword } from '../../api'
|
|
|
10
10
|
import { CustomField } from '../common/CustomField'
|
|
11
11
|
import { PoweredBy } from '../common/PoweredBy'
|
|
12
12
|
|
|
13
|
-
interface IForgotPasswordProps {
|
|
13
|
+
export interface IForgotPasswordProps {
|
|
14
14
|
onClose: () => void;
|
|
15
|
-
|
|
15
|
+
onLoginButtonClick: () => void;
|
|
16
16
|
onForgotPasswordSuccess: (res: any) => void;
|
|
17
17
|
onForgotPasswordError: (e: AxiosError) => void;
|
|
18
18
|
showPoweredByImage?: boolean;
|
|
@@ -40,7 +40,7 @@ const Schema = Yup.object().shape({
|
|
|
40
40
|
|
|
41
41
|
export const ForgotPasswordModal: FC<IForgotPasswordProps> = ({
|
|
42
42
|
onClose = () => {},
|
|
43
|
-
|
|
43
|
+
onLoginButtonClick = () => {},
|
|
44
44
|
onForgotPasswordSuccess = () => {},
|
|
45
45
|
onForgotPasswordError = () => {},
|
|
46
46
|
showPoweredByImage = false,
|
|
@@ -94,7 +94,7 @@ export const ForgotPasswordModal: FC<IForgotPasswordProps> = ({
|
|
|
94
94
|
</button>
|
|
95
95
|
</div>
|
|
96
96
|
<div className="login">
|
|
97
|
-
<span onClick={
|
|
97
|
+
<span onClick={onLoginButtonClick}>Back to Log In</span>
|
|
98
98
|
</div>
|
|
99
99
|
{showPoweredByImage ? <PoweredBy /> : null}
|
|
100
100
|
</Form>
|