diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-21 14:40:44 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-21 14:40:44 +0200 |
| commit | 39ee780fce2c75bcfed078df9cbbfbc04853da1d (patch) | |
| tree | 7240492dfc8cd170ff00f63eb9a3406d33680016 /app/client/common/paramGroup.component.js | |
| parent | a952ae8a1633b7650d5d3c51ba51b3e16a8639ad (diff) | |
view mode toggle
Diffstat (limited to 'app/client/common/paramGroup.component.js')
| -rw-r--r-- | app/client/common/paramGroup.component.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/app/client/common/paramGroup.component.js b/app/client/common/paramGroup.component.js index 2533642..6dd45f6 100644 --- a/app/client/common/paramGroup.component.js +++ b/app/client/common/paramGroup.component.js @@ -14,20 +14,22 @@ class ParamGroup extends Component { this.props.actions.set_param(this.props.name, new_value) } render() { - const props = this.props const checked = this.props.opt[this.props.name] - const className = checked ? 'paramGroup active' : 'paramGroup inactive' + const toggle = !this.props.noToggle + const className = (!toggle || checked) ? 'paramGroup active' : 'paramGroup inactive' return ( <div className={className}> <label> - <h3>{props.title}</h3> - <input - type='checkbox' - onClick={this.handleClick} - checked={checked} - /> + <h3>{this.props.title}</h3> + {toggle ? + <input + type='checkbox' + onClick={this.handleClick} + checked={checked} + /> + : null} </label> - {props.children} + {this.props.children} </div> ) } |
