Skip to content

Commit

Permalink
Improve slider display in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
nukeop committed Apr 16, 2019
1 parent c63ce78 commit 8b9dc53
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 19 deletions.
34 changes: 20 additions & 14 deletions app/components/Settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,27 @@ class Settings extends React.Component {
}

renderSliderOption (option) {
return (<div className={styles.slider_container}>
Value : {this.getOptionValue(option) || option.default} {option.unit}
<Range
value={this.getOptionValue(option) || option.default}
min={option.min}
max={option.max}
fillColor={volumeSliderColors.fillColor}
trackColor={volumeSliderColors.trackColor}
thumbColor={volumeSliderColors.thumbColor}
height={4}
width='100%'
onChange={(e) => this.handleSliderChange(e, option)}
/>
</div>);
// Value : {this.getOptionValue(option) || option.default} {option.unit}
return (
<div className={styles.slider_container}>
<label>Less</label>
<Range
value={this.getOptionValue(option) || option.default}
min={option.min}
max={option.max}
fillColor={volumeSliderColors.fillColor}
trackColor={volumeSliderColors.trackColor}
thumbColor={volumeSliderColors.thumbColor}
height={4}
width='auto'
onChange={(e) => this.handleSliderChange(e, option)}
thumbSize={21}
/>
<label>More</label>
</div>
);
}

renderNumberOption (option) {
if (typeof option.unit === 'string') {
return this.renderSliderOption(option);
Expand Down
16 changes: 11 additions & 5 deletions app/components/Settings/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@
font-weight: lighter;
}

label {
flex: 1 1 auto;
}

.checkbox {
align-self: flex-end;
flex: 0 0 auto;
Expand Down Expand Up @@ -85,6 +81,16 @@
}

.slider_container{
width:100%;
display: flex;
flex-flow: row;
width: 100%;

div {
flex: 1 1 auto;
}

#rrp-baseDiv {
margin: 0 2rem;
}
}
}

0 comments on commit 8b9dc53

Please sign in to comment.