From a0de92b91990c215d17414bbdc7ba3d7041338cc Mon Sep 17 00:00:00 2001 From: jos Date: Wed, 19 Sep 2018 21:39:06 +0200 Subject: [PATCH] Move custom icons in a separate file --- src/jsoneditor/components/customIcons.js | 23 +++++++++++++++++++ .../components/menu/TextModeMenu.js | 23 +------------------ 2 files changed, 24 insertions(+), 22 deletions(-) create mode 100644 src/jsoneditor/components/customIcons.js diff --git a/src/jsoneditor/components/customIcons.js b/src/jsoneditor/components/customIcons.js new file mode 100644 index 0000000..7b5a622 --- /dev/null +++ b/src/jsoneditor/components/customIcons.js @@ -0,0 +1,23 @@ +// custom fontawesome icons + +export const faCompact = { + prefix: 'fa', + iconName: 'compact', + icon: [ + 16, 16, + [], + null, + 'm 0,2 0,2 16,0 0,-2 m -16,4 0,2 16,0 0,-2 m -16,4 0,2 9,0 0,-2' + ] +} + +export const faFormat = { + prefix: 'fa', + iconName: 'format', + icon: [ + 16, 16, + [], + null, + 'm 0,2 0,2 12,0 0,-2 m -6,4 0,2 10,0 0,-2 m -10,4 0,2 9,0 0,-2 m -15,4 0,2 10,0 0,-2' + ] +} diff --git a/src/jsoneditor/components/menu/TextModeMenu.js b/src/jsoneditor/components/menu/TextModeMenu.js index c2c9554..f16efd3 100644 --- a/src/jsoneditor/components/menu/TextModeMenu.js +++ b/src/jsoneditor/components/menu/TextModeMenu.js @@ -4,31 +4,10 @@ import PropTypes from 'prop-types' import fontawesome from '@fortawesome/fontawesome' import faScrewdriver from '@fortawesome/fontawesome-free-solid/faScrewdriver' +import { faCompact, faFormat } from '../customIcons' import './Menu.css' -const faCompact = { - prefix: 'fa', - iconName: 'compact', - icon: [ - 16, 16, - [], - null, - 'm 0,2 0,2 16,0 0,-2 m -16,4 0,2 16,0 0,-2 m -16,4 0,2 9,0 0,-2' - ] -} - -const faFormat = { - prefix: 'fa', - iconName: 'format', - icon: [ - 16, 16, - [], - null, - 'm 0,2 0,2 12,0 0,-2 m -6,4 0,2 10,0 0,-2 m -10,4 0,2 9,0 0,-2 m -15,4 0,2 10,0 0,-2' - ] -} - fontawesome.library.add(faCompact, faFormat, faScrewdriver) export default class TreeModeMenu extends PureComponent {