tf-checkout-react 1.3.26 → 1.3.28

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.26",
2
+ "version": "1.3.28",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -110,6 +110,7 @@ export interface IBillingInfoPage {
110
110
  showForgotPasswordButton?: boolean;
111
111
  showSignUpButton?: boolean;
112
112
  brandOptIn?: boolean;
113
+ showPoweredByImage?: boolean;
113
114
  }
114
115
 
115
116
  const LogicRunner: FC<{
@@ -247,6 +248,7 @@ export const BillingInfoContainer = React.memo(
247
248
  showForgotPasswordButton = false,
248
249
  showSignUpButton = false,
249
250
  brandOptIn = false,
251
+ showPoweredByImage = false,
250
252
  }: IBillingInfoPage) => {
251
253
  const [isNewUser, setIsNewUser] = useState(false)
252
254
  const themeMui = createTheme(themeOptions)
@@ -713,7 +715,7 @@ export const BillingInfoContainer = React.memo(
713
715
  <div className="account-actions-block">
714
716
  <div className="action-item">
715
717
  <div>{accountInfoTitle}</div>
716
- <div>Login & skip ahead:</div>
718
+ <div>Log in & skip ahead:</div>
717
719
  </div>
718
720
  <div className="action-item login-block">
719
721
  <button
@@ -728,7 +730,7 @@ export const BillingInfoContainer = React.memo(
728
730
  }
729
731
  }}
730
732
  >
731
- Login
733
+ Log in
732
734
  </button>
733
735
  {!hideLogo && (
734
736
  <div className="logo-image-container">
@@ -1004,6 +1006,7 @@ export const BillingInfoContainer = React.memo(
1004
1006
  setShowModalLogin(false)
1005
1007
  setShowModalSignup(true)
1006
1008
  }}
1009
+ showPoweredByImage={showPoweredByImage}
1007
1010
  />
1008
1011
  )}
1009
1012
  {showModalSignup && (
@@ -1017,6 +1020,7 @@ export const BillingInfoContainer = React.memo(
1017
1020
  }}
1018
1021
  onRegisterSuccess={onRegisterSuccess}
1019
1022
  onRegisterError={onRegisterError}
1023
+ showPoweredByImage={showPoweredByImage}
1020
1024
  />
1021
1025
  )}
1022
1026
  {showModalForgotPassword && (
@@ -1030,6 +1034,7 @@ export const BillingInfoContainer = React.memo(
1030
1034
  }}
1031
1035
  onForgotPasswordSuccess={onForgotPasswordSuccess}
1032
1036
  onForgotPasswordError={onForgotPasswordError}
1037
+ showPoweredByImage={showPoweredByImage}
1033
1038
  />
1034
1039
  )}
1035
1040
  </ThemeProvider>
@@ -1,10 +1,10 @@
1
- import React from 'react'
1
+ import { createTheme,ThemeProvider } from '@mui/material/styles'
2
2
  import { DatePicker } from '@mui/x-date-pickers'
3
3
  import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment'
4
4
  import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'
5
- import { ThemeProvider, createTheme } from '@mui/material/styles'
6
5
  import { FieldInputProps, FormikProps } from 'formik'
7
- import _get from 'lodash/get'
6
+ import React from 'react'
7
+
8
8
  import { CustomField } from './CustomField'
9
9
 
10
10
  const DATE_SIZE = 32
@@ -51,17 +51,17 @@ const compactStyleTheme = createTheme({
51
51
  })
52
52
 
53
53
  export interface IDatePickerFieldProps {
54
- label: string
54
+ label: string;
55
55
 
56
- field: FieldInputProps<any>
57
- form: FormikProps<any>
58
- theme: 'dark' | 'light'
56
+ field: FieldInputProps<any>;
57
+ form: FormikProps<any>;
58
+ theme: 'dark' | 'light';
59
59
 
60
- useCompact?: boolean
60
+ useCompact?: boolean;
61
61
  }
62
62
 
63
63
  interface IOtherProps {
64
- [key: string]: any
64
+ [key: string]: any;
65
65
  }
66
66
 
67
67
  export const DatePickerField = ({
@@ -70,8 +70,7 @@ export const DatePickerField = ({
70
70
  form,
71
71
  theme,
72
72
  useCompact = true,
73
- }: IDatePickerFieldProps & IOtherProps) => {
74
- return (
73
+ }: IDatePickerFieldProps & IOtherProps) => (
75
74
  <ThemeProvider theme={useCompact ? compactStyleTheme : {}}>
76
75
  <LocalizationProvider dateAdapter={AdapterMoment}>
77
76
  <DatePicker
@@ -83,9 +82,8 @@ export const DatePickerField = ({
83
82
  showDaysOutsideCurrentMonth={true}
84
83
  disableFuture={true}
85
84
  inputFormat="DD/MM/YYYY"
86
- mask="__/__/____"
87
- renderInput={params => {
88
- return (
85
+ mask="__/__/____"
86
+ renderInput={(params: any) => (
89
87
  <CustomField
90
88
  {...params}
91
89
  inputProps={{ ...params.inputProps, placeholder: 'dd/mm/yyyy' }}
@@ -93,7 +91,7 @@ export const DatePickerField = ({
93
91
  field={{
94
92
  ...field, onChange: (evt: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>) => {
95
93
  if (params.inputProps && params.inputProps.onChange) {
96
- params.inputProps.onChange(evt);
94
+ params.inputProps.onChange(evt)
97
95
  }
98
96
  }
99
97
  }}
@@ -101,10 +99,8 @@ export const DatePickerField = ({
101
99
  label={label}
102
100
  type="tel"
103
101
  />
104
- )
105
- }}
102
+ )}
106
103
  />
107
104
  </LocalizationProvider>
108
105
  </ThemeProvider>
109
106
  )
110
- }
@@ -0,0 +1,15 @@
1
+ import React from 'react'
2
+
3
+ export const PoweredBy = () => (
4
+ <div className="powered-container">
5
+ <div className='powered-text'>Powered By</div>
6
+ <img
7
+ className='powered-img'
8
+ alt="The Ticket Fairy"
9
+ src={"https://cdn-checkout.s3.us-east-2.amazonaws.com/IconTicketFairy.svg"}
10
+ />
11
+ <div className='powered-ttf'>
12
+ The<strong>Ticket</strong>Fairy
13
+ </div>
14
+ </div>
15
+ )
@@ -1,17 +1,21 @@
1
- import React, { FC, useState } from 'react'
2
- import { Field, Form, Formik } from 'formik'
1
+ import './style.css'
2
+
3
+ import { Box, CircularProgress,Modal } from '@mui/material'
3
4
  import axios, { AxiosError } from 'axios'
4
- import { Modal, Box, CircularProgress } from '@mui/material'
5
- import { CustomField } from '../common/CustomField'
5
+ import { Field, Form, Formik } from 'formik'
6
+ import React, { FC, useState } from 'react'
6
7
  import * as Yup from 'yup'
8
+
7
9
  import { forgotPassword } from '../../api'
8
- import './style.css'
10
+ import { CustomField } from '../common/CustomField'
11
+ import { PoweredBy } from '../common/PoweredBy'
9
12
 
10
13
  interface IForgotPasswordProps {
11
14
  onClose: () => void;
12
15
  onLogin: () => void;
13
16
  onForgotPasswordSuccess: (res: any) => void;
14
17
  onForgotPasswordError: (e: AxiosError) => void;
18
+ showPoweredByImage?: boolean;
15
19
  }
16
20
 
17
21
  interface ValuesTypes {
@@ -41,6 +45,7 @@ export const ForgotPasswordModal: FC<IForgotPasswordProps> = ({
41
45
  onLogin = () => {},
42
46
  onForgotPasswordSuccess = () => {},
43
47
  onForgotPasswordError = () => {},
48
+ showPoweredByImage = false,
44
49
  }) => {
45
50
  const [loading, setLoading] = useState(false)
46
51
 
@@ -97,6 +102,7 @@ export const ForgotPasswordModal: FC<IForgotPasswordProps> = ({
97
102
  <div className="login">
98
103
  <span onClick={onLogin}>Back to Log In</span>
99
104
  </div>
105
+ {showPoweredByImage ? <PoweredBy /> : null}
100
106
  </Form>
101
107
  )}
102
108
  </Formik>
@@ -14,6 +14,7 @@ import {
14
14
  getProfileData,
15
15
  } from '../../api'
16
16
  import { requiredValidator } from '../../validators'
17
+ import { PoweredBy } from '../common/PoweredBy'
17
18
 
18
19
  interface Props {
19
20
  onClose: () => void;
@@ -30,6 +31,7 @@ interface Props {
30
31
  logo?: string;
31
32
  showForgotPasswordButton?: boolean;
32
33
  showSignUpButton?: boolean;
34
+ showPoweredByImage?: boolean;
33
35
  }
34
36
 
35
37
  const style: React.CSSProperties = {
@@ -85,6 +87,7 @@ export const LoginModal: FC<Props> = ({
85
87
  logo,
86
88
  showForgotPasswordButton = false,
87
89
  showSignUpButton = false,
90
+ showPoweredByImage = false,
88
91
  }) => {
89
92
  const [error, setError] = useState('')
90
93
  return (
@@ -137,7 +140,7 @@ export const LoginModal: FC<Props> = ({
137
140
  >
138
141
  {props => (
139
142
  <Form onSubmit={props.handleSubmit}>
140
- <div className="modal-title">Login</div>
143
+ <div className="modal-title">Log in</div>
141
144
  <div className='login-logo-container'>
142
145
  <img
143
146
  className="login-logo-tff"
@@ -187,7 +190,7 @@ export const LoginModal: FC<Props> = ({
187
190
  </Field>
188
191
  </div>
189
192
  <div className="login-action-button">
190
- <button type="submit">Login</button>
193
+ <button type="submit">Log in</button>
191
194
  </div>
192
195
  {showForgotPasswordButton && (
193
196
  <div className="forgot-password">
@@ -199,6 +202,7 @@ export const LoginModal: FC<Props> = ({
199
202
  <span aria-hidden="true" onClick={onSignup}>Sign up</span>
200
203
  </div>
201
204
  )}
205
+ {showPoweredByImage ? <PoweredBy /> : null}
202
206
  </div>
203
207
  </Form>
204
208
  )}
@@ -1,24 +1,29 @@
1
- import React, { FC } from 'react'
2
- import { AxiosError } from 'axios'
3
1
  import './style.css'
4
- import { getProfileData, register } from '../../api'
5
- import { Field, Form, Formik } from 'formik'
6
- import { requiredValidator } from '../../validators'
2
+
7
3
  import { TextField } from '@mui/material'
4
+ import { AxiosError } from 'axios'
5
+ import { Field, Form, Formik } from 'formik'
8
6
  import _get from 'lodash/get'
7
+ import React, { FC } from 'react'
8
+
9
+ import { getProfileData, register } from '../../api'
9
10
  import { CONFIGS } from '../../utils'
11
+ import { requiredValidator } from '../../validators'
12
+ import { PoweredBy } from '../common/PoweredBy'
10
13
 
11
14
  interface Props {
12
15
  onClose: () => void;
13
16
  onRegister: () => void;
14
17
  onGetProfileDataSuccess: (res: any) => void;
15
18
  onGetProfileDataError: (e: AxiosError) => void;
19
+ showPoweredByImage?: boolean;
16
20
  }
17
21
 
18
22
  export const RegisterModal: FC<Props> = ({
19
23
  onClose,
20
24
  onGetProfileDataSuccess = () => {},
21
25
  onGetProfileDataError = () => {},
26
+ showPoweredByImage = false,
22
27
  }) => (
23
28
  <div
24
29
  style={{
@@ -176,6 +181,7 @@ export const RegisterModal: FC<Props> = ({
176
181
  </div>
177
182
  </div>
178
183
  <button type="submit">Submit</button>
184
+ {showPoweredByImage ? <PoweredBy /> : null}
179
185
  </Form>
180
186
  )}
181
187
  </Formik>
@@ -1,30 +1,34 @@
1
- import React, { FC, useState } from 'react'
1
+ import './style.css'
2
+
3
+ import { Box, CircularProgress,Modal } from '@mui/material'
2
4
  import axios, { AxiosError } from 'axios'
3
5
  import { Field, Form, Formik } from 'formik'
4
- import { Modal, Box, CircularProgress } from '@mui/material'
5
- import { CustomField } from '../common/CustomField'
6
- import * as Yup from 'yup'
7
6
  import _get from 'lodash/get'
8
- import { register, handleSetAccessToken } from '../../api'
9
- import './style.css'
7
+ import React, { FC, useState } from 'react'
8
+ import * as Yup from 'yup'
9
+
10
+ import { handleSetAccessToken,register } from '../../api'
10
11
  import { CONFIGS } from '../../utils'
12
+ import { CustomField } from '../common/CustomField'
13
+ import { PoweredBy } from '../common/PoweredBy'
11
14
 
12
15
  interface ISignupProps {
13
- onClose: () => void
14
- onLogin: () => void
16
+ onClose: () => void;
17
+ onLogin: () => void;
15
18
  onRegisterSuccess: (value: {
16
19
  accessToken: string;
17
20
  refreshToken: string;
18
- }) => void
19
- onRegisterError: (e: AxiosError, email: string) => void
21
+ }) => void;
22
+ onRegisterError: (e: AxiosError, email: string) => void;
23
+ showPoweredByImage?: boolean;
20
24
  }
21
25
 
22
26
  interface ValuesTypes {
23
- firstName: string
24
- lastName: string
25
- email: string
26
- password: string
27
- confirmPassword: string
27
+ firstName: string;
28
+ lastName: string;
29
+ email: string;
30
+ password: string;
31
+ confirmPassword: string;
28
32
  }
29
33
 
30
34
  const style: React.CSSProperties = {
@@ -58,6 +62,7 @@ export const SignupModal: FC<ISignupProps> = ({
58
62
  onLogin = () => {},
59
63
  onRegisterSuccess = () => {},
60
64
  onRegisterError = () => {},
65
+ showPoweredByImage = false,
61
66
  }) => {
62
67
  const [loading, setLoading] = useState(false)
63
68
 
@@ -90,7 +95,7 @@ export const SignupModal: FC<ISignupProps> = ({
90
95
  'data.data.attributes.refresh_token'
91
96
  )
92
97
  handleSetAccessToken(access_token_register)
93
-
98
+
94
99
  const tokens = {
95
100
  accessToken: access_token_register,
96
101
  refreshToken,
@@ -183,8 +188,9 @@ export const SignupModal: FC<ISignupProps> = ({
183
188
  </button>
184
189
  </div>
185
190
  <div className="login">
186
- <span onClick={onLogin}>Login</span>
191
+ <span onClick={onLogin}>Log in</span>
187
192
  </div>
193
+ {showPoweredByImage ? <PoweredBy /> : null}
188
194
  </Form>
189
195
  )}
190
196
  </Formik>
@@ -14,6 +14,7 @@ export interface IPromoCodeSectionProps {
14
14
  setCodeIsApplied: (value: boolean) => void;
15
15
  codeIsInvalid: boolean;
16
16
  setCodeIsInvalid: (value: boolean) => void;
17
+ promoText?: string;
17
18
  }
18
19
 
19
20
  export const PromoCodeSection = ({
@@ -25,7 +26,8 @@ export const PromoCodeSection = ({
25
26
  updateTickets,
26
27
  setCodeIsApplied,
27
28
  codeIsInvalid,
28
- setCodeIsInvalid
29
+ setCodeIsInvalid,
30
+ promoText,
29
31
  }: IPromoCodeSectionProps) => {
30
32
  const isPromoCodeHasValue = !!code.trim()
31
33
 
@@ -92,7 +94,7 @@ export const PromoCodeSection = ({
92
94
  setCodeIsInvalid(false)
93
95
  }}
94
96
  >
95
- Got a promo code? Click here
97
+ {promoText ?? 'Got a promo code? Click here'}
96
98
  </Button>
97
99
  )}
98
100
  {showPromoInput && renderInputField()}
@@ -88,6 +88,7 @@ export interface IGetTickets {
88
88
  enableInfluencersSection?: boolean;
89
89
  enableAddOns?: boolean;
90
90
  ordersPath?: string;
91
+ promoText?: string;
91
92
  }
92
93
 
93
94
  export interface ITicket {
@@ -133,6 +134,7 @@ export const TicketsContainer = ({
133
134
  handleNotInvitedModalClose = _identity,
134
135
  handleInvalidLinkModalClose = _identity,
135
136
  ordersPath,
137
+ promoText,
136
138
  }: IGetTickets) => {
137
139
  const [selectedTickets, setSelectedTickets] = useState({} as ISelectedTickets)
138
140
  const isWindowDefined = typeof window !== 'undefined'
@@ -567,6 +569,7 @@ export const TicketsContainer = ({
567
569
  updateTickets={updateTickets}
568
570
  codeIsInvalid={codeIsInvalid}
569
571
  setCodeIsInvalid={setCodeIsInvalid}
572
+ promoText={promoText}
570
573
  />
571
574
  ) : null}
572
575
  {wrappedActionsSectionComponent}
package/src/index.ts CHANGED
@@ -15,4 +15,5 @@ export { RedirectModal } from './components/common/RedirectModal'
15
15
  export { RsvpContainer } from './components/rsvpContainer'
16
16
  export { ResetPasswordContainer } from './components/resetPasswordContainer'
17
17
  export { ForgotPasswordModal } from './components/forgotPasswordModal'
18
- export { AddonsContainter } from './components/addonsContainer'
18
+ export { AddonsContainter } from './components/addonsContainer'
19
+ export { PoweredBy } from './components/common/PoweredBy'