瀏覽代碼

Replaces emoji flags with flag from a png.

Seems like windows does not have emojis for flags.
master
damencho 6 年之前
父節點
當前提交
40f03fedc2
共有 7 個文件被更改,包括 23 次插入17 次删除
  1. 5
    0
      css/main.scss
  2. 6
    3
      css/modals/invite/_info.scss
  3. 二進制
      images/flags.png
  4. 二進制
      images/flags@2x.png
  5. 5
    0
      package-lock.json
  6. 1
    0
      package.json
  7. 6
    14
      react/features/invite/components/dial-in-summary/NumbersList.web.js

+ 5
- 0
css/main.scss 查看文件

18
 
18
 
19
 /* Animations END */
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
 /* Fonts BEGIN */
26
 /* Fonts BEGIN */
22
 
27
 
23
 @import 'font';
28
 @import 'font';

+ 6
- 3
css/modals/invite/_info.scss 查看文件

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

二進制
images/flags.png 查看文件


二進制
images/flags@2x.png 查看文件


+ 5
- 0
package-lock.json 查看文件

3298
       "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=",
3298
       "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=",
3299
       "dev": true
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
     "bcrypt-pbkdf": {
3306
     "bcrypt-pbkdf": {
3302
       "version": "1.0.2",
3307
       "version": "1.0.2",
3303
       "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
3308
       "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",

+ 1
- 0
package.json 查看文件

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

+ 6
- 14
react/features/invite/components/dial-in-summary/NumbersList.web.js 查看文件

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
      * @private
137
      * @private
138
      * @returns {ReactElement}
138
      * @returns {ReactElement}
139
      */
139
      */
140
     _renderFlag(countryCode) {
140
     _renderFlag(countryCode) {
141
-        const OFFSET = 127397;
142
-
143
         if (countryCode) {
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
         return null;
148
         return null;

Loading…
取消
儲存