feat: Improved country code in contact form view. (#6801)

* feat: Improved country code in contact.

* chore: Minor fixes

* chore: Minor fixes

* chore: Adds arrow key navigation and cursor pointer

* chore: Minor fix

* chore: Code clean up

* chore: Handle outside click

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>, Nithin David
This commit is contained in:
Sivin Varghese
2023-04-17 20:32:09 +05:30
committed by GitHub
parent 9e2f991484
commit c9ce9e5b8f
8 changed files with 1910 additions and 267 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,8 @@
export const isPhoneE164 = value => !!value.match(/^\+[1-9]\d{1,14}$/);
export const isPhoneNumberValid = (value, dialCode) => {
const number = value.replace(dialCode, '');
return !!number.match(/^[0-9]{1,14}$/);
};
export const isPhoneE164OrEmpty = value => isPhoneE164(value) || value === '';
export const shouldBeUrl = (value = '') =>
value ? value.startsWith('http') : true;