From 5dacde2836fcadcbfde24cb23c7bfbf309da7021 Mon Sep 17 00:00:00 2001 From: Uday Sagar Date: Thu, 22 Feb 2024 22:02:47 +0530 Subject: [PATCH] minor fix --- src/Components/Form/FormFields/PhoneNumberFormField.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Components/Form/FormFields/PhoneNumberFormField.tsx b/src/Components/Form/FormFields/PhoneNumberFormField.tsx index 232726d7e22..ffa91614d2d 100644 --- a/src/Components/Form/FormFields/PhoneNumberFormField.tsx +++ b/src/Components/Form/FormFields/PhoneNumberFormField.tsx @@ -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]);