From 702dc5ed20c9a7049aa4563b3291185d4c31d102 Mon Sep 17 00:00:00 2001 From: jos Date: Wed, 19 Sep 2018 10:04:51 +0200 Subject: [PATCH] Use chevron icons in search and mode button --- src/jsoneditor/components/menu/ModeButton.js | 14 +++++++++++++- src/jsoneditor/components/menu/Search.js | 10 +++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/jsoneditor/components/menu/ModeButton.js b/src/jsoneditor/components/menu/ModeButton.js index 69040c8..2b01660 100644 --- a/src/jsoneditor/components/menu/ModeButton.js +++ b/src/jsoneditor/components/menu/ModeButton.js @@ -2,6 +2,15 @@ import { createElement as h, Component } from 'react' import ModeSelector from './ModeSelector' import { toCapital } from '../../utils/stringUtils' +import fontawesome from '@fortawesome/fontawesome' +import faChevronDown from '@fortawesome/fontawesome-free-solid/faChevronDown' + +import './Menu.css' + +import './Search.css' + +fontawesome.library.add(faChevronDown) + export default class ModeButton extends Component { constructor (props) { super (props) @@ -22,7 +31,10 @@ export default class ModeButton extends Component { key: 'button', title: 'Switch mode', onClick: this.handleOpen - }, `${toCapital(props.mode)} \u25BC`), + }, [ + toCapital(props.mode) + ' ', + h('i', { className: 'fa fa-chevron-down' }) + ]), h(ModeSelector, { key: 'menu', diff --git a/src/jsoneditor/components/menu/Search.js b/src/jsoneditor/components/menu/Search.js index bab7f77..aed15d7 100644 --- a/src/jsoneditor/components/menu/Search.js +++ b/src/jsoneditor/components/menu/Search.js @@ -5,15 +5,15 @@ import { findEditorContainer, setSelection } from '../utils/domSelector' import fontawesome from '@fortawesome/fontawesome' import faSearch from '@fortawesome/fontawesome-free-solid/faSearch' -import faCaretUp from '@fortawesome/fontawesome-free-solid/faCaretUp' -import faCaretDown from '@fortawesome/fontawesome-free-solid/faCaretDown' +import faChevronUp from '@fortawesome/fontawesome-free-solid/faChevronUp' +import faChevronDown from '@fortawesome/fontawesome-free-solid/faChevronDown' import faTimes from '@fortawesome/fontawesome-free-solid/faTimes' import './Menu.css' import './Search.css' -fontawesome.library.add(faSearch, faCaretUp, faCaretDown, faTimes) +fontawesome.library.add(faSearch, faChevronUp, faChevronDown, faTimes) export default class Search extends Component { constructor (props) { @@ -48,14 +48,14 @@ export default class Search extends Component { className: 'jsoneditor-search-next', title: 'Next result', onClick: this.props.onNext - }, h('i', {className: 'fa fa-caret-down'})), + }, h('i', {className: 'fa fa-chevron-down'})), h('button', { key: 'previous', type: 'button', className: 'jsoneditor-search-previous', title: 'Previous result', onClick: this.props.onPrevious - }, h('i', {className: 'fa fa-caret-up'})), + }, h('i', {className: 'fa fa-chevron-up'})), h('button', { key: 'close', type: 'button',