diff --git a/ui/src/dashboards/components/DisplayOptions.js b/ui/src/dashboards/components/DisplayOptions.js index 7bf81fadfe..5d782bf40b 100644 --- a/ui/src/dashboards/components/DisplayOptions.js +++ b/ui/src/dashboards/components/DisplayOptions.js @@ -33,14 +33,13 @@ class DisplayOptions extends Component { : axes } - render() { + renderOptions = () => { const { colors, onSetBase, onSetScale, onSetLabel, selectedGraphType, - onSelectGraphType, onSetPrefixSuffix, onSetYAxisBoundMin, onSetYAxisBoundMax, @@ -52,44 +51,55 @@ class DisplayOptions extends Component { } = this.props const {axes} = this.state + switch (selectedGraphType) { + case 'gauge': + return ( + + ) + case 'single-stat': + return ( + + ) + default: + return ( + + ) + } + } + + render() { + const {selectedGraphType, onSelectGraphType} = this.props + return (
- {selectedGraphType === 'gauge' - ? - : null} - {selectedGraphType === 'single-stat' - ? - : null} - {selectedGraphType === !('single-stat' || 'gauge') - ? - : null} + {this.renderOptions()}
) }