Consolidate map methods

Moved the ternary operator into the onClick
pull/10616/head
Alex P 2017-06-19 16:17:05 -07:00
parent e7ba879a9c
commit 927e252885
1 changed files with 16 additions and 27 deletions

View File

@ -74,33 +74,22 @@ class FunctionSelector extends Component {
</div>
</div>}
<div className="function-selector--grid">
{singleSelect
? INFLUXQL_FUNCTIONS.map((f, i) => {
return (
<div
key={i}
className={classnames('function-selector--item', {
active: this.isSelected(f),
})}
onClick={_.wrap(f, this.onSingleSelect)}
>
{f}
</div>
)
})
: INFLUXQL_FUNCTIONS.map((f, i) => {
return (
<div
key={i}
className={classnames('function-selector--item', {
active: this.isSelected(f),
})}
onClick={_.wrap(f, this.onSelect)}
>
{f}
</div>
)
})}
{INFLUXQL_FUNCTIONS.map((f, i) => {
return (
<div
key={i}
className={classnames('function-selector--item', {
active: this.isSelected(f),
})}
onClick={_.wrap(
f,
singleSelect ? this.onSingleSelect : this.onSelect
)}
>
{f}
</div>
)
})}
</div>
</div>
)