Skip to content

Commit

Permalink
feat: add custom variables icon
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgrozav committed Apr 18, 2023
1 parent a27e00d commit fc2d69d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/editor-ui/src/components/MainSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export default mixins(
},
{
id: 'variables',
icon: 'code',
icon: 'variable',
label: this.$locale.baseText('mainSidebar.variables'),
customIconSize: 'medium',
position: 'top',
Expand Down
13 changes: 13 additions & 0 deletions packages/editor-ui/src/plugins/icons/custom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { IconDefinition, IconName, IconPrefix } from '@fortawesome/fontawesome-svg-core';

export const faVariable: IconDefinition = {
prefix: 'fas' as IconPrefix,
iconName: 'variable' as IconName,
icon: [
52,
52,
[],
'e001',
'M42.6,17.8c2.4,0,7.2-2,7.2-8.4c0-6.4-4.6-6.8-6.1-6.8c-2.8,0-5.6,2-8.1,6.3c-2.5,4.4-5.3,9.1-5.3,9.1 l-0.1,0c-0.6-3.1-1.1-5.6-1.3-6.7c-0.5-2.7-3.6-8.4-9.9-8.4c-6.4,0-12.2,3.7-12.2,3.7l0,0C5.8,7.3,5.1,8.5,5.1,9.9 c0,2.1,1.7,3.9,3.9,3.9c0.6,0,1.2-0.2,1.7-0.4l0,0c0,0,4.8-2.7,5.9,0c0.3,0.8,0.6,1.7,0.9,2.7c1.2,4.2,2.4,9.1,3.3,13.5l-4.2,6 c0,0-4.7-1.7-7.1-1.7s-7.2,2-7.2,8.4s4.6,6.8,6.1,6.8c2.8,0,5.6-2,8.1-6.3c2.5-4.4,5.3-9.1,5.3-9.1c0.8,4,1.5,7.1,1.9,8.5 c1.6,4.5,5.3,7.2,10.1,7.2c0,0,5,0,10.9-3.3c1.4-0.6,2.4-2,2.4-3.6c0-2.1-1.7-3.9-3.9-3.9c-0.6,0-1.2,0.2-1.7,0.4l0,0 c0,0-4.2,2.4-5.6,0.5c-1-2-1.9-4.6-2.6-7.8c-0.6-2.8-1.3-6.2-2-9.5l4.3-6.2C35.5,16.1,40.2,17.8,42.6,17.8z',
],
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Vue from 'vue';

import { IconDefinition, library } from '@fortawesome/fontawesome-svg-core';
import { library } from '@fortawesome/fontawesome-svg-core';
import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
import {
faAngleDoubleLeft,
faAngleDown,
Expand All @@ -15,7 +16,6 @@ import {
faBook,
faBoxOpen,
faBug,
faBracketsCurly,
faCalculator,
faCalendar,
faChartBar,
Expand Down Expand Up @@ -129,12 +129,12 @@ import {
faStickyNote as faSolidStickyNote,
faUserLock,
} from '@fortawesome/free-solid-svg-icons';
import { faVariable } from './custom';
import { faStickyNote } from '@fortawesome/free-regular-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function addIcon(icon: any) {
library.add(icon as IconDefinition);
function addIcon(icon: IconDefinition) {
library.add(icon);
}

addIcon(faAngleDoubleLeft);
Expand Down Expand Up @@ -240,7 +240,7 @@ addIcon(faSignOutAlt);
addIcon(faSlidersH);
addIcon(faSpinner);
addIcon(faSolidStickyNote);
addIcon(faStickyNote);
addIcon(faStickyNote as IconDefinition);
addIcon(faStop);
addIcon(faSun);
addIcon(faSync);
Expand All @@ -260,6 +260,7 @@ addIcon(faUser);
addIcon(faUserCircle);
addIcon(faUserFriends);
addIcon(faUsers);
addIcon(faVariable);
addIcon(faVideo);
addIcon(faTree);
addIcon(faUserLock);
Expand Down

0 comments on commit fc2d69d

Please sign in to comment.