import React from 'react'; import PropTypes from 'prop-types'; import { withStyles } from '@material-ui/core/styles'; import { Stepper, Step, StepLabel, StepContent, Button, Paper, Typography } from '@material-ui/core'; const styles = theme => ({ root: { width: '90%', }, button: { marginTop: theme.spacing(1), marginRight: theme.spacing(1), }, actionsContainer: { marginBottom: theme.spacing(2), }, resetContainer: { padding: theme.spacing(3), }, }); function getSteps() { return ['Select campaign settings', 'Create an ad group', 'Create an ad']; } function getStepContent(step) { switch (step) { case 0: return `For each ad campaign that you create, you can control how much you're willing to spend on clicks and conversions, which networks and geographical locations you want your ads to show on, and more.`; case 1: return 'An ad group contains one or more ads which target a shared set of keywords.'; case 2: return `Try out different ad text to see what brings in the most customers, and learn how to enhance your ads using features like ad extensions. If you run into any problems with your ads, find out how to tell if they're running and how to resolve approval issues.`; default: return 'Unknown step'; } } class VerticalStepper extends React.Component { state = { activeStep: 0, }; handleNext = () => { this.setState({ activeStep: this.state.activeStep + 1, }); }; handleBack = () => { this.setState({ activeStep: this.state.activeStep - 1, }); }; handleReset = () => { this.setState({ activeStep: 0, }); }; render() { const { classes } = this.props; const steps = getSteps(); const { activeStep } = this.state; return (
{steps.map((label, index) => ( {label} {getStepContent(index)}
))}
{activeStep === steps.length && ( All steps completed - you"re finished )}
); } } VerticalStepper.propTypes = { classes: PropTypes.object.isRequired, }; export default withStyles(styles)(VerticalStepper);