+
{{ $t('CONTACT_FORM.FORM.PHONE_NUMBER.LABEL') }}
-
-
- {{ $t('CONTACT_FORM.FORM.PHONE_NUMBER.ERROR') }}
+
+ {{ phoneNumberError }}
{{ $t('CONTACT_FORM.FORM.PHONE_NUMBER.HELP') }}
@@ -145,8 +152,8 @@ import {
} from 'shared/helpers/CustomErrors';
import { required, email } from 'vuelidate/lib/validators';
import countries from 'shared/constants/countries.js';
-
-import { isPhoneE164OrEmpty } from 'shared/helpers/Validators';
+import { isPhoneNumberValid } from 'shared/helpers/Validators';
+import parsePhoneNumber from 'libphonenumber-js';
export default {
mixins: [alertMixin],
@@ -172,6 +179,7 @@ export default {
email: '',
name: '',
phoneNumber: '',
+ activeDialCode: '',
avatarFile: null,
avatarUrl: '',
country: {
@@ -202,11 +210,43 @@ export default {
email,
},
companyName: {},
- phoneNumber: {
- isPhoneE164OrEmpty,
- },
+ phoneNumber: {},
bio: {},
},
+ computed: {
+ parsePhoneNumber() {
+ return parsePhoneNumber(this.phoneNumber);
+ },
+ isPhoneNumberNotValid() {
+ if (this.phoneNumber !== '') {
+ return (
+ !isPhoneNumberValid(this.phoneNumber, this.activeDialCode) ||
+ (this.phoneNumber !== '' ? this.activeDialCode === '' : false)
+ );
+ }
+ return false;
+ },
+ phoneNumberError() {
+ if (this.activeDialCode === '') {
+ return this.$t('CONTACT_FORM.FORM.PHONE_NUMBER.DIAL_CODE_ERROR');
+ }
+ if (!isPhoneNumberValid(this.phoneNumber, this.activeDialCode)) {
+ return this.$t('CONTACT_FORM.FORM.PHONE_NUMBER.ERROR');
+ }
+ return '';
+ },
+ setPhoneNumber() {
+ if (this.parsePhoneNumber && this.parsePhoneNumber.countryCallingCode) {
+ return this.phoneNumber;
+ }
+ if (this.phoneNumber === '' && this.activeDialCode !== '') {
+ return '';
+ }
+ return this.activeDialCode
+ ? `${this.activeDialCode}${this.phoneNumber}`
+ : '';
+ },
+ },
watch: {
contact() {
this.setContactObject();
@@ -214,6 +254,7 @@ export default {
},
mounted() {
this.setContactObject();
+ this.setDialCode();
},
methods: {
onCancel() {
@@ -227,6 +268,16 @@ export default {
if (!name && !id) return '';
return `${name} (${id})`;
},
+ setDialCode() {
+ if (
+ this.phoneNumber !== '' &&
+ this.parsePhoneNumber &&
+ this.parsePhoneNumber.countryCallingCode
+ ) {
+ const dialCode = this.parsePhoneNumber.countryCallingCode;
+ this.activeDialCode = `+${dialCode}`;
+ }
+ },
setContactObject() {
const {
email: emailAddress,
@@ -271,7 +322,7 @@ export default {
id: this.contact.id,
name: this.name,
email: this.email,
- phone_number: this.phoneNumber,
+ phone_number: this.setPhoneNumber,
additional_attributes: {
...this.contact.additional_attributes,
description: this.description,
@@ -292,10 +343,28 @@ export default {
}
return contactObject;
},
+ onPhoneNumberInputChange(value, code) {
+ this.activeDialCode = code;
+ },
+ setPhoneCode(code) {
+ if (this.phoneNumber !== '' && this.parsePhoneNumber) {
+ const dialCode = this.parsePhoneNumber.countryCallingCode;
+ if (dialCode === code) {
+ return;
+ }
+ this.activeDialCode = `+${dialCode}`;
+ const newPhoneNumber = this.phoneNumber.replace(
+ `+${dialCode}`,
+ `${code}`
+ );
+ this.phoneNumber = newPhoneNumber;
+ } else {
+ this.activeDialCode = code;
+ }
+ },
async handleSubmit() {
this.$v.$touch();
-
- if (this.$v.$invalid) {
+ if (this.$v.$invalid || this.isPhoneNumberNotValid) {
return;
}
try {
@@ -332,6 +401,7 @@ export default {
}
this.avatarFile = null;
this.avatarUrl = '';
+ this.activeDialCode = '';
} catch (error) {
this.showAlert(
error.message
diff --git a/app/javascript/shared/constants/countries.js b/app/javascript/shared/constants/countries.js
index fd2deffd2..d01d3f23a 100644
--- a/app/javascript/shared/constants/countries.js
+++ b/app/javascript/shared/constants/countries.js
@@ -1,257 +1,1456 @@
const countries = [
- { name: 'Afghanistan', id: 'AF' },
- { name: 'ร
land Islands', id: 'AX' },
- { name: 'Albania', id: 'AL' },
- { name: 'Algeria', id: 'DZ' },
- { name: 'American Samoa', id: 'AS' },
- { name: 'Andorra', id: 'AD' },
- { name: 'Angola', id: 'AO' },
- { name: 'Anguilla', id: 'AI' },
- { name: 'Antarctica', id: 'AQ' },
- { name: 'Antigua and Barbuda', id: 'AG' },
- { name: 'Argentina', id: 'AR' },
- { name: 'Armenia', id: 'AM' },
- { name: 'Aruba', id: 'AW' },
- { name: 'Australia', id: 'AU' },
- { name: 'Austria', id: 'AT' },
- { name: 'Azerbaijan', id: 'AZ' },
- { name: 'Bahamas', id: 'BS' },
- { name: 'Bahrain', id: 'BH' },
- { name: 'Bangladesh', id: 'BD' },
- { name: 'Barbados', id: 'BB' },
- { name: 'Belarus', id: 'BY' },
- { name: 'Belgium', id: 'BE' },
- { name: 'Belize', id: 'BZ' },
- { name: 'Benin', id: 'BJ' },
- { name: 'Bermuda', id: 'BM' },
- { name: 'Bhutan', id: 'BT' },
- { name: 'Bolivia (Plurinational State of)', id: 'BO' },
- { name: 'Bonaire, Sint Eustatius and Saba', id: 'BQ' },
- { name: 'Bosnia and Herzegovina', id: 'BA' },
- { name: 'Botswana', id: 'BW' },
- { name: 'Bouvet Island', id: 'BV' },
- { name: 'Brazil', id: 'BR' },
- { name: 'British Indian Ocean Territory', id: 'IO' },
- { name: 'United States Minor Outlying Islands', id: 'UM' },
- { name: 'Virgin Islands (British)', id: 'VG' },
- { name: 'Virgin Islands (U.S.)', id: 'VI' },
- { name: 'Brunei Darussalam', id: 'BN' },
- { name: 'Bulgaria', id: 'BG' },
- { name: 'Burkina Faso', id: 'BF' },
- { name: 'Burundi', id: 'BI' },
- { name: 'Cambodia', id: 'KH' },
- { name: 'Cameroon', id: 'CM' },
- { name: 'Canada', id: 'CA' },
- { name: 'Cabo Verde', id: 'CV' },
- { name: 'Cayman Islands', id: 'KY' },
- { name: 'Central African Republic', id: 'CF' },
- { name: 'Chad', id: 'TD' },
- { name: 'Chile', id: 'CL' },
- { name: 'China', id: 'CN' },
- { name: 'Christmas Island', id: 'CX' },
- { name: 'Cocos (Keeling) Islands', id: 'CC' },
- { name: 'Colombia', id: 'CO' },
- { name: 'Comoros', id: 'KM' },
- { name: 'Congo', id: 'CG' },
- { name: 'Congo (Democratic Republic of the)', id: 'CD' },
- { name: 'Cook Islands', id: 'CK' },
- { name: 'Costa Rica', id: 'CR' },
- { name: 'Croatia', id: 'HR' },
- { name: 'Cuba', id: 'CU' },
- { name: 'Curaรงao', id: 'CW' },
- { name: 'Cyprus', id: 'CY' },
- { name: 'Czech Republic', id: 'CZ' },
- { name: 'Denmark', id: 'DK' },
- { name: 'Djibouti', id: 'DJ' },
- { name: 'Dominica', id: 'DM' },
- { name: 'Dominican Republic', id: 'DO' },
- { name: 'Ecuador', id: 'EC' },
- { name: 'Egypt', id: 'EG' },
- { name: 'El Salvador', id: 'SV' },
- { name: 'Equatorial Guinea', id: 'GQ' },
- { name: 'Eritrea', id: 'ER' },
- { name: 'Estonia', id: 'EE' },
- { name: 'Ethiopia', id: 'ET' },
- { name: 'Falkland Islands (Malvinas)', id: 'FK' },
- { name: 'Faroe Islands', id: 'FO' },
- { name: 'Fiji', id: 'FJ' },
- { name: 'Finland', id: 'FI' },
- { name: 'France', id: 'FR' },
- { name: 'French Guiana', id: 'GF' },
- { name: 'French Polynesia', id: 'PF' },
- { name: 'French Southern Territories', id: 'TF' },
- { name: 'Gabon', id: 'GA' },
- { name: 'Gambia', id: 'GM' },
- { name: 'Georgia', id: 'GE' },
- { name: 'Germany', id: 'DE' },
- { name: 'Ghana', id: 'GH' },
- { name: 'Gibraltar', id: 'GI' },
- { name: 'Greece', id: 'GR' },
- { name: 'Greenland', id: 'GL' },
- { name: 'Grenada', id: 'GD' },
- { name: 'Guadeloupe', id: 'GP' },
- { name: 'Guam', id: 'GU' },
- { name: 'Guatemala', id: 'GT' },
- { name: 'Guernsey', id: 'GG' },
- { name: 'Guinea', id: 'GN' },
- { name: 'Guinea-Bissau', id: 'GW' },
- { name: 'Guyana', id: 'GY' },
- { name: 'Haiti', id: 'HT' },
- { name: 'Heard Island and McDonald Islands', id: 'HM' },
- { name: 'Vatican City', id: 'VA' },
- { name: 'Honduras', id: 'HN' },
- { name: 'Hungary', id: 'HU' },
- { name: 'Hong Kong', id: 'HK' },
- { name: 'Iceland', id: 'IS' },
- { name: 'India', id: 'IN' },
- { name: 'Indonesia', id: 'ID' },
- { name: 'Ivory Coast', id: 'CI' },
- { name: 'Iran (Islamic Republic of)', id: 'IR' },
- { name: 'Iraq', id: 'IQ' },
- { name: 'Ireland', id: 'IE' },
- { name: 'Isle of Man', id: 'IM' },
- { name: 'Israel', id: 'IL' },
- { name: 'Italy', id: 'IT' },
- { name: 'Jamaica', id: 'JM' },
- { name: 'Japan', id: 'JP' },
- { name: 'Jersey', id: 'JE' },
- { name: 'Jordan', id: 'JO' },
- { name: 'Kazakhstan', id: 'KZ' },
- { name: 'Kenya', id: 'KE' },
- { name: 'Kiribati', id: 'KI' },
- { name: 'Kuwait', id: 'KW' },
- { name: 'Kyrgyzstan', id: 'KG' },
- { name: "Lao People's Democratic Republic", id: 'LA' },
- { name: 'Latvia', id: 'LV' },
- { name: 'Lebanon', id: 'LB' },
- { name: 'Lesotho', id: 'LS' },
- { name: 'Liberia', id: 'LR' },
- { name: 'Libya', id: 'LY' },
- { name: 'Liechtenstein', id: 'LI' },
- { name: 'Lithuania', id: 'LT' },
- { name: 'Luxembourg', id: 'LU' },
- { name: 'Macao', id: 'MO' },
- { name: 'North Macedonia', id: 'MK' },
- { name: 'Madagascar', id: 'MG' },
- { name: 'Malawi', id: 'MW' },
- { name: 'Malaysia', id: 'MY' },
- { name: 'Maldives', id: 'MV' },
- { name: 'Mali', id: 'ML' },
- { name: 'Malta', id: 'MT' },
- { name: 'Marshall Islands', id: 'MH' },
- { name: 'Martinique', id: 'MQ' },
- { name: 'Mauritania', id: 'MR' },
- { name: 'Mauritius', id: 'MU' },
- { name: 'Mayotte', id: 'YT' },
- { name: 'Mexico', id: 'MX' },
- { name: 'Micronesia (Federated States of)', id: 'FM' },
- { name: 'Moldova (Republic of)', id: 'MD' },
- { name: 'Monaco', id: 'MC' },
- { name: 'Mongolia', id: 'MN' },
- { name: 'Montenegro', id: 'ME' },
- { name: 'Montserrat', id: 'MS' },
- { name: 'Morocco', id: 'MA' },
- { name: 'Mozambique', id: 'MZ' },
- { name: 'Myanmar', id: 'MM' },
- { name: 'Namibia', id: 'NA' },
- { name: 'Nauru', id: 'NR' },
- { name: 'Nepal', id: 'NP' },
- { name: 'Netherlands', id: 'NL' },
- { name: 'New Caledonia', id: 'NC' },
- { name: 'New Zealand', id: 'NZ' },
- { name: 'Nicaragua', id: 'NI' },
- { name: 'Niger', id: 'NE' },
- { name: 'Nigeria', id: 'NG' },
- { name: 'Niue', id: 'NU' },
- { name: 'Norfolk Island', id: 'NF' },
- { name: "Korea (Democratic People's Republic of)", id: 'KP' },
- { name: 'Northern Mariana Islands', id: 'MP' },
- { name: 'Norway', id: 'NO' },
- { name: 'Oman', id: 'OM' },
- { name: 'Pakistan', id: 'PK' },
- { name: 'Palau', id: 'PW' },
- { name: 'Palestine, State of', id: 'PS' },
- { name: 'Panama', id: 'PA' },
- { name: 'Papua New Guinea', id: 'PG' },
- { name: 'Paraguay', id: 'PY' },
- { name: 'Peru', id: 'PE' },
- { name: 'Philippines', id: 'PH' },
- { name: 'Pitcairn', id: 'PN' },
- { name: 'Poland', id: 'PL' },
- { name: 'Portugal', id: 'PT' },
- { name: 'Puerto Rico', id: 'PR' },
- { name: 'Qatar', id: 'QA' },
- { name: 'Republic of Kosovo', id: 'XK' },
- { name: 'Rรฉunion', id: 'RE' },
- { name: 'Romania', id: 'RO' },
- { name: 'Russian Federation', id: 'RU' },
- { name: 'Rwanda', id: 'RW' },
- { name: 'Saint Barthรฉlemy', id: 'BL' },
- { name: 'Saint Helena, Ascension and Tristan da Cunha', id: 'SH' },
- { name: 'Saint Kitts and Nevis', id: 'KN' },
- { name: 'Saint Lucia', id: 'LC' },
- { name: 'Saint Martin (French part)', id: 'MF' },
- { name: 'Saint Pierre and Miquelon', id: 'PM' },
- { name: 'Saint Vincent and the Grenadines', id: 'VC' },
- { name: 'Samoa', id: 'WS' },
- { name: 'San Marino', id: 'SM' },
- { name: 'Sao Tome and Principe', id: 'ST' },
- { name: 'Saudi Arabia', id: 'SA' },
- { name: 'Senegal', id: 'SN' },
- { name: 'Serbia', id: 'RS' },
- { name: 'Seychelles', id: 'SC' },
- { name: 'Sierra Leone', id: 'SL' },
- { name: 'Singapore', id: 'SG' },
- { name: 'Sint Maarten (Dutch part)', id: 'SX' },
- { name: 'Slovakia', id: 'SK' },
- { name: 'Slovenia', id: 'SI' },
- { name: 'Solomon Islands', id: 'SB' },
- { name: 'Somalia', id: 'SO' },
- { name: 'South Africa', id: 'ZA' },
- { name: 'South Georgia and the South Sandwich Islands', id: 'GS' },
- { name: 'Korea (Republic of)', id: 'KR' },
- { name: 'Spain', id: 'ES' },
- { name: 'Sri Lanka', id: 'LK' },
- { name: 'Sudan', id: 'SD' },
- { name: 'South Sudan', id: 'SS' },
- { name: 'Suriname', id: 'SR' },
- { name: 'Svalbard and Jan Mayen', id: 'SJ' },
- { name: 'Swaziland', id: 'SZ' },
- { name: 'Sweden', id: 'SE' },
- { name: 'Switzerland', id: 'CH' },
- { name: 'Syrian Arab Republic', id: 'SY' },
- { name: 'Taiwan', id: 'TW' },
- { name: 'Tajikistan', id: 'TJ' },
- { name: 'Tanzania, United Republic of', id: 'TZ' },
- { name: 'Thailand', id: 'TH' },
- { name: 'Timor-Leste', id: 'TL' },
- { name: 'Togo', id: 'TG' },
- { name: 'Tokelau', id: 'TK' },
- { name: 'Tonga', id: 'TO' },
- { name: 'Trinidad and Tobago', id: 'TT' },
- { name: 'Tunisia', id: 'TN' },
- { name: 'Turkey', id: 'TR' },
- { name: 'Turkmenistan', id: 'TM' },
- { name: 'Turks and Caicos Islands', id: 'TC' },
- { name: 'Tuvalu', id: 'TV' },
- { name: 'Uganda', id: 'UG' },
- { name: 'Ukraine', id: 'UA' },
- { name: 'United Arab Emirates', id: 'AE' },
{
- name: 'United Kingdom of Great Britain and Northern Ireland',
+ name: 'Afghanistan',
+ dial_code: '+93',
+ emoji: '๐ฆ๐ซ',
+ id: 'AF',
+ },
+ {
+ name: 'Aland Islands',
+ dial_code: '+358',
+ emoji: '๐ฆ๐ฝ',
+ id: 'AX',
+ },
+ {
+ name: 'Albania',
+ dial_code: '+355',
+ emoji: '๐ฆ๐ฑ',
+ id: 'AL',
+ },
+ {
+ name: 'Algeria',
+ dial_code: '+213',
+ emoji: '๐ฉ๐ฟ',
+ id: 'DZ',
+ },
+ {
+ name: 'AmericanSamoa',
+ dial_code: '+1684',
+ emoji: '๐ฆ๐ธ',
+ id: 'AS',
+ },
+ {
+ name: 'Andorra',
+ dial_code: '+376',
+ emoji: '๐ฆ๐ฉ',
+ id: 'AD',
+ },
+ {
+ name: 'Angola',
+ dial_code: '+244',
+ emoji: '๐ฆ๐ด',
+ id: 'AO',
+ },
+ {
+ name: 'Anguilla',
+ dial_code: '+1264',
+ emoji: '๐ฆ๐ฎ',
+ id: 'AI',
+ },
+ {
+ name: 'Antarctica',
+ dial_code: '+672',
+ emoji: '๐ฆ๐ถ',
+ id: 'AQ',
+ },
+ {
+ name: 'Antigua and Barbuda',
+ dial_code: '+1268',
+ emoji: '๐ฆ๐ฌ',
+ id: 'AG',
+ },
+ {
+ name: 'Argentina',
+ dial_code: '+54',
+ emoji: '๐ฆ๐ท',
+ id: 'AR',
+ },
+ {
+ name: 'Armenia',
+ dial_code: '+374',
+ emoji: '๐ฆ๐ฒ',
+ id: 'AM',
+ },
+ {
+ name: 'Aruba',
+ dial_code: '+297',
+ emoji: '๐ฆ๐ผ',
+ id: 'AW',
+ },
+ {
+ name: 'Australia',
+ dial_code: '+61',
+ emoji: '๐ฆ๐บ',
+ id: 'AU',
+ },
+ {
+ name: 'Austria',
+ dial_code: '+43',
+ emoji: '๐ฆ๐น',
+ id: 'AT',
+ },
+ {
+ name: 'Azerbaijan',
+ dial_code: '+994',
+ emoji: '๐ฆ๐ฟ',
+ id: 'AZ',
+ },
+ {
+ name: 'Bahamas',
+ dial_code: '+1242',
+ emoji: '๐ง๐ธ',
+ id: 'BS',
+ },
+ {
+ name: 'Bahrain',
+ dial_code: '+973',
+ emoji: '๐ง๐ญ',
+ id: 'BH',
+ },
+ {
+ name: 'Bangladesh',
+ dial_code: '+880',
+ emoji: '๐ง๐ฉ',
+ id: 'BD',
+ },
+ {
+ name: 'Barbados',
+ dial_code: '+1246',
+ emoji: '๐ง๐ง',
+ id: 'BB',
+ },
+ {
+ name: 'Belarus',
+ dial_code: '+375',
+ emoji: '๐ง๐พ',
+ id: 'BY',
+ },
+ {
+ name: 'Belgium',
+ dial_code: '+32',
+ emoji: '๐ง๐ช',
+ id: 'BE',
+ },
+ {
+ name: 'Belize',
+ dial_code: '+501',
+ emoji: '๐ง๐ฟ',
+ id: 'BZ',
+ },
+ {
+ name: 'Benin',
+ dial_code: '+229',
+ emoji: '๐ง๐ฏ',
+ id: 'BJ',
+ },
+ {
+ name: 'Bermuda',
+ dial_code: '+1441',
+ emoji: '๐ง๐ฒ',
+ id: 'BM',
+ },
+ {
+ name: 'Bhutan',
+ dial_code: '+975',
+ emoji: '๐ง๐น',
+ id: 'BT',
+ },
+ {
+ name: 'Bolivia, Plurinational State of',
+ dial_code: '+591',
+ emoji: '๐ง๐ด',
+ id: 'BO',
+ },
+ {
+ name: 'Bosnia and Herzegovina',
+ dial_code: '+387',
+ emoji: '๐ง๐ฆ',
+ id: 'BA',
+ },
+ {
+ name: 'Botswana',
+ dial_code: '+267',
+ emoji: '๐ง๐ผ',
+ id: 'BW',
+ },
+ {
+ name: 'Brazil',
+ dial_code: '+55',
+ emoji: '๐ง๐ท',
+ id: 'BR',
+ },
+ {
+ name: 'British Indian Ocean Territory',
+ dial_code: '+246',
+ emoji: '๐ฎ๐ด',
+ id: 'IO',
+ },
+ {
+ name: 'Brunei Darussalam',
+ dial_code: '+673',
+ emoji: '๐ง๐ณ',
+ id: 'BN',
+ },
+ {
+ name: 'Bulgaria',
+ dial_code: '+359',
+ emoji: '๐ง๐ฌ',
+ id: 'BG',
+ },
+ {
+ name: 'Burkina Faso',
+ dial_code: '+226',
+ emoji: '๐ง๐ซ',
+ id: 'BF',
+ },
+ {
+ name: 'Burundi',
+ dial_code: '+257',
+ emoji: '๐ง๐ฎ',
+ id: 'BI',
+ },
+ {
+ name: 'Cambodia',
+ dial_code: '+855',
+ emoji: '๐ฐ๐ญ',
+ id: 'KH',
+ },
+ {
+ name: 'Cameroon',
+ dial_code: '+237',
+ emoji: '๐จ๐ฒ',
+ id: 'CM',
+ },
+ {
+ name: 'Canada',
+ dial_code: '+1',
+ emoji: '๐จ๐ฆ',
+ id: 'CA',
+ },
+ {
+ name: 'Cape Verde',
+ dial_code: '+238',
+ emoji: '๐จ๐ป',
+ id: 'CV',
+ },
+ {
+ name: 'Cayman Islands',
+ dial_code: '+345',
+ emoji: '๐ฐ๐พ',
+ id: 'KY',
+ },
+ {
+ name: 'Central African Republic',
+ dial_code: '+236',
+ emoji: '๐จ๐ซ',
+ id: 'CF',
+ },
+ {
+ name: 'Chad',
+ dial_code: '+235',
+ emoji: '๐น๐ฉ',
+ id: 'TD',
+ },
+ {
+ name: 'Chile',
+ dial_code: '+56',
+ emoji: '๐จ๐ฑ',
+ id: 'CL',
+ },
+ {
+ name: 'China',
+ dial_code: '+86',
+ emoji: '๐จ๐ณ',
+ id: 'CN',
+ },
+ {
+ name: 'Christmas Island',
+ dial_code: '+61',
+ emoji: '๐จ๐ฝ',
+ id: 'CX',
+ },
+ {
+ name: 'Cocos (Keeling) Islands',
+ dial_code: '+61',
+ emoji: '๐จ๐จ',
+ id: 'CC',
+ },
+ {
+ name: 'Colombia',
+ dial_code: '+57',
+ emoji: '๐จ๐ด',
+ id: 'CO',
+ },
+ {
+ name: 'Comoros',
+ dial_code: '+269',
+ emoji: '๐ฐ๐ฒ',
+ id: 'KM',
+ },
+ {
+ name: 'Congo',
+ dial_code: '+242',
+ emoji: '๐จ๐ฌ',
+ id: 'CG',
+ },
+ {
+ name: 'Congo, The Democratic Republic of the Congo',
+ dial_code: '+243',
+ emoji: '๐จ๐ฉ',
+ id: 'CD',
+ },
+ {
+ name: 'Cook Islands',
+ dial_code: '+682',
+ emoji: '๐จ๐ฐ',
+ id: 'CK',
+ },
+ {
+ name: 'Costa Rica',
+ dial_code: '+506',
+ emoji: '๐จ๐ท',
+ id: 'CR',
+ },
+ {
+ name: "Cote d'Ivoire",
+ dial_code: '+225',
+ emoji: '๐จ๐ฎ',
+ id: 'CI',
+ },
+ {
+ name: 'Croatia',
+ dial_code: '+385',
+ emoji: '๐ญ๐ท',
+ id: 'HR',
+ },
+ {
+ name: 'Cuba',
+ dial_code: '+53',
+ emoji: '๐จ๐บ',
+ id: 'CU',
+ },
+ {
+ name: 'Cyprus',
+ dial_code: '+357',
+ emoji: '๐จ๐พ',
+ id: 'CY',
+ },
+ {
+ name: 'Czech Republic',
+ dial_code: '+420',
+ emoji: '๐จ๐ฟ',
+ id: 'CZ',
+ },
+ {
+ name: 'Denmark',
+ dial_code: '+45',
+ emoji: '๐ฉ๐ฐ',
+ id: 'DK',
+ },
+ {
+ name: 'Djibouti',
+ dial_code: '+253',
+ emoji: '๐ฉ๐ฏ',
+ id: 'DJ',
+ },
+ {
+ name: 'Dominica',
+ dial_code: '+1767',
+ emoji: '๐ฉ๐ฒ',
+ id: 'DM',
+ },
+ {
+ name: 'Dominican Republic',
+ dial_code: '+1849',
+ emoji: '๐ฉ๐ด',
+ id: 'DO',
+ },
+ {
+ name: 'Ecuador',
+ dial_code: '+593',
+ emoji: '๐ช๐จ',
+ id: 'EC',
+ },
+ {
+ name: 'Egypt',
+ dial_code: '+20',
+ emoji: '๐ช๐ฌ',
+ id: 'EG',
+ },
+ {
+ name: 'El Salvador',
+ dial_code: '+503',
+ emoji: '๐ธ๐ป',
+ id: 'SV',
+ },
+ {
+ name: 'Equatorial Guinea',
+ dial_code: '+240',
+ emoji: '๐ฌ๐ถ',
+ id: 'GQ',
+ },
+ {
+ name: 'Eritrea',
+ dial_code: '+291',
+ emoji: '๐ช๐ท',
+ id: 'ER',
+ },
+ {
+ name: 'Estonia',
+ dial_code: '+372',
+ emoji: '๐ช๐ช',
+ id: 'EE',
+ },
+ {
+ name: 'Ethiopia',
+ dial_code: '+251',
+ emoji: '๐ช๐น',
+ id: 'ET',
+ },
+ {
+ name: 'Falkland Islands (Malvinas)',
+ dial_code: '+500',
+ emoji: '๐ซ๐ฐ',
+ id: 'FK',
+ },
+ {
+ name: 'Faroe Islands',
+ dial_code: '+298',
+ emoji: '๐ซ๐ด',
+ id: 'FO',
+ },
+ {
+ name: 'Fiji',
+ dial_code: '+679',
+ emoji: '๐ซ๐ฏ',
+ id: 'FJ',
+ },
+ {
+ name: 'Finland',
+ dial_code: '+358',
+ emoji: '๐ซ๐ฎ',
+ id: 'FI',
+ },
+ {
+ name: 'France',
+ dial_code: '+33',
+ emoji: '๐ซ๐ท',
+ id: 'FR',
+ },
+ {
+ name: 'French Guiana',
+ dial_code: '+594',
+ emoji: '๐ฌ๐ซ',
+ id: 'GF',
+ },
+ {
+ name: 'French Polynesia',
+ dial_code: '+689',
+ emoji: '๐ต๐ซ',
+ id: 'PF',
+ },
+ {
+ name: 'Gabon',
+ dial_code: '+241',
+ emoji: '๐ฌ๐ฆ',
+ id: 'GA',
+ },
+ {
+ name: 'Gambia',
+ dial_code: '+220',
+ emoji: '๐ฌ๐ฒ',
+ id: 'GM',
+ },
+ {
+ name: 'Georgia',
+ dial_code: '+995',
+ emoji: '๐ฌ๐ช',
+ id: 'GE',
+ },
+ {
+ name: 'Germany',
+ dial_code: '+49',
+ emoji: '๐ฉ๐ช',
+ id: 'DE',
+ },
+ {
+ name: 'Ghana',
+ dial_code: '+233',
+ emoji: '๐ฌ๐ญ',
+ id: 'GH',
+ },
+ {
+ name: 'Gibraltar',
+ dial_code: '+350',
+ emoji: '๐ฌ๐ฎ',
+ id: 'GI',
+ },
+ {
+ name: 'Greece',
+ dial_code: '+30',
+ emoji: '๐ฌ๐ท',
+ id: 'GR',
+ },
+ {
+ name: 'Greenland',
+ dial_code: '+299',
+ emoji: '๐ฌ๐ฑ',
+ id: 'GL',
+ },
+ {
+ name: 'Grenada',
+ dial_code: '+1473',
+ emoji: '๐ฌ๐ฉ',
+ id: 'GD',
+ },
+ {
+ name: 'Guadeloupe',
+ dial_code: '+590',
+ emoji: '๐ฌ๐ต',
+ id: 'GP',
+ },
+ {
+ name: 'Guam',
+ dial_code: '+1671',
+ emoji: '๐ฌ๐บ',
+ id: 'GU',
+ },
+ {
+ name: 'Guatemala',
+ dial_code: '+502',
+ emoji: '๐ฌ๐น',
+ id: 'GT',
+ },
+ {
+ name: 'Guernsey',
+ dial_code: '+44',
+ emoji: '๐ฌ๐ฌ',
+ id: 'GG',
+ },
+ {
+ name: 'Guinea',
+ dial_code: '+224',
+ emoji: '๐ฌ๐ณ',
+ id: 'GN',
+ },
+ {
+ name: 'Guinea-Bissau',
+ dial_code: '+245',
+ emoji: '๐ฌ๐ผ',
+ id: 'GW',
+ },
+ {
+ name: 'Guyana',
+ dial_code: '+595',
+ emoji: '๐ฌ๐พ',
+ id: 'GY',
+ },
+ {
+ name: 'Haiti',
+ dial_code: '+509',
+ emoji: '๐ญ๐น',
+ id: 'HT',
+ },
+ {
+ name: 'Holy See (Vatican City State)',
+ dial_code: '+379',
+ emoji: '๐ป๐ฆ',
+ id: 'VA',
+ },
+ {
+ name: 'Honduras',
+ dial_code: '+504',
+ emoji: '๐ญ๐ณ',
+ id: 'HN',
+ },
+ {
+ name: 'Hong Kong',
+ dial_code: '+852',
+ emoji: '๐ญ๐ฐ',
+ id: 'HK',
+ },
+ {
+ name: 'Hungary',
+ dial_code: '+36',
+ emoji: '๐ญ๐บ',
+ id: 'HU',
+ },
+ {
+ name: 'Iceland',
+ dial_code: '+354',
+ emoji: '๐ฎ๐ธ',
+ id: 'IS',
+ },
+ {
+ name: 'India',
+ dial_code: '+91',
+ emoji: '๐ฎ๐ณ',
+ id: 'IN',
+ },
+ {
+ name: 'Indonesia',
+ dial_code: '+62',
+ emoji: '๐ฎ๐ฉ',
+ id: 'ID',
+ },
+ {
+ name: 'Iran, Islamic Republic of Persian Gulf',
+ dial_code: '+98',
+ emoji: '๐ฎ๐ท',
+ id: 'IR',
+ },
+ {
+ name: 'Iraq',
+ dial_code: '+964',
+ emoji: '๐ฎ๐ท',
+ id: 'IQ',
+ },
+ {
+ name: 'Ireland',
+ dial_code: '+353',
+ emoji: '๐ฎ๐ช',
+ id: 'IE',
+ },
+ {
+ name: 'Isle of Man',
+ dial_code: '+44',
+ emoji: '๐ฎ๐ฒ',
+ id: 'IM',
+ },
+ {
+ name: 'Israel',
+ dial_code: '+972',
+ emoji: '๐ฎ๐ฑ',
+ id: 'IL',
+ },
+ {
+ name: 'Italy',
+ dial_code: '+39',
+ emoji: '๐ฎ๐น',
+ id: 'IT',
+ },
+ {
+ name: 'Jamaica',
+ dial_code: '+1876',
+ emoji: '๐ฏ๐ฒ',
+ id: 'JM',
+ },
+ {
+ name: 'Japan',
+ dial_code: '+81',
+ emoji: '๐ฏ๐ต',
+ id: 'JP',
+ },
+ {
+ name: 'Jersey',
+ dial_code: '+44',
+ emoji: '๐ฏ๐ช',
+ id: 'JE',
+ },
+ {
+ name: 'Jordan',
+ dial_code: '+962',
+ emoji: '๐ฏ๐ด',
+ id: 'JO',
+ },
+ {
+ name: 'Kazakhstan',
+ dial_code: '+77',
+ emoji: '๐ฐ๐ฟ',
+ id: 'KZ',
+ },
+ {
+ name: 'Kenya',
+ dial_code: '+254',
+ emoji: '๐ฐ๐ช',
+ id: 'KE',
+ },
+ {
+ name: 'Kiribati',
+ dial_code: '+686',
+ emoji: '๐ฐ๐ฎ',
+ id: 'KI',
+ },
+ {
+ name: "Korea, Democratic People's Republic of Korea",
+ dial_code: '+850',
+ emoji: '๐ฐ๐ต',
+ id: 'KP',
+ },
+ {
+ name: 'Korea, Republic of South Korea',
+ dial_code: '+82',
+ emoji: '๐ฐ๐ท',
+ id: 'KR',
+ },
+ {
+ name: 'Kuwait',
+ dial_code: '+965',
+ emoji: '๐ฐ๐ผ',
+ id: 'KW',
+ },
+ {
+ name: 'Kyrgyzstan',
+ dial_code: '+996',
+ emoji: '๐ฐ๐ฌ',
+ id: 'KG',
+ },
+ {
+ name: 'Laos',
+ dial_code: '+856',
+ emoji: '๐ฑ๐ฆ',
+ id: 'LA',
+ },
+ {
+ name: 'Latvia',
+ dial_code: '+371',
+ emoji: '๐ฑ๐ป',
+ id: 'LV',
+ },
+ {
+ name: 'Lebanon',
+ dial_code: '+961',
+ emoji: '๐ฑ๐ง',
+ id: 'LB',
+ },
+ {
+ name: 'Lesotho',
+ dial_code: '+266',
+ emoji: '๐ฑ๐ธ',
+ id: 'LS',
+ },
+ {
+ name: 'Liberia',
+ dial_code: '+231',
+ emoji: '๐ฑ๐ท',
+ id: 'LR',
+ },
+ {
+ name: 'Libyan Arab Jamahiriya',
+ dial_code: '+218',
+ emoji: '๐ฑ๐พ',
+ id: 'LY',
+ },
+ {
+ name: 'Liechtenstein',
+ dial_code: '+423',
+ emoji: '๐ฑ๐ฎ',
+ id: 'LI',
+ },
+ {
+ name: 'Lithuania',
+ dial_code: '+370',
+ emoji: '๐ฑ๐น',
+ id: 'LT',
+ },
+ {
+ name: 'Luxembourg',
+ dial_code: '+352',
+ emoji: '๐ฑ๐บ',
+ id: 'LU',
+ },
+ {
+ name: 'Macao',
+ dial_code: '+853',
+ emoji: '๐ฒ๐ด',
+ id: 'MO',
+ },
+ {
+ name: 'Macedonia',
+ dial_code: '+389',
+ emoji: '๐ฒ๐ฐ',
+ id: 'MK',
+ },
+ {
+ name: 'Madagascar',
+ dial_code: '+261',
+ emoji: '๐ฒ๐ฌ',
+ id: 'MG',
+ },
+ {
+ name: 'Malawi',
+ dial_code: '+265',
+ emoji: '๐ฒ๐ผ',
+ id: 'MW',
+ },
+ {
+ name: 'Malaysia',
+ dial_code: '+60',
+ emoji: '๐ฒ๐พ',
+ id: 'MY',
+ },
+ {
+ name: 'Maldives',
+ dial_code: '+960',
+ emoji: '๐ฒ๐ป',
+ id: 'MV',
+ },
+ {
+ name: 'Mali',
+ dial_code: '+223',
+ emoji: '๐ฒ๐ฑ',
+ id: 'ML',
+ },
+ {
+ name: 'Malta',
+ dial_code: '+356',
+ emoji: '๐ฒ๐น',
+ id: 'MT',
+ },
+ {
+ name: 'Marshall Islands',
+ dial_code: '+692',
+ emoji: '๐ฒ๐ญ',
+ id: 'MH',
+ },
+ {
+ name: 'Martinique',
+ dial_code: '+596',
+ emoji: '๐ฒ๐ถ',
+ id: 'MQ',
+ },
+ {
+ name: 'Mauritania',
+ dial_code: '+222',
+ emoji: '๐ฒ๐ท',
+ id: 'MR',
+ },
+ {
+ name: 'Mauritius',
+ dial_code: '+230',
+ emoji: '๐ฒ๐บ',
+ id: 'MU',
+ },
+ {
+ name: 'Mayotte',
+ dial_code: '+262',
+ emoji: '๐พ๐น',
+ id: 'YT',
+ },
+ {
+ name: 'Mexico',
+ dial_code: '+52',
+ emoji: '๐ฒ๐ฝ',
+ id: 'MX',
+ },
+ {
+ name: 'Micronesia, Federated States of Micronesia',
+ dial_code: '+691',
+ emoji: '๐ซ๐ฒ',
+ id: 'FM',
+ },
+ {
+ name: 'Moldova',
+ dial_code: '+373',
+ emoji: '๐ฒ๐ฉ',
+ id: 'MD',
+ },
+ {
+ name: 'Monaco',
+ dial_code: '+377',
+ emoji: '๐ฒ๐จ',
+ id: 'MC',
+ },
+ {
+ name: 'Mongolia',
+ dial_code: '+976',
+ emoji: '๐ฒ๐ณ',
+ id: 'MN',
+ },
+ {
+ name: 'Montenegro',
+ dial_code: '+382',
+ emoji: '๐ฒ๐ช',
+ id: 'ME',
+ },
+ {
+ name: 'Montserrat',
+ dial_code: '+1664',
+ emoji: '๐ฒ๐ธ',
+ id: 'MS',
+ },
+ {
+ name: 'Morocco',
+ dial_code: '+212',
+ emoji: '๐ฒ๐ฆ',
+ id: 'MA',
+ },
+ {
+ name: 'Mozambique',
+ dial_code: '+258',
+ emoji: '๐ฒ๐ฟ',
+ id: 'MZ',
+ },
+ {
+ name: 'Myanmar',
+ dial_code: '+95',
+ emoji: '๐ฒ๐ฒ',
+ id: 'MM',
+ },
+ {
+ name: 'Namibia',
+ emoji: '๐ณ๐ฆ',
+ dial_code: '+264',
+ id: 'NA',
+ },
+ {
+ name: 'Nauru',
+ dial_code: '+674',
+ emoji: '๐ณ๐ท',
+ id: 'NR',
+ },
+ {
+ name: 'Nepal',
+ dial_code: '+977',
+ emoji: '๐ณ๐ต',
+ id: 'NP',
+ },
+ {
+ name: 'Netherlands',
+ dial_code: '+31',
+ emoji: '๐ณ๐ฑ',
+ id: 'NL',
+ },
+ {
+ name: 'Netherlands Antilles',
+ dial_code: '+599',
+ emoji: '๐ง๐ถ',
+ id: 'AN',
+ },
+ {
+ name: 'New Caledonia',
+ dial_code: '+687',
+ emoji: '๐ณ๐จ',
+ id: 'NC',
+ },
+ {
+ name: 'New Zealand',
+ dial_code: '+64',
+ emoji: '๐ณ๐ฟ',
+ id: 'NZ',
+ },
+ {
+ name: 'Nicaragua',
+ dial_code: '+505',
+ emoji: '๐ณ๐ฎ',
+ id: 'NI',
+ },
+ {
+ name: 'Niger',
+ dial_code: '+227',
+ emoji: '๐ณ๐ช',
+ id: 'NE',
+ },
+ {
+ name: 'Nigeria',
+ dial_code: '+234',
+ emoji: '๐ณ๐ฌ',
+ id: 'NG',
+ },
+ {
+ name: 'Niue',
+ dial_code: '+683',
+ emoji: '๐ณ๐บ',
+ id: 'NU',
+ },
+ {
+ name: 'Norfolk Island',
+ dial_code: '+672',
+ emoji: '๐ณ๐ซ',
+ id: 'NF',
+ },
+ {
+ name: 'Northern Mariana Islands',
+ dial_code: '+1670',
+ emoji: '๐ฒ๐ต',
+ id: 'MP',
+ },
+ {
+ name: 'Norway',
+ dial_code: '+47',
+ emoji: '๐ณ๐ด',
+ id: 'NO',
+ },
+ {
+ name: 'Oman',
+ dial_code: '+968',
+ emoji: '๐ด๐ฒ',
+ id: 'OM',
+ },
+ {
+ name: 'Pakistan',
+ dial_code: '+92',
+ emoji: '๐ต๐ฐ',
+ id: 'PK',
+ },
+ {
+ name: 'Palau',
+ dial_code: '+680',
+ emoji: '๐ต๐ผ',
+ id: 'PW',
+ },
+ {
+ name: 'Palestinian Territory, Occupied',
+ dial_code: '+970',
+ emoji: '๐ต๐ธ',
+ id: 'PS',
+ },
+ {
+ name: 'Panama',
+ dial_code: '+507',
+ emoji: '๐ต๐ฆ',
+ id: 'PA',
+ },
+ {
+ name: 'Papua New Guinea',
+ dial_code: '+675',
+ emoji: '๐ต๐ฌ',
+ id: 'PG',
+ },
+ {
+ name: 'Paraguay',
+ dial_code: '+595',
+ emoji: '๐ต๐พ',
+ id: 'PY',
+ },
+ {
+ name: 'Peru',
+ dial_code: '+51',
+ emoji: '๐ต๐ช',
+ id: 'PE',
+ },
+ {
+ name: 'Philippines',
+ dial_code: '+63',
+ emoji: '๐ต๐ญ',
+ id: 'PH',
+ },
+ {
+ name: 'Pitcairn',
+ dial_code: '+872',
+ emoji: '๐ต๐ณ',
+ id: 'PN',
+ },
+ {
+ name: 'Poland',
+ dial_code: '+48',
+ emoji: '๐ต๐ฑ',
+ id: 'PL',
+ },
+ {
+ name: 'Portugal',
+ dial_code: '+351',
+ emoji: '๐ต๐น',
+ id: 'PT',
+ },
+ {
+ name: 'Puerto Rico',
+ dial_code: '+1939',
+ emoji: '๐ต๐ท',
+ id: 'PR',
+ },
+ {
+ name: 'Qatar',
+ dial_code: '+974',
+ emoji: '๐ถ๐ฆ',
+ id: 'QA',
+ },
+ {
+ name: 'Romania',
+ dial_code: '+40',
+ emoji: '๐ท๐ด',
+ id: 'RO',
+ },
+ {
+ name: 'Russia',
+ dial_code: '+7',
+ emoji: '๐ท๐บ',
+ id: 'RU',
+ },
+ {
+ name: 'Rwanda',
+ dial_code: '+250',
+ emoji: '๐ท๐ผ',
+ id: 'RW',
+ },
+ {
+ name: 'Reunion',
+ dial_code: '+262',
+ emoji: '๐ท๐ช',
+ id: 'RE',
+ },
+ {
+ name: 'Saint Barthelemy',
+ dial_code: '+590',
+ emoji: '๐ง๐ฑ',
+ id: 'BL',
+ },
+ {
+ name: 'Saint Helena, Ascension and Tristan Da Cunha',
+ dial_code: '+290',
+ emoji: '๐ธ๐ญ',
+ id: 'SH',
+ },
+ {
+ name: 'Saint Kitts and Nevis',
+ dial_code: '+1869',
+ emoji: '๐ฐ๐ณ',
+ id: 'KN',
+ },
+ {
+ name: 'Saint Lucia',
+ dial_code: '+1758',
+ emoji: '๐ฑ๐จ',
+ id: 'LC',
+ },
+ {
+ name: 'Saint Martin',
+ dial_code: '+590',
+ emoji: '๐ฒ๐ซ',
+ id: 'MF',
+ },
+ {
+ name: 'Saint Pierre and Miquelon',
+ dial_code: '+508',
+ emoji: '๐ต๐ฒ',
+ id: 'PM',
+ },
+ {
+ name: 'Saint Vincent and the Grenadines',
+ dial_code: '+1784',
+ emoji: '๐ป๐จ',
+ id: 'VC',
+ },
+ {
+ name: 'Samoa',
+ dial_code: '+685',
+ emoji: '๐ผ๐ธ',
+ id: 'WS',
+ },
+ {
+ name: 'San Marino',
+ dial_code: '+378',
+ emoji: '๐ธ๐ฒ',
+ id: 'SM',
+ },
+ {
+ name: 'Sao Tome and Principe',
+ dial_code: '+239',
+ emoji: '๐ธ๐น',
+ id: 'ST',
+ },
+ {
+ name: 'Saudi Arabia',
+ dial_code: '+966',
+ emoji: '๐ธ๐ฆ',
+ id: 'SA',
+ },
+ {
+ name: 'Senegal',
+ dial_code: '+221',
+ emoji: '๐ธ๐ณ',
+ id: 'SN',
+ },
+ {
+ name: 'Serbia',
+ dial_code: '+381',
+ emoji: '๐ท๐ธ',
+ id: 'RS',
+ },
+ {
+ name: 'Seychelles',
+ dial_code: '+248',
+ emoji: '๐ธ๐จ',
+ id: 'SC',
+ },
+ {
+ name: 'Sierra Leone',
+ dial_code: '+232',
+ emoji: '๐ธ๐ฑ',
+ id: 'SL',
+ },
+ {
+ name: 'Singapore',
+ dial_code: '+65',
+ emoji: '๐ธ๐ฌ',
+ id: 'SG',
+ },
+ {
+ name: 'Slovakia',
+ dial_code: '+421',
+ emoji: '๐ธ๐ฐ',
+ id: 'SK',
+ },
+ {
+ name: 'Slovenia',
+ dial_code: '+386',
+ emoji: '๐ธ๐ฎ',
+ id: 'SI',
+ },
+ {
+ name: 'Solomon Islands',
+ dial_code: '+677',
+ emoji: '๐ธ๐ง',
+ id: 'SB',
+ },
+ {
+ name: 'Somalia',
+ dial_code: '+252',
+ emoji: '๐ธ๐ด',
+ id: 'SO',
+ },
+ {
+ name: 'South Africa',
+ dial_code: '+27',
+ emoji: '๐ฟ๐ฆ',
+ id: 'ZA',
+ },
+ {
+ name: 'South Sudan',
+ dial_code: '+211',
+ emoji: '๐ธ๐ธ',
+ id: 'SS',
+ },
+ {
+ name: 'South Georgia and the South Sandwich Islands',
+ dial_code: '+500',
+ emoji: '๐ฌ๐ธ',
+ id: 'GS',
+ },
+ {
+ name: 'Spain',
+ dial_code: '+34',
+ emoji: '๐ช๐ธ',
+ id: 'ES',
+ },
+ {
+ name: 'Sri Lanka',
+ dial_code: '+94',
+ emoji: '๐ฑ๐ฐ',
+ id: 'LK',
+ },
+ {
+ name: 'Sudan',
+ dial_code: '+249',
+ emoji: '๐ธ๐ฉ',
+ id: 'SD',
+ },
+ {
+ name: 'Suriname',
+ dial_code: '+597',
+ emoji: '๐ธ๐ท',
+ id: 'SR',
+ },
+ {
+ name: 'Svalbard and Jan Mayen',
+ dial_code: '+47',
+ emoji: '๐ธ๐ฏ',
+ id: 'SJ',
+ },
+ {
+ name: 'Swaziland',
+ dial_code: '+268',
+ emoji: '๐ธ๐ฟ',
+ id: 'SZ',
+ },
+ {
+ name: 'Sweden',
+ dial_code: '+46',
+ emoji: '๐ธ๐ช',
+ id: 'SE',
+ },
+ {
+ name: 'Switzerland',
+ dial_code: '+41',
+ emoji: '๐จ๐ญ',
+ id: 'CH',
+ },
+ {
+ name: 'Syrian Arab Republic',
+ dial_code: '+963',
+ emoji: '๐ธ๐พ',
+ id: 'SY',
+ },
+ {
+ name: 'Taiwan',
+ dial_code: '+886',
+ emoji: '๐น๐ผ',
+ id: 'TW',
+ },
+ {
+ name: 'Tajikistan',
+ dial_code: '+992',
+ emoji: '๐น๐ฏ',
+ id: 'TJ',
+ },
+ {
+ name: 'Tanzania, United Republic of Tanzania',
+ dial_code: '+255',
+ emoji: '๐น๐ฟ',
+ id: 'TZ',
+ },
+ {
+ name: 'Thailand',
+ dial_code: '+66',
+ emoji: '๐น๐ญ',
+ id: 'TH',
+ },
+ {
+ name: 'Timor-Leste',
+ dial_code: '+670',
+ emoji: '๐น๐ฑ',
+ id: 'TL',
+ },
+ {
+ name: 'Togo',
+ dial_code: '+228',
+ emoji: '๐น๐ฌ',
+ id: 'TG',
+ },
+ {
+ name: 'Tokelau',
+ dial_code: '+690',
+ emoji: '๐น๐ฐ',
+ id: 'TK',
+ },
+ {
+ name: 'Tonga',
+ dial_code: '+676',
+ emoji: '๐น๐ด',
+ id: 'TO',
+ },
+ {
+ name: 'Trinidad and Tobago',
+ dial_code: '+1868',
+ emoji: '๐น๐น',
+ id: 'TT',
+ },
+ {
+ name: 'Tunisia',
+ dial_code: '+216',
+ emoji: '๐น๐ณ',
+ id: 'TN',
+ },
+ {
+ name: 'Turkey',
+ dial_code: '+90',
+ emoji: '๐น๐ท',
+ id: 'TR',
+ },
+ {
+ name: 'Turkmenistan',
+ dial_code: '+993',
+ emoji: '๐น๐ฒ',
+ id: 'TM',
+ },
+ {
+ name: 'Turks and Caicos Islands',
+ dial_code: '+1649',
+ emoji: '๐น๐จ',
+ id: 'TC',
+ },
+ {
+ name: 'Tuvalu',
+ dial_code: '+688',
+ emoji: '๐น๐ป',
+ id: 'TV',
+ },
+ {
+ name: 'Uganda',
+ dial_code: '+256',
+ emoji: '๐บ๐ฌ',
+ id: 'UG',
+ },
+ {
+ name: 'Ukraine',
+ dial_code: '+380',
+ emoji: '๐บ๐ฆ',
+ id: 'UA',
+ },
+ {
+ name: 'United Arab Emirates',
+ dial_code: '+971',
+ emoji: '๐ฆ๐ช',
+ id: 'AE',
+ },
+ {
+ name: 'United Kingdom',
+ dial_code: '+44',
+ emoji: '๐ฌ๐ง',
id: 'GB',
},
- { name: 'United States of America', id: 'US' },
- { name: 'Uruguay', id: 'UY' },
- { name: 'Uzbekistan', id: 'UZ' },
- { name: 'Vanuatu', id: 'VU' },
- { name: 'Venezuela (Bolivarian Republic of)', id: 'VE' },
- { name: 'Vietnam', id: 'VN' },
- { name: 'Wallis and Futuna', id: 'WF' },
- { name: 'Western Sahara', id: 'EH' },
- { name: 'Yemen', id: 'YE' },
- { name: 'Zambia', id: 'ZM' },
- { name: 'Zimbabwe', id: 'ZW' },
+ {
+ name: 'United States',
+ dial_code: '+1',
+ emoji: '๐บ๐ธ',
+ id: 'US',
+ },
+ {
+ name: 'Uruguay',
+ dial_code: '+598',
+ emoji: '๐บ๐พ',
+ id: 'UY',
+ },
+ {
+ name: 'Uzbekistan',
+ dial_code: '+998',
+ emoji: '๐บ๐ฟ',
+ id: 'UZ',
+ },
+ {
+ name: 'Vanuatu',
+ dial_code: '+678',
+ emoji: '๐ป๐บ',
+ id: 'VU',
+ },
+ {
+ name: 'Venezuela, Bolivarian Republic of Venezuela',
+ dial_code: '+58',
+ emoji: '๐ป๐ช',
+ id: 'VE',
+ },
+ {
+ name: 'Vietnam',
+ dial_code: '+84',
+ emoji: '๐ป๐ณ',
+ id: 'VN',
+ },
+ {
+ name: 'Virgin Islands, British',
+ dial_code: '+1284',
+ emoji: '๐ป๐ฌ',
+ id: 'VG',
+ },
+ {
+ name: 'Virgin Islands, U.S.',
+ dial_code: '+1340',
+ emoji: '๐ป๐ฎ',
+ id: 'VI',
+ },
+ {
+ name: 'Wallis and Futuna',
+ dial_code: '+681',
+ emoji: '๐ผ๐ซ',
+ id: 'WF',
+ },
+ {
+ name: 'Yemen',
+ dial_code: '+967',
+ emoji: '๐พ๐ช',
+ id: 'YE',
+ },
+ {
+ name: 'Zambia',
+ dial_code: '+260',
+ emoji: '๐ฟ๐ฒ',
+ id: 'ZM',
+ },
+ {
+ name: 'Zimbabwe',
+ dial_code: '+263',
+ emoji: '๐ฟ๐ผ',
+ id: 'ZW',
+ },
];
export default countries;
diff --git a/app/javascript/shared/helpers/Validators.js b/app/javascript/shared/helpers/Validators.js
index cb3246e7e..3a53af9da 100644
--- a/app/javascript/shared/helpers/Validators.js
+++ b/app/javascript/shared/helpers/Validators.js
@@ -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;
diff --git a/package.json b/package.json
index 39afb1529..44e36b62a 100644
--- a/package.json
+++ b/package.json
@@ -44,6 +44,7 @@
"idb": "^7.1.1",
"ionicons": "~2.0.1",
"js-cookie": "^2.2.1",
+ "libphonenumber-js": "^1.10.24",
"logrocket": "^3.0.1",
"logrocket-vuex": "^0.0.3",
"markdown-it": "^13.0.1",
diff --git a/yarn.lock b/yarn.lock
index 795f52851..27e5a915b 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -10949,6 +10949,11 @@ levn@^0.3.0, levn@~0.3.0:
prelude-ls "~1.1.2"
type-check "~0.3.2"
+libphonenumber-js@^1.10.24:
+ version "1.10.24"
+ resolved "https://registry.yarnpkg.com/libphonenumber-js/-/libphonenumber-js-1.10.24.tgz#a1744cf29df86d5a587562ea28dde12320eb6ab6"
+ integrity sha512-3Dk8f5AmrcWqg+oHhmm9hwSTqpWHBdSqsHmjCJGroULFubi0+x7JEIGmRZCuL3TI8Tx39xaKqfnhsDQ4ALa/Nw==
+
lines-and-columns@^1.1.6:
version "1.1.6"
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00"