|
|
@@ -131,26 +131,18 @@ class NumbersList extends Component<Props> {
|
|
131
|
131
|
}
|
|
132
|
132
|
|
|
133
|
133
|
/**
|
|
134
|
|
- * Renders a div container for a phone number.
|
|
|
134
|
+ * Renders a div container for a flag for the country of the phone number.
|
|
135
|
135
|
*
|
|
136
|
|
- * @param {string} countryCode - The phone number to display.
|
|
|
136
|
+ * @param {string} countryCode - The country code flag to display.
|
|
137
|
137
|
* @private
|
|
138
|
138
|
* @returns {ReactElement}
|
|
139
|
139
|
*/
|
|
140
|
140
|
_renderFlag(countryCode) {
|
|
141
|
|
- const OFFSET = 127397;
|
|
142
|
|
-
|
|
143
|
141
|
if (countryCode) {
|
|
144
|
|
- // ensure country code is all caps
|
|
145
|
|
- const cc = countryCode.toUpperCase();
|
|
146
|
|
-
|
|
147
|
|
- // return the emoji flag corresponding to country_code or null
|
|
148
|
|
- const countryFlag = /^[A-Z]{2}$/.test(cc)
|
|
149
|
|
- ? String.fromCodePoint(...[ ...cc ]
|
|
150
|
|
- .map(c => c.charCodeAt() + OFFSET))
|
|
151
|
|
- : null;
|
|
152
|
|
-
|
|
153
|
|
- return <td className = 'flag'>{ countryFlag }</td>;
|
|
|
142
|
+ return (
|
|
|
143
|
+ <td className = 'flag-cell'>
|
|
|
144
|
+ <i className = { `flag iti-flag ${countryCode}` } />
|
|
|
145
|
+ </td>);
|
|
154
|
146
|
}
|
|
155
|
147
|
|
|
156
|
148
|
return null;
|