fix: some icons missing

Massimo Melina committed Jan 17, 2022 at 19:19 UTC 1f6f0ba66dd8f9162257028e5dcdf18a9efb8a61
4 files changed +39 -32
fontello-config.json
+6
@@ -143,6 +143,12 @@
143 "css": "stop",
144 "code": 59395,
145 "src": "fontawesome"
146 + },
147 + {
148 + "uid": "5211af474d3a9848f67f945e2ccaf143",
149 + "css": "cancel",
150 + "code": 59398,
151 + "src": "fontawesome"
152 }
153 ]
154 }
\ No newline at end of file
frontend/public/fontello.css
+13 -2
@@ -1,9 +1,19 @@
1 @font-face {
2 font-family: 'fontello';
3 - src: url('fontello.woff2?16824442') format('woff2');
3 + src: url('fontello.woff2?71539586') format('woff2');
4 font-weight: normal;
5 font-style: normal;
6 }
7 +/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
8 +/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
9 +/*
10 +@media screen and (-webkit-min-device-pixel-ratio:0) {
11 + @font-face {
12 + font-family: 'fontello';
13 + src: url('../font/fontello.svg?71539586#fontello') format('svg');
14 + }
15 +}
16 +*/
17 [class^="fa-"]:before, [class*=" fa-"]:before {
18 font-family: "fontello";
19 font-style: normal;
@@ -45,9 +55,11 @@
55 .fa-stop:before { content: '\e803'; } /* '' */
56 .fa-download:before { content: '\e804'; } /* '' */
57 .fa-upload:before { content: '\e805'; } /* '' */
58 +.fa-cancel:before { content: '\e806'; } /* '' */
59 .fa-edit:before { content: '\e807'; } /* '' */
60 .fa-check:before { content: '\e808'; } /* '' */
61 .fa-folder:before { content: '\e809'; } /* '' */
62 +.fa-user:before { content: '\e80a'; } /* '' */
63 .fa-home:before { content: '\e80b'; } /* '' */
64 .fa-key:before { content: '\e80c'; } /* '' */
65 .fa-cancel-circled:before { content: '\e811'; } /* '' */
@@ -61,4 +73,3 @@
73 .fa-level-up:before { content: '\f148'; } /* '' */
74 .fa-file-archive:before { content: '\f1c6'; } /* '' */
75 .fa-trash:before { content: '\f1f8'; } /* '' */
64 -.fa-user-o:before { content: '\f2c0'; } /* '' */
frontend/public/fontello.woff2
Binary files a/frontend/public/fontello.woff2 and b/frontend/public/fontello.woff2 differ
frontend/src/icons.ts
+20 -30
@@ -1,32 +1,23 @@
1 import { state, useSnapState } from './state'
2 import { createElement as h } from 'react'
3
4 -const SYS_ICONS: Record<string,string> = {
5 - login: 'user-o',
6 - user: 'user-o',
7 - file: 'doc',
8 - spinner: 'spin6 spinner',
9 - settings: 'cog',
10 - parent: 'level-up mirror',
11 - archive: 'file-archive',
12 - interrupted: 'unlink',
13 - password: 'key',
14 -}
15 -const ICON2EMOJI = {
16 - login: '👤',
17 - user: '👤',
18 - filter: '✂',
19 - search: '🔍',
20 - settings: '⚙',
21 - archive: '📦',
22 - logout: '🚪',
23 - home: '🏠',
24 - parent: '⬆️',
25 - folder: '📂',
26 - file: '📄',
27 - spinner: '🎲',
28 - password: '🗝️',
29 - download: '📥'
4 +const SYS_ICONS = {
5 + login: 'user:👤',
6 + user: 'user:👤',
7 + filter: ':✂',
8 + search: ':🔍',
9 + search_off: 'cancel:❌',
10 + stop: ':⏹️',
11 + settings: 'cog:⚙',
12 + archive: 'file-archive:📦',
13 + logout: ':🚪',
14 + home: ':🏠',
15 + parent: 'level-up mirror️:⬆',
16 + folder: ':📂',
17 + file: 'doc:📄',
18 + spinner: 'spin6 spinner:🎲',
19 + password: 'key:🗝️',
20 + download: ':📥',
21 }
22
23 document.fonts.ready.then(async ()=> {
@@ -37,12 +28,11 @@ document.fonts.ready.then(async ()=> {
28
29 export function Icon({ name, className='', ...props }: { name:string, className:string, style?:any }) {
30 // @ts-ignore
40 - const emoji = ICON2EMOJI[name] || '#'
41 - name = SYS_ICONS[name] || name
31 + const [clazz,emoji] = (SYS_ICONS[name] || name).split(':')
32 const { iconsClass } = useSnapState()
33 return h('span',{
34 ...props,
45 - className: className+' icon '+(iconsClass ? 'fa-'+name : 'emoji'),
46 - }, iconsClass ? null : emoji)
35 + className: className+' icon '+(iconsClass ? 'fa-'+(clazz||name) : 'emoji'),
36 + }, iconsClass ? null : (emoji||'#'))
37 }
38