Merged in feat/SW-3076 (pull request #2416)
feat(SW-3076: change phone country code on country select) * feat(SW-3076: change phone country code on country select) Approved-by: Simon.Emanuelsson
This commit is contained in:
@@ -85,6 +85,8 @@ export default function Details() {
|
||||
control,
|
||||
subscribe,
|
||||
formState: { isValid },
|
||||
setValue,
|
||||
watch,
|
||||
} = methods
|
||||
|
||||
useFormTracking("checkout", subscribe, control, ` - room ${roomNr}`)
|
||||
@@ -119,6 +121,14 @@ export default function Details() {
|
||||
}
|
||||
}, [crossValidationData, methods])
|
||||
|
||||
const countryCode = watch("countryCode")
|
||||
|
||||
useEffect(() => {
|
||||
if (countryCode) {
|
||||
setValue("phoneNumberCC", countryCode.toLowerCase())
|
||||
}
|
||||
}, [countryCode, setValue])
|
||||
|
||||
const guestIsGoingToJoin = methods.watch("join")
|
||||
const guestIsMember = methods.watch("membershipNo")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user