Created custom icons for format/compact

This commit is contained in:
jos 2018-09-19 21:33:46 +02:00
parent 4f86135050
commit 3d2f9ce8df
1 changed files with 25 additions and 5 deletions

View File

@ -3,13 +3,33 @@ import DropDown from './DropDown'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import fontawesome from '@fortawesome/fontawesome' import fontawesome from '@fortawesome/fontawesome'
import faAlignLeft from '@fortawesome/fontawesome-free-solid/faAlignLeft'
import faAlignJustify from '@fortawesome/fontawesome-free-solid/faAlignJustify'
import faScrewdriver from '@fortawesome/fontawesome-free-solid/faScrewdriver' import faScrewdriver from '@fortawesome/fontawesome-free-solid/faScrewdriver'
import './Menu.css' import './Menu.css'
fontawesome.library.add(faAlignLeft, faAlignJustify, faScrewdriver) 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 { export default class TreeModeMenu extends PureComponent {
@ -54,13 +74,13 @@ export default class TreeModeMenu extends PureComponent {
className: 'jsoneditor-format', className: 'jsoneditor-format',
title: 'Format the JSON document', title: 'Format the JSON document',
onClick: this.props.onFormat onClick: this.props.onFormat
}, h('i', {className: 'fa fa-align-left'})), }, h('i', {className: 'fa fa-format'})),
h('button', { h('button', {
key: 'compact', key: 'compact',
className: 'jsoneditor-compact', className: 'jsoneditor-compact',
title: 'Compact the JSON document', title: 'Compact the JSON document',
onClick: this.props.onCompact onClick: this.props.onCompact
}, h('i', {className: 'fa fa-align-justify'})), }, h('i', {className: 'fa fa-compact'})),
h('button', { h('button', {
key: 'repair', key: 'repair',
className: 'jsoneditor-repair', className: 'jsoneditor-repair',