Removed emojis on Windows and Linux

This commit is contained in:
Liam Cardenas 2018-01-22 14:46:14 -08:00
parent bdc49691f0
commit 23261d0759

View file

@ -2,6 +2,7 @@ import React from 'react';
import { Form, FormRow, Submit } from 'component/form.js';
import FormField from 'component/formField';
const os = require('os').type();
const countryCodes = require('country-data')
.callingCountries.all.filter(_ => _.emoji)
.reduce(
@ -79,7 +80,8 @@ class UserPhoneNew extends React.PureComponent {
<FormField type="select" onChange={this.handleSelect.bind(this)}>
{countryCodes.map((country, index) => (
<option key={index} value={country.countryCallingCode}>
{country.emoji} {country.countryCallingCode}
{os === 'Darwin' ? country.emoji : `(${country.alpha2})`}{' '}
{country.countryCallingCode}
</option>
))}
</FormField>