Browse Source

Replaces emoji flags with flag from a png.

Seems like windows does not have emojis for flags.
master
damencho 6 years ago
parent
commit
40f03fedc2

+ 5
- 0
css/main.scss View File

@@ -18,6 +18,11 @@
18 18
 
19 19
 /* Animations END */
20 20
 
21
+/* Flags BEGIN */
22
+$flagsImagePath: "/images/";
23
+@import "../node_modules/bc-css-flags/dist/css/bc-css-flags.scss";
24
+/* Flags END */
25
+
21 26
 /* Fonts BEGIN */
22 27
 
23 28
 @import 'font';

+ 6
- 3
css/modals/invite/_info.scss View File

@@ -140,10 +140,13 @@
140 140
         border-bottom: 1px solid #d1dbe8;
141 141
     }
142 142
 
143
-    .flag {
144
-        border-bottom-style: none;
145
-        width: 30px;
143
+    .flag-cell {
146 144
         vertical-align: top;
145
+        width: 30px;
146
+    }
147
+    .flag {
148
+        display: block;
149
+        margin: 5px 5px 0px 5px;
147 150
     }
148 151
 
149 152
     .country {

BIN
images/flags.png View File


BIN
images/flags@2x.png View File


+ 5
- 0
package-lock.json View File

@@ -3298,6 +3298,11 @@
3298 3298
       "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=",
3299 3299
       "dev": true
3300 3300
     },
3301
+    "bc-css-flags": {
3302
+      "version": "3.0.0",
3303
+      "resolved": "https://registry.npmjs.org/bc-css-flags/-/bc-css-flags-3.0.0.tgz",
3304
+      "integrity": "sha1-OJWiPppx+VgE6u8V8WXVG5rV4hM="
3305
+    },
3301 3306
     "bcrypt-pbkdf": {
3302 3307
       "version": "1.0.2",
3303 3308
       "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",

+ 1
- 0
package.json View File

@@ -36,6 +36,7 @@
36 36
     "@microsoft/microsoft-graph-client": "1.1.0",
37 37
     "@webcomponents/url": "0.7.1",
38 38
     "amplitude-js": "4.5.2",
39
+    "bc-css-flags": "3.0.0",
39 40
     "dropbox": "4.0.9",
40 41
     "i18n-iso-countries": "3.7.8",
41 42
     "i18next": "8.4.3",

+ 6
- 14
react/features/invite/components/dial-in-summary/NumbersList.web.js View File

@@ -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;

Loading…
Cancel
Save