Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
UdaySagar-Git committed Feb 22, 2024
1 parent 0c2d101 commit 5dacde2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Components/Form/FormFields/PhoneNumberFormField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ export default function PhoneNumberFormField(props: Props) {

useEffect(() => {
if (field.value && field.value.length > 0) {
if (field.value.startsWith("1800")) {
setCountry({ flag: "📞", name: "Support", code: "1800" });
return;
}
if (field.value === "+") {
setCountry({ flag: "🌍", name: "Other", code: "+" });
return;
}
setCountry(phoneCodes[getCountryCode(field.value)!]);
}
}, [setValue]);
Expand Down

0 comments on commit 5dacde2

Please sign in to comment.