2
0

feat(editor): Add default country code phone

This commit is contained in:
Baptiste Arnaud
2022-02-22 16:00:32 +01:00
parent 3ecde23e51
commit 6d455a3861
5 changed files with 255 additions and 5 deletions

View File

@ -13,7 +13,7 @@ import React, {
useEffect,
useRef,
} from 'react'
import PhoneInput, { Value } from 'react-phone-number-input'
import PhoneInput, { Value, Country } from 'react-phone-number-input'
type TextInputProps = {
step:
@ -113,8 +113,9 @@ export const TextInput = ({ step, defaultValue, onChange }: TextInputProps) => {
onChange={handlePhoneNumberChange}
defaultValue={defaultValue}
placeholder={
step.options?.labels?.placeholder ?? 'Your phone number...'
step.options.labels.placeholder ?? 'Your phone number...'
}
defaultCountry={step.options.defaultCountryCode as Country}
/>
)
}