tf-checkout-react 1.0.103 → 1.0.106
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 +3 -1
- package/dist/components/common/CustomField.d.ts +1 -1
- package/dist/components/common/DatePickerField.d.ts +14 -0
- package/dist/components/common/RedirectModal.d.ts +7 -0
- package/dist/components/countdown/index.d.ts +3 -1
- package/dist/components/orderDetailsContainer/ticketsTable.d.ts +2 -0
- package/dist/components/rsvpContainer/index.d.ts +7 -0
- package/dist/components/ticketResale/index.d.ts +5 -3
- package/dist/components/ticketsContainer/AccessCodeSection.d.ts +7 -0
- package/dist/components/ticketsContainer/PromoCodeSection.d.ts +5 -9
- package/dist/components/ticketsContainer/TicketsSection.d.ts +6 -3
- package/dist/components/ticketsContainer/index.d.ts +9 -2
- package/dist/components/timerWidget/index.d.ts +3 -3
- package/dist/images/cross.svg +44 -0
- package/dist/images/done.svg +3 -3
- package/dist/index.d.ts +2 -0
- package/dist/tf-checkout-react.cjs.development.js +639 -223
- 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 +645 -231
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/package.json +89 -89
- package/src/.DS_Store +0 -0
- package/src/.d.ts +2 -2
- package/src/api/index.ts +300 -278
- package/src/assets/images/cross.svg +44 -0
- package/src/assets/images/done.svg +3 -3
- package/src/components/.DS_Store +0 -0
- package/src/components/billing-info-container/index.tsx +811 -799
- package/src/components/billing-info-container/style.css +105 -105
- package/src/components/billing-info-container/utils.ts +225 -224
- package/src/components/common/CheckboxField.tsx +41 -41
- package/src/components/common/CustomField.tsx +87 -84
- package/src/components/common/DatePickerField.tsx +98 -0
- package/src/components/common/FormikPhoneNumberField.tsx +51 -51
- package/src/components/common/Loader.tsx +9 -9
- package/src/components/common/RadioField.tsx +35 -35
- package/src/components/common/RedirectModal.tsx +43 -0
- package/src/components/common/SelectField.tsx +80 -80
- package/src/components/common/SnackbarAlert.tsx +53 -53
- package/src/components/common/index.tsx +4 -4
- package/src/components/confirmModal/index.tsx +51 -51
- package/src/components/confirmModal/style.css +21 -21
- package/src/components/confirmationContainer/config.ts +72 -72
- package/src/components/confirmationContainer/index.tsx +197 -197
- package/src/components/confirmationContainer/social-buttons.tsx +94 -94
- package/src/components/confirmationContainer/style.css +202 -202
- package/src/components/countdown/index.tsx +98 -89
- package/src/components/countdown/style.css +9 -9
- package/src/components/index.ts +7 -7
- package/src/components/loginModal/index.tsx +209 -209
- package/src/components/loginModal/style.css +71 -71
- package/src/components/myTicketsContainer/index.tsx +196 -196
- package/src/components/myTicketsContainer/row.tsx +41 -41
- package/src/components/myTicketsContainer/style.css +39 -39
- package/src/components/myTicketsContainer/tableConfig.tsx +34 -34
- package/src/components/orderDetailsContainer/index.tsx +252 -249
- package/src/components/orderDetailsContainer/style.css +72 -72
- package/src/components/orderDetailsContainer/ticketsTable.tsx +130 -124
- package/src/components/paymentContainer/index.tsx +285 -284
- package/src/components/registerModal/index.tsx +190 -190
- package/src/components/rsvpContainer/index.tsx +126 -0
- package/src/components/stripePayment/index.tsx +254 -253
- package/src/components/stripePayment/style.css +59 -59
- package/src/components/ticketResale/index.tsx +74 -56
- package/src/components/ticketResaleModal/index.tsx +215 -210
- package/src/components/ticketResaleModal/style.css +28 -28
- package/src/components/ticketsContainer/AccessCodeSection.tsx +50 -0
- package/src/components/ticketsContainer/PromoCodeSection.tsx +88 -99
- package/src/components/ticketsContainer/ReferralLogic.tsx +31 -33
- package/src/components/ticketsContainer/TicketRow.tsx +83 -83
- package/src/components/ticketsContainer/TicketsSection.tsx +90 -81
- package/src/components/ticketsContainer/index.tsx +464 -430
- package/src/components/ticketsContainer/style.css +181 -181
- package/src/components/ticketsContainer/utils.ts +11 -11
- package/src/components/timerWidget/index.tsx +87 -70
- package/src/components/timerWidget/style.css +34 -26
- package/src/components/waitingList/index.tsx +178 -178
- package/src/components/waitingList/style.css +26 -26
- package/src/env.ts +20 -20
- package/src/index.ts +15 -13
- package/src/normalizers/index.ts +45 -45
- package/src/types/billing-info-data.ts +37 -37
- package/src/types/payment-field.ts +7 -7
- package/src/types/referral-promotion.ts +7 -7
- package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +59 -59
- package/src/utils/downloadPDF.tsx +30 -30
- package/src/utils/formikErrorFocus.ts +24 -24
- package/src/utils/getImage.ts +14 -14
- package/src/utils/getQueryVariable.ts +13 -13
- package/src/utils/index.ts +5 -5
- package/src/utils/setConfigs.ts +26 -26
- package/src/utils/showZero.tsx +10 -10
- package/src/validators/index.ts +20 -20
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import FormGroup from '@mui/material/FormGroup'
|
|
3
|
-
import FormControlLabel from '@mui/material/FormControlLabel'
|
|
4
|
-
import Checkbox from '@mui/material/Checkbox'
|
|
5
|
-
import { FieldInputProps } from 'formik'
|
|
6
|
-
import { useTheme } from '@mui/styles'
|
|
7
|
-
import { FormControl, FormHelperText } from '@mui/material'
|
|
8
|
-
|
|
9
|
-
export interface ICheckboxField {
|
|
10
|
-
label: string | number | JSX.Element;
|
|
11
|
-
field?: FieldInputProps<any>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface IOtherProps {
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const CheckboxField = ({
|
|
19
|
-
label,
|
|
20
|
-
field,
|
|
21
|
-
selectOptions,
|
|
22
|
-
theme,
|
|
23
|
-
setFieldValue,
|
|
24
|
-
...rest
|
|
25
|
-
}: ICheckboxField & IOtherProps) => {
|
|
26
|
-
const customTheme: any = useTheme()
|
|
27
|
-
return (
|
|
28
|
-
<FormControl error={!!(rest?.form?.errors && rest.form.errors[field?.name ?? ""])}>
|
|
29
|
-
<FormGroup>
|
|
30
|
-
<FormControlLabel
|
|
31
|
-
control={<Checkbox {...field} {...rest} />}
|
|
32
|
-
label={label}
|
|
33
|
-
componentsProps={{
|
|
34
|
-
typography: customTheme?.checkbox
|
|
35
|
-
}}
|
|
36
|
-
/>
|
|
37
|
-
</FormGroup>
|
|
38
|
-
{!!(rest?.form?.errors && rest.form.errors[field?.name ?? ""]) ? <FormHelperText>Required</FormHelperText> : null}
|
|
39
|
-
</FormControl>
|
|
40
|
-
)
|
|
41
|
-
}
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import FormGroup from '@mui/material/FormGroup'
|
|
3
|
+
import FormControlLabel from '@mui/material/FormControlLabel'
|
|
4
|
+
import Checkbox from '@mui/material/Checkbox'
|
|
5
|
+
import { FieldInputProps } from 'formik'
|
|
6
|
+
import { useTheme } from '@mui/styles'
|
|
7
|
+
import { FormControl, FormHelperText } from '@mui/material'
|
|
8
|
+
|
|
9
|
+
export interface ICheckboxField {
|
|
10
|
+
label: string | number | JSX.Element;
|
|
11
|
+
field?: FieldInputProps<any>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface IOtherProps {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const CheckboxField = ({
|
|
19
|
+
label,
|
|
20
|
+
field,
|
|
21
|
+
selectOptions,
|
|
22
|
+
theme,
|
|
23
|
+
setFieldValue,
|
|
24
|
+
...rest
|
|
25
|
+
}: ICheckboxField & IOtherProps) => {
|
|
26
|
+
const customTheme: any = useTheme()
|
|
27
|
+
return (
|
|
28
|
+
<FormControl error={!!(rest?.form?.errors && rest.form.errors[field?.name ?? ""])}>
|
|
29
|
+
<FormGroup>
|
|
30
|
+
<FormControlLabel
|
|
31
|
+
control={<Checkbox {...field} {...rest} />}
|
|
32
|
+
label={label}
|
|
33
|
+
componentsProps={{
|
|
34
|
+
typography: customTheme?.checkbox
|
|
35
|
+
}}
|
|
36
|
+
/>
|
|
37
|
+
</FormGroup>
|
|
38
|
+
{!!(rest?.form?.errors && rest.form.errors[field?.name ?? ""]) ? <FormHelperText>Required</FormHelperText> : null}
|
|
39
|
+
</FormControl>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
@@ -1,84 +1,87 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import TextField from '@mui/material/TextField'
|
|
3
|
-
import _map from 'lodash/map'
|
|
4
|
-
import _get from 'lodash/get'
|
|
5
|
-
import _includes from 'lodash/includes'
|
|
6
|
-
|
|
7
|
-
import { FieldInputProps, FormikProps } from 'formik'
|
|
8
|
-
import { useTheme } from '@mui/styles'
|
|
9
|
-
|
|
10
|
-
export interface ISelectOption {
|
|
11
|
-
label: string | number;
|
|
12
|
-
value?: string | number;
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface ICustomField {
|
|
17
|
-
label: string;
|
|
18
|
-
|
|
19
|
-
field: FieldInputProps<any>;
|
|
20
|
-
form: FormikProps<any>;
|
|
21
|
-
theme: 'dark' | 'light';
|
|
22
|
-
|
|
23
|
-
// optional
|
|
24
|
-
type?: string;
|
|
25
|
-
selectOptions?: ISelectOption[];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
interface IOtherProps {
|
|
29
|
-
[key: string]: any;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const CustomField = ({
|
|
33
|
-
label,
|
|
34
|
-
type = 'text',
|
|
35
|
-
field,
|
|
36
|
-
selectOptions = [] as ISelectOption[],
|
|
37
|
-
form: { touched, errors, submitCount },
|
|
38
|
-
theme,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}}
|
|
66
|
-
|
|
67
|
-
sx: customTheme?.input,
|
|
68
|
-
}}
|
|
69
|
-
{
|
|
70
|
-
|
|
71
|
-
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
{option.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import TextField from '@mui/material/TextField'
|
|
3
|
+
import _map from 'lodash/map'
|
|
4
|
+
import _get from 'lodash/get'
|
|
5
|
+
import _includes from 'lodash/includes'
|
|
6
|
+
|
|
7
|
+
import { FieldInputProps, FormikProps } from 'formik'
|
|
8
|
+
import { useTheme } from '@mui/styles'
|
|
9
|
+
|
|
10
|
+
export interface ISelectOption {
|
|
11
|
+
label: string | number;
|
|
12
|
+
value?: string | number;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ICustomField {
|
|
17
|
+
label: string;
|
|
18
|
+
|
|
19
|
+
field: FieldInputProps<any>;
|
|
20
|
+
form: FormikProps<any>;
|
|
21
|
+
theme: 'dark' | 'light';
|
|
22
|
+
|
|
23
|
+
// optional
|
|
24
|
+
type?: string;
|
|
25
|
+
selectOptions?: ISelectOption[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface IOtherProps {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const CustomField = ({
|
|
33
|
+
label,
|
|
34
|
+
type = 'text',
|
|
35
|
+
field,
|
|
36
|
+
selectOptions = [] as ISelectOption[],
|
|
37
|
+
form: { touched, errors, submitCount },
|
|
38
|
+
theme,
|
|
39
|
+
inputProps: pInputProps = {},
|
|
40
|
+
InputProps = {},
|
|
41
|
+
inputRef,
|
|
42
|
+
}: ICustomField & IOtherProps) => {
|
|
43
|
+
const isSelectField = type === 'select'
|
|
44
|
+
const error = _get(errors, field.name)
|
|
45
|
+
const isTouched =
|
|
46
|
+
Boolean(_get(touched, field.name)) ||
|
|
47
|
+
(_includes(field.name, 'holder') && !!error && !!submitCount)
|
|
48
|
+
|
|
49
|
+
const customTheme: any = useTheme()
|
|
50
|
+
const inputProps: any = { sx: customTheme?.input }
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<TextField
|
|
54
|
+
id={field.name}
|
|
55
|
+
label={label}
|
|
56
|
+
type={type}
|
|
57
|
+
select={isSelectField}
|
|
58
|
+
fullWidth={true}
|
|
59
|
+
error={!!error && isTouched}
|
|
60
|
+
helperText={isTouched && error}
|
|
61
|
+
SelectProps={{
|
|
62
|
+
native: true,
|
|
63
|
+
className: theme,
|
|
64
|
+
MenuProps: { className: theme },
|
|
65
|
+
}}
|
|
66
|
+
InputLabelProps={{
|
|
67
|
+
sx: customTheme?.input,
|
|
68
|
+
}}
|
|
69
|
+
InputProps={InputProps}
|
|
70
|
+
inputProps={{ ...inputProps, ...pInputProps }}
|
|
71
|
+
inputRef={inputRef}
|
|
72
|
+
{...field}
|
|
73
|
+
>
|
|
74
|
+
{isSelectField
|
|
75
|
+
? _map(selectOptions, option => (
|
|
76
|
+
<option
|
|
77
|
+
key={option.value}
|
|
78
|
+
value={option.value}
|
|
79
|
+
disabled={option.disabled}
|
|
80
|
+
>
|
|
81
|
+
{option.label}
|
|
82
|
+
</option>
|
|
83
|
+
))
|
|
84
|
+
: null}
|
|
85
|
+
</TextField>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import DatePicker from '@mui/lab/DatePicker'
|
|
3
|
+
import AdapterMoment from '@mui/lab/AdapterMoment'
|
|
4
|
+
import LocalizationProvider from '@mui/lab/LocalizationProvider'
|
|
5
|
+
import { ThemeProvider, createTheme } from '@mui/material/styles'
|
|
6
|
+
import { FieldInputProps, FormikProps } from 'formik'
|
|
7
|
+
import _get from 'lodash/get'
|
|
8
|
+
import { CustomField } from './CustomField'
|
|
9
|
+
|
|
10
|
+
const DATE_SIZE = 32
|
|
11
|
+
const compactStyles = {
|
|
12
|
+
'& > div': {
|
|
13
|
+
minWidth: 256,
|
|
14
|
+
},
|
|
15
|
+
'& > div > div, & > div > div > div, & .MuiCalendarPicker-root': {
|
|
16
|
+
width: 256,
|
|
17
|
+
},
|
|
18
|
+
'& .MuiTypography-caption': {
|
|
19
|
+
width: DATE_SIZE,
|
|
20
|
+
margin: 0,
|
|
21
|
+
},
|
|
22
|
+
'& .PrivatePickersSlideTransition-root': {
|
|
23
|
+
minHeight: DATE_SIZE * 6,
|
|
24
|
+
},
|
|
25
|
+
'& .PrivatePickersSlideTransition-root [role="row"]': {
|
|
26
|
+
margin: 0,
|
|
27
|
+
},
|
|
28
|
+
'& .MuiPickersDay-dayWithMargin': {
|
|
29
|
+
margin: 0,
|
|
30
|
+
},
|
|
31
|
+
'& .MuiPickersDay-root': {
|
|
32
|
+
width: DATE_SIZE,
|
|
33
|
+
height: DATE_SIZE,
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const compactStyleTheme = createTheme({
|
|
38
|
+
components: {
|
|
39
|
+
MuiPaper: {
|
|
40
|
+
defaultProps: {
|
|
41
|
+
sx: compactStyles
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
export interface IDatePickerFieldProps {
|
|
48
|
+
label: string
|
|
49
|
+
|
|
50
|
+
field: FieldInputProps<any>
|
|
51
|
+
form: FormikProps<any>
|
|
52
|
+
theme: 'dark' | 'light'
|
|
53
|
+
|
|
54
|
+
useCompact?: boolean
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
interface IOtherProps {
|
|
58
|
+
[key: string]: any
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const DatePickerField = ({
|
|
62
|
+
label,
|
|
63
|
+
field,
|
|
64
|
+
form,
|
|
65
|
+
theme,
|
|
66
|
+
useCompact = true,
|
|
67
|
+
}: IDatePickerFieldProps & IOtherProps) => {
|
|
68
|
+
return (
|
|
69
|
+
<ThemeProvider theme={useCompact ? compactStyleTheme : {}}>
|
|
70
|
+
<LocalizationProvider dateAdapter={AdapterMoment}>
|
|
71
|
+
<DatePicker
|
|
72
|
+
value={field.value || ''}
|
|
73
|
+
onChange={value => form.setFieldValue(field.name, value)}
|
|
74
|
+
PopperProps={{
|
|
75
|
+
placement: 'bottom-start',
|
|
76
|
+
}}
|
|
77
|
+
showDaysOutsideCurrentMonth={true}
|
|
78
|
+
disableFuture={true}
|
|
79
|
+
inputFormat="DD/MM/YYYY"
|
|
80
|
+
mask="__/__/____"
|
|
81
|
+
renderInput={params => {
|
|
82
|
+
return (
|
|
83
|
+
<CustomField
|
|
84
|
+
{...params}
|
|
85
|
+
inputProps={{ ...params.inputProps, placeholder: 'dd/mm/yyyy' }}
|
|
86
|
+
theme={theme}
|
|
87
|
+
field={field}
|
|
88
|
+
form={form}
|
|
89
|
+
label={label}
|
|
90
|
+
type="tel"
|
|
91
|
+
/>
|
|
92
|
+
)
|
|
93
|
+
}}
|
|
94
|
+
/>
|
|
95
|
+
</LocalizationProvider>
|
|
96
|
+
</ThemeProvider>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { FieldInputProps } from 'formik'
|
|
3
|
-
import MuiPhoneNumber from 'material-ui-phone-number'
|
|
4
|
-
import _get from 'lodash/get'
|
|
5
|
-
import { removePlusSign } from '../../normalizers'
|
|
6
|
-
import { useTheme } from '@mui/styles'
|
|
7
|
-
|
|
8
|
-
export interface INumberInField {
|
|
9
|
-
label: string | number | JSX.Element;
|
|
10
|
-
field: FieldInputProps<any>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface IOtherProps {
|
|
14
|
-
[key: string]: any;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const FormikPhoneNumberField = ({
|
|
18
|
-
label,
|
|
19
|
-
field,
|
|
20
|
-
form: { touched, errors, initialValues },
|
|
21
|
-
setFieldValue,
|
|
22
|
-
selectOptions,
|
|
23
|
-
...rest
|
|
24
|
-
}: INumberInField & IOtherProps) => {
|
|
25
|
-
const error = _get(errors, field.name)
|
|
26
|
-
const isTouched = Boolean(_get(touched, field.name))
|
|
27
|
-
|
|
28
|
-
const customTheme: any = useTheme()
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<MuiPhoneNumber
|
|
32
|
-
name='phone'
|
|
33
|
-
value={initialValues.phone}
|
|
34
|
-
onChange={(e: any) => setFieldValue("phone", removePlusSign(e))}
|
|
35
|
-
variant="outlined"
|
|
36
|
-
defaultCountry='us'
|
|
37
|
-
disableDropdown={true}
|
|
38
|
-
label={label}
|
|
39
|
-
error={!!error && isTouched}
|
|
40
|
-
helperText={isTouched && error}
|
|
41
|
-
fullWidth
|
|
42
|
-
InputLabelProps={{
|
|
43
|
-
sx: customTheme?.input
|
|
44
|
-
}}
|
|
45
|
-
InputProps={{
|
|
46
|
-
sx: customTheme?.input
|
|
47
|
-
}}
|
|
48
|
-
autoFormat={false}
|
|
49
|
-
{...rest}
|
|
50
|
-
/>
|
|
51
|
-
)
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { FieldInputProps } from 'formik'
|
|
3
|
+
import MuiPhoneNumber from 'material-ui-phone-number'
|
|
4
|
+
import _get from 'lodash/get'
|
|
5
|
+
import { removePlusSign } from '../../normalizers'
|
|
6
|
+
import { useTheme } from '@mui/styles'
|
|
7
|
+
|
|
8
|
+
export interface INumberInField {
|
|
9
|
+
label: string | number | JSX.Element;
|
|
10
|
+
field: FieldInputProps<any>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface IOtherProps {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const FormikPhoneNumberField = ({
|
|
18
|
+
label,
|
|
19
|
+
field,
|
|
20
|
+
form: { touched, errors, initialValues },
|
|
21
|
+
setFieldValue,
|
|
22
|
+
selectOptions,
|
|
23
|
+
...rest
|
|
24
|
+
}: INumberInField & IOtherProps) => {
|
|
25
|
+
const error = _get(errors, field.name)
|
|
26
|
+
const isTouched = Boolean(_get(touched, field.name))
|
|
27
|
+
|
|
28
|
+
const customTheme: any = useTheme()
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<MuiPhoneNumber
|
|
32
|
+
name='phone'
|
|
33
|
+
value={initialValues.phone}
|
|
34
|
+
onChange={(e: any) => setFieldValue("phone", removePlusSign(e))}
|
|
35
|
+
variant="outlined"
|
|
36
|
+
defaultCountry='us'
|
|
37
|
+
disableDropdown={true}
|
|
38
|
+
label={label}
|
|
39
|
+
error={!!error && isTouched}
|
|
40
|
+
helperText={isTouched && error}
|
|
41
|
+
fullWidth
|
|
42
|
+
InputLabelProps={{
|
|
43
|
+
sx: customTheme?.input
|
|
44
|
+
}}
|
|
45
|
+
InputProps={{
|
|
46
|
+
sx: customTheme?.input
|
|
47
|
+
}}
|
|
48
|
+
autoFormat={false}
|
|
49
|
+
{...rest}
|
|
50
|
+
/>
|
|
51
|
+
)
|
|
52
52
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import CircularProgress from '@mui/material/CircularProgress'
|
|
3
|
-
|
|
4
|
-
export function Loader() {
|
|
5
|
-
return (
|
|
6
|
-
<div className="loader-container">
|
|
7
|
-
<CircularProgress />
|
|
8
|
-
</div>
|
|
9
|
-
)
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import CircularProgress from '@mui/material/CircularProgress'
|
|
3
|
+
|
|
4
|
+
export function Loader() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="loader-container">
|
|
7
|
+
<CircularProgress />
|
|
8
|
+
</div>
|
|
9
|
+
)
|
|
10
10
|
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import FormGroup from '@mui/material/FormGroup'
|
|
3
|
-
import FormControlLabel from '@mui/material/FormControlLabel'
|
|
4
|
-
import Radio from '@mui/material/Radio';
|
|
5
|
-
import { FieldInputProps } from 'formik'
|
|
6
|
-
import { useTheme } from '@mui/styles'
|
|
7
|
-
|
|
8
|
-
export interface IRadioField {
|
|
9
|
-
label: string | number | JSX.Element;
|
|
10
|
-
field?: FieldInputProps<any>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface IOtherProps {
|
|
14
|
-
[key: string]: any;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const RadioField = ({
|
|
18
|
-
label,
|
|
19
|
-
field,
|
|
20
|
-
theme,
|
|
21
|
-
...rest
|
|
22
|
-
}: IRadioField & IOtherProps) => {
|
|
23
|
-
const customTheme: any = useTheme()
|
|
24
|
-
return (
|
|
25
|
-
<FormGroup>
|
|
26
|
-
<FormControlLabel
|
|
27
|
-
control={<Radio {...field} {...rest} />}
|
|
28
|
-
label={label}
|
|
29
|
-
componentsProps={{
|
|
30
|
-
typography: customTheme?.checkbox
|
|
31
|
-
}}
|
|
32
|
-
/>
|
|
33
|
-
</FormGroup>
|
|
34
|
-
)
|
|
35
|
-
}
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import FormGroup from '@mui/material/FormGroup'
|
|
3
|
+
import FormControlLabel from '@mui/material/FormControlLabel'
|
|
4
|
+
import Radio from '@mui/material/Radio';
|
|
5
|
+
import { FieldInputProps } from 'formik'
|
|
6
|
+
import { useTheme } from '@mui/styles'
|
|
7
|
+
|
|
8
|
+
export interface IRadioField {
|
|
9
|
+
label: string | number | JSX.Element;
|
|
10
|
+
field?: FieldInputProps<any>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface IOtherProps {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const RadioField = ({
|
|
18
|
+
label,
|
|
19
|
+
field,
|
|
20
|
+
theme,
|
|
21
|
+
...rest
|
|
22
|
+
}: IRadioField & IOtherProps) => {
|
|
23
|
+
const customTheme: any = useTheme()
|
|
24
|
+
return (
|
|
25
|
+
<FormGroup>
|
|
26
|
+
<FormControlLabel
|
|
27
|
+
control={<Radio {...field} {...rest} />}
|
|
28
|
+
label={label}
|
|
29
|
+
componentsProps={{
|
|
30
|
+
typography: customTheme?.checkbox
|
|
31
|
+
}}
|
|
32
|
+
/>
|
|
33
|
+
</FormGroup>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Modal from '@mui/material/Modal'
|
|
3
|
+
import Box from '@mui/material/Box'
|
|
4
|
+
|
|
5
|
+
interface IRedirectModal {
|
|
6
|
+
message: string
|
|
7
|
+
onClickOk: () => void
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const style: React.CSSProperties = {
|
|
11
|
+
position: 'absolute',
|
|
12
|
+
top: '10%',
|
|
13
|
+
left: '50%',
|
|
14
|
+
transform: 'translate(-50%, -50%)',
|
|
15
|
+
minWidth: 480,
|
|
16
|
+
backgroundColor: '#e3e3e3',
|
|
17
|
+
border: '1px solid white',
|
|
18
|
+
outline: 'none',
|
|
19
|
+
padding: '14px',
|
|
20
|
+
maxHeight: '85vh',
|
|
21
|
+
overflow: 'auto',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const RedirectModal = ({
|
|
25
|
+
message = 'Your cart has expired. Please click on "OK" to return to the ticket selection page.',
|
|
26
|
+
onClickOk = () => {},
|
|
27
|
+
}: IRedirectModal) => {
|
|
28
|
+
return (
|
|
29
|
+
<Modal
|
|
30
|
+
open={true}
|
|
31
|
+
aria-labelledby="modal-modal-title"
|
|
32
|
+
aria-describedby="modal-modal-description"
|
|
33
|
+
className="redirect-modal"
|
|
34
|
+
>
|
|
35
|
+
<Box style={style}>
|
|
36
|
+
<p>{message}</p>
|
|
37
|
+
<div className="footer">
|
|
38
|
+
<button onClick={onClickOk}>OK</button>
|
|
39
|
+
</div>
|
|
40
|
+
</Box>
|
|
41
|
+
</Modal>
|
|
42
|
+
)
|
|
43
|
+
}
|