Guest User

Untitled

a guest
Nov 18th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. class Dashboard extends React.Component {
  2.  
  3. constructor(props){
  4. super(props);
  5. this.state = {
  6. activeStep: 0,
  7. }
  8. this.handleStep = this.handleStep.bind(this);
  9. }
  10.  
  11. handleStep(step) {
  12. this.setState({activeStep: step});
  13. };
  14.  
  15. render(){
  16. const { classes, match } = this.props;
  17. const sprints = ['sprint 1', 'sprint 2', 'sprint 3'];
  18. const { activeStep } = this.state;
  19.  
  20. return (
  21. <div className= {classes.root}>
  22. <div className = {classes.container} >
  23. <Stepper nonLinear activeStep={activeStep} alternativeLabel>
  24. {sprints.map((label,index)=>
  25. {
  26. return (
  27. <Step key={label}>
  28. <StepButton
  29. onClick= {this.handleStep(index)}
  30. >
  31. {label}
  32. </StepButton>
  33. </Step>
  34. )
  35. })
  36. }
  37. </Stepper>
  38. </div>
  39. </div>
  40. )
  41. }
  42. }
Add Comment
Please, Sign In to add comment