import React from 'react'; import { ReactSVG } from 'react-svg'; class StepMenu extends React.Component { handleClick(event, step) { event.preventDefault(); // Must update color before updating props to allow component to // render with the proper current color rather than the state before this.props.setStep(step); } render() { let { hide, currentStep, stepInfo } = this.props; if (hide) return (); return (
this.handleClick(event, 0)}>
this.handleClick(event, currentStep - 1)}>
this.handleClick(event, currentStep + 1)}>
this.handleClick(event, stepInfo.length - 1)}>
Step {currentStep + 1} of {stepInfo.length}
); } } export default StepMenu;