ProgressBar.js
815 Bytes
import React, { Component } from 'react';
import * as SelectActionCreators from './actions/profilationSelect'
import {connect} from 'react-redux';
class ProgressBar extends Component{
render(){
const percent=((1+this.props.progressBar)/13)*100
if(this.props.location!=='/solution'){
return(
<div className='progressBar-container'>
<div style={{width:percent+'%'}} className='progressBar'></div>
</div>)}
else{
return null
}
}
}
const mapStateToProps = state => {
return {
progressBar: state.ProfilationSelectReducer.progressBar
}
};
const mapDispatchToProps = dispatch => ({
updateStoreValue: (prop,value) =>
dispatch(SelectActionCreators.changeProp(prop,value)),
});
export default connect(mapStateToProps, mapDispatchToProps)(ProgressBar);