Skip to content

Commit

Permalink
update volume controls
Browse files Browse the repository at this point in the history
  • Loading branch information
Pau1fitz committed Feb 6, 2018
1 parent 2c73abd commit 9ff6ba8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 6 additions & 2 deletions src/components/VolumeControls/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ import './VolumeControls.css';
class VolumeControls extends Component {

constructor(props) {

super(props);
this.state = {
volume: props.volume
};
};

}

updateVolume = (e) => {

this.setState({
volume: e.target.value
});
Expand All @@ -27,7 +30,8 @@ class VolumeControls extends Component {
<i className="fa fa-volume-up" aria-hidden="true"/>
<input className='volume' type="range" min={0} max={100} value={this.state.volume} onChange={this.updateVolume} />
</div>
);
);

}
}

Expand Down
9 changes: 4 additions & 5 deletions src/components/VolumeControls/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ import { connect } from "react-redux";
import { bindActionCreators } from "redux";
import { updateVolume } from '../../actions/soundActions';


const mapStateToProps = (state) => {

return {
return {
volume: state.soundReducer.volume
};

};
};

const mapDispatchToProps = (dispatch) => {
Expand Down

0 comments on commit 9ff6ba8

Please sign in to comment.