tf-checkout-react 1.0.51 → 1.0.52

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.0.51",
2
+ "version": "1.0.52",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -369,7 +369,13 @@ export const BillingInfoContainer = ({
369
369
  return
370
370
  }
371
371
 
372
- const bodyFormData = createRegisterFormData(values)
372
+ const checkoutBodyForRegistration = createCheckoutDataBody(
373
+ ticketsQuantity.length,
374
+ values,
375
+ { emailLogged, firstNameLogged, lastNameLogged },
376
+ showDOB
377
+ )
378
+ const bodyFormData = createRegisterFormData(values, checkoutBodyForRegistration)
373
379
 
374
380
  let access_token_register = null
375
381
  try {
@@ -36,7 +36,10 @@ export const getInitialValues = (
36
36
  return initialValues
37
37
  }
38
38
 
39
- export const createRegisterFormData = (values: IValues = {}): FormData => {
39
+ export const createRegisterFormData = (
40
+ values: IValues = {},
41
+ checkoutBody: { attributes: { [key: string]: any } }
42
+ ): FormData => {
40
43
  const bodyFormData = new FormData()
41
44
  bodyFormData.append('first_name', values.firstName)
42
45
  bodyFormData.append('last_name', values.lastName)
@@ -51,6 +54,11 @@ export const createRegisterFormData = (values: IValues = {}): FormData => {
51
54
  'client_secret',
52
55
  ENV.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9'
53
56
  )
57
+
58
+ _forEach(checkoutBody.attributes, (item: any, key: string) => {
59
+ bodyFormData.append(key, item)
60
+ })
61
+
54
62
  return bodyFormData
55
63
  }
56
64
 
@@ -42,15 +42,14 @@ export const CustomField = ({
42
42
  type = 'text',
43
43
  field,
44
44
  selectOptions = [] as ISelectOption[],
45
- form: { touched, errors },
45
+ form: { touched, errors, submitCount },
46
46
  theme,
47
47
  }: ICustomField & IOtherProps) => {
48
48
  const isSelectField = type === 'select'
49
- const isShrink = Boolean(field.value) || type === 'date' || type === 'select'
50
49
  const error = _get(errors, field.name)
51
50
  const isTouched =
52
51
  Boolean(_get(touched, field.name)) ||
53
- (_includes(field.name, 'holder') && !!error)
52
+ (_includes(field.name, 'holder') && !!error && !!submitCount)
54
53
  const classes = useStyles()
55
54
 
56
55
  return (
@@ -62,7 +61,6 @@ export const CustomField = ({
62
61
  fullWidth={true}
63
62
  error={!!error && isTouched}
64
63
  helperText={isTouched && error}
65
- InputLabelProps={{ shrink: isShrink }}
66
64
  InputProps={{
67
65
  classes: {
68
66
  input: classes.input,
@@ -51,7 +51,7 @@ export const SelectField = ({
51
51
 
52
52
  return (
53
53
  <FormControl fullWidth={true}>
54
- <InputLabel htmlFor={field.name} error={!!error && isTouched}>
54
+ <InputLabel htmlFor={field.name} error={!!error && isTouched} shrink={true}>
55
55
  {label}
56
56
  </InputLabel>
57
57
  <Select