Pull strings into consts

pull/1081/head
Andrew Watkins 2017-04-04 14:37:24 -07:00
parent 98fef831bb
commit 016a4cba9e
1 changed files with 6 additions and 3 deletions

View File

@ -14,6 +14,9 @@ const {
string, string,
} = PropTypes } = PropTypes
const BUILDER = 'Help me build a query'
const EDITOR = 'Type my own query'
const QueryBuilder = React.createClass({ const QueryBuilder = React.createClass({
propTypes: { propTypes: {
queries: arrayOf(shape({})).isRequired, queries: arrayOf(shape({})).isRequired,
@ -122,17 +125,17 @@ const QueryBuilder = React.createClass({
onChoose(item) { onChoose(item) {
switch (item.text) { switch (item.text) {
case 'Help me build a query': case BUILDER:
this.handleAddQuery() this.handleAddQuery()
break break
case 'Type my own query': case EDITOR:
this.handleAddRawQuery() this.handleAddRawQuery()
break break
} }
}, },
renderAddQuery() { renderAddQuery() {
const items = [{text: 'Help me build a query'}, {text: 'Type my own query'}] const items = [{text: BUILDER}, {text: EDITOR}]
return ( return (
<SimpleDropdown onChoose={this.onChoose} items={items} className="panel--tab-new"> <SimpleDropdown onChoose={this.onChoose} items={items} className="panel--tab-new">
<span className="icon plus"></span> <span className="icon plus"></span>