+
: ''}>
{tutorials[tutorialId-1].title}
@@ -67,4 +90,14 @@ class StepperHorizontal extends Component {
};
}
-export default withRouter(withStyles(styles, {withTheme: true})(StepperHorizontal));
+StepperHorizontal.propTypes = {
+ status: PropTypes.array.isRequired,
+ change: PropTypes.number.isRequired,
+};
+
+const mapStateToProps = state => ({
+ change: state.tutorial.change,
+ status: state.tutorial.status
+});
+
+export default connect(mapStateToProps, null)(withRouter(withStyles(styles, {withTheme: true})(StepperHorizontal)));
diff --git a/src/components/Tutorial/StepperVertical.js b/src/components/Tutorial/StepperVertical.js
index 34c94a8..48ea972 100644
--- a/src/components/Tutorial/StepperVertical.js
+++ b/src/components/Tutorial/StepperVertical.js
@@ -1,4 +1,6 @@
import React, { Component } from 'react';
+import PropTypes from 'prop-types';
+import { connect } from 'react-redux';
import { withRouter, Link } from 'react-router-dom';
@@ -20,33 +22,44 @@ const styles = (theme) => ({
padding: 0,
width: '30px',
},
- stepIconSmall: {
- border: `2px solid ${theme.palette.primary.main}`,
+ stepIcon: {
+ borderStyle: `solid`,
+ borderWith: '2px',
borderRadius: '50%',
width: '12px',
height: '12px',
margin: '0 auto'
},
stepIconMedium: {
- border: `2px solid ${theme.palette.primary.main}`,
- borderRadius: '50%',
width: '18px',
height: '18px',
- margin: '0 auto'
},
stepIconLarge: {
- border: `2px solid ${theme.palette.primary.main}`,
- borderRadius: '50%',
width: '24px',
height: '24px'
},
stepIconTransparent: {
- border: `2px solid transparent`,
+ borderColor: `transparent`,
cursor: 'default'
},
- stepIconActive: {
+ stepIconSuccess: {
+ borderColor: theme.palette.primary.main,
+ },
+ stepIconError: {
+ borderColor: theme.palette.error.dark,
+ },
+ stepIconOther: {
+ borderColor: theme.palette.secondary.main,
+ },
+ stepIconActiveSuccess: {
backgroundColor: fade(theme.palette.primary.main, 0.6)
},
+ stepIconActiveError: {
+ backgroundColor: fade(theme.palette.error.dark, 0.6)
+ },
+ stepIconActiveOther: {
+ backgroundColor: fade(theme.palette.secondary.main, 0.6)
+ },
progress: {
position: 'absolute',
top: 0,
@@ -76,7 +89,7 @@ class StepperVertical extends Component {
tutorials.slice(Number(this.props.match.params.tutorialId)-3-1, Number(this.props.match.params.tutorialId)+3)
: tutorials.slice(Number(this.props.match.params.tutorialId)-2-1,Number(this.props.match.params.tutorialId)+2),
tutorialId: Number(this.props.match.params.tutorialId),
- verticalTutorialId: Number(this.props.match.params.tutorialId)
+ selectedVerticalTutorialId: Number(this.props.match.params.tutorialId)
}
componentDidUpdate(props, state){
@@ -92,13 +105,13 @@ class StepperVertical extends Component {
tutorials.slice(Number(this.props.match.params.tutorialId)-3-1, Number(this.props.match.params.tutorialId)+3)
: tutorials.slice(Number(this.props.match.params.tutorialId)-2-1,Number(this.props.match.params.tutorialId)+2),
tutorialId: Number(this.props.match.params.tutorialId),
- verticalTutorialId: Number(this.props.match.params.tutorialId)
+ selectedVerticalTutorialId: Number(this.props.match.params.tutorialId)
})
}
}
verticalStepper = (step) => {
- var newTutorialId = this.state.verticalTutorialId + step;
+ var newTutorialId = this.state.selectedVerticalTutorialId + step;
var tutorialArray = Number(newTutorialId) === 1 ?
tutorials.slice(newTutorialId-1, newTutorialId+4)
: newTutorialId === 2 ?
@@ -108,18 +121,18 @@ class StepperVertical extends Component {
: newTutorialId === tutorials.length-1 ?
tutorials.slice(newTutorialId-3-1, newTutorialId+3)
: tutorials.slice(newTutorialId-2-1, newTutorialId+2);
- this.setState({ tutorialArray: tutorialArray, verticalTutorialId: newTutorialId });
+ this.setState({ tutorialArray: tutorialArray, selectedVerticalTutorialId: newTutorialId });
}
render() {
var tutorialId = this.state.tutorialId;
- var verticalTutorialId = this.state.verticalTutorialId;
+ var selectedVerticalTutorialId = this.state.selectedVerticalTutorialId;
return (
isWidthUp('sm', this.props.width) ?