tf-checkout-react 1.3.29 → 1.3.31

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.29",
2
+ "version": "1.3.31",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -319,7 +319,8 @@ export const BillingInfoContainer = React.memo(
319
319
  getQueryVariable('collect_optional_wallet_address') === 'true'
320
320
  const flagFreeTicket = getQueryVariable('free_ticket') === 'true'
321
321
  const hidePhoneField = getQueryVariable('hide_phone_field') === 'true'
322
- const hideWalletAddressField = !collectOptionalWalletAddress && !collectMandatoryWalletAddress
322
+ const hideWalletAddressField =
323
+ !collectOptionalWalletAddress && !collectMandatoryWalletAddress
323
324
 
324
325
  // Get prevProps
325
326
  const prevData = useRef(data)
@@ -443,7 +444,11 @@ export const BillingInfoContainer = React.memo(
443
444
  addAddOnsInAttributes(checkoutBody)
444
445
  }
445
446
 
446
- const res = await postOnCheckout(checkoutBody, access_token, flagFreeTicket)
447
+ const res = await postOnCheckout(
448
+ checkoutBody,
449
+ access_token,
450
+ flagFreeTicket
451
+ )
447
452
  removeReferralKey()
448
453
  onSkipBillingPage(_get(res, 'data.data.attributes'))
449
454
  setLoading(false)
@@ -525,11 +530,11 @@ export const BillingInfoContainer = React.memo(
525
530
  initialValues={getInitialValues(
526
531
  dataWithUniqueIds,
527
532
  {
528
- ...initialValues,
529
533
  country: _get(userData, 'country', '') || '1',
530
534
  state: _get(userData, 'state', '') || '1',
531
535
  brand_opt_in: optedInFieldValue,
532
536
  ttf_opt_in: ttfOptIn,
537
+ ...initialValues,
533
538
  },
534
539
  userValues
535
540
  )}
@@ -543,7 +548,11 @@ export const BillingInfoContainer = React.memo(
543
548
  addAddOnsInAttributes(checkoutBody)
544
549
  }
545
550
 
546
- const res = await postOnCheckout(checkoutBody, access_token, flagFreeTicket)
551
+ const res = await postOnCheckout(
552
+ checkoutBody,
553
+ access_token,
554
+ flagFreeTicket
555
+ )
547
556
  removeReferralKey()
548
557
  // After checkout is successful recover updated profile and store it on local storage if needed
549
558
  if (isWindowDefined) {
@@ -576,7 +585,7 @@ export const BillingInfoContainer = React.memo(
576
585
  const bodyFormData = createRegisterFormData(
577
586
  values,
578
587
  checkoutBodyForRegistration,
579
- flagFreeTicket,
588
+ flagFreeTicket
580
589
  )
581
590
  try {
582
591
  setLoading(true)
@@ -649,7 +658,11 @@ export const BillingInfoContainer = React.memo(
649
658
  addAddOnsInAttributes(checkoutBody)
650
659
  }
651
660
 
652
- const res = await postOnCheckout(checkoutBody, undefined, flagFreeTicket)
661
+ const res = await postOnCheckout(
662
+ checkoutBody,
663
+ undefined,
664
+ flagFreeTicket
665
+ )
653
666
  removeReferralKey()
654
667
  handleSubmit(
655
668
  values,
@@ -796,7 +809,10 @@ export const BillingInfoContainer = React.memo(
796
809
  return false
797
810
  }
798
811
  }
799
- if (hideWalletAddressField && el.name === 'wallet-address-info') {
812
+ if (
813
+ hideWalletAddressField &&
814
+ el.name === 'wallet-address-info'
815
+ ) {
800
816
  return false
801
817
  }
802
818
  return true
@@ -875,6 +891,15 @@ export const BillingInfoContainer = React.memo(
875
891
  disableDropdown={
876
892
  element.disableDropdown
877
893
  }
894
+ defaultCountry={
895
+ element.defaultCountry
896
+ }
897
+ dateFormat={
898
+ element.format
899
+ }
900
+ datePlaceholder={
901
+ element.placeholder
902
+ }
878
903
  />
879
904
  )}
880
905
  </div>
@@ -946,6 +971,7 @@ export const BillingInfoContainer = React.memo(
946
971
  setPhoneValidationIsLoading={
947
972
  setPhoneValidationIsLoading
948
973
  }
974
+ defaultCountry={element.defaultCountry}
949
975
  />
950
976
  </div>
951
977
  )
@@ -70,6 +70,8 @@ export const DatePickerField = ({
70
70
  form,
71
71
  theme,
72
72
  useCompact = true,
73
+ dateFormat = 'DD/MM/YYYY',
74
+ datePlaceholder = 'dd/mm/yyyy'
73
75
  }: IDatePickerFieldProps & IOtherProps) => (
74
76
  <ThemeProvider theme={useCompact ? compactStyleTheme : {}}>
75
77
  <LocalizationProvider dateAdapter={AdapterMoment}>
@@ -81,12 +83,12 @@ export const DatePickerField = ({
81
83
  }}
82
84
  showDaysOutsideCurrentMonth={true}
83
85
  disableFuture={true}
84
- inputFormat="DD/MM/YYYY"
86
+ inputFormat={dateFormat}
85
87
  mask="__/__/____"
86
88
  renderInput={(params: any) => (
87
89
  <CustomField
88
90
  {...params}
89
- inputProps={{ ...params.inputProps, placeholder: 'dd/mm/yyyy' }}
91
+ inputProps={{ ...params.inputProps, placeholder: datePlaceholder }}
90
92
  theme={theme}
91
93
  field={{
92
94
  ...field, onChange: (evt: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>) => {
@@ -14,6 +14,7 @@ export interface IPhoneNumberField {
14
14
  // optional
15
15
  type: string;
16
16
  disableDropdown: boolean;
17
+ defaultCountry?: string;
17
18
  fill: boolean;
18
19
  setPhoneValidationIsLoading: (isLoading: boolean) => void;
19
20
  }
@@ -32,6 +33,7 @@ export const PhoneNumberField = ({
32
33
  setErrors,
33
34
  },
34
35
  disableDropdown = true,
36
+ defaultCountry = 'us',
35
37
  fill = false,
36
38
  setPhoneValidationIsLoading,
37
39
  }: IPhoneNumberField) => {
@@ -96,7 +98,7 @@ export const PhoneNumberField = ({
96
98
  }
97
99
  }}
98
100
  variant="outlined"
99
- defaultCountry="us"
101
+ defaultCountry={defaultCountry}
100
102
  disableDropdown={disableDropdown}
101
103
  label={label}
102
104
  error={!!error && (isTouched || fill)}