From c11ff8fc6cb7bf772d105815d7b492528911eae2 Mon Sep 17 00:00:00 2001 From: Delucse <46593742+Delucse@users.noreply.github.com> Date: Fri, 4 Sep 2020 15:26:59 +0200 Subject: [PATCH] show vertical stepper not on extrasmall displays --- src/components/Tutorial/StepperVertical.js | 127 +++++++++++---------- src/components/Tutorial/Tutorial.js | 5 +- 2 files changed, 67 insertions(+), 65 deletions(-) diff --git a/src/components/Tutorial/StepperVertical.js b/src/components/Tutorial/StepperVertical.js index 6d25d1b..7d89bb8 100644 --- a/src/components/Tutorial/StepperVertical.js +++ b/src/components/Tutorial/StepperVertical.js @@ -8,12 +8,12 @@ import tutorials from './tutorials.json'; import { fade } from '@material-ui/core/styles/colorManipulator'; import { withStyles } from '@material-ui/core/styles'; +import withWidth, { isWidthUp } from '@material-ui/core/withWidth'; import Button from '@material-ui/core/Button'; import Stepper from '@material-ui/core/Stepper'; import Step from '@material-ui/core/Step'; import StepLabel from '@material-ui/core/StepLabel'; import Tooltip from '@material-ui/core/Tooltip'; -import LinearProgress from '@material-ui/core/LinearProgress'; const styles = (theme) => ({ verticalStepper: { @@ -115,71 +115,72 @@ class StepperVertical extends Component { var tutorialId = this.state.tutorialId; var verticalTutorialId = this.state.verticalTutorialId; return ( -
- -
-
-
-
-
-
-
-
} - classes={{root: this.props.classes.verticalStepper}} + isWidthUp('sm', this.props.width) ? +
+
- - -
+ clsx(this.props.classes.stepIconLarge, this.props.classes.stepIconActive) + : this.props.classes.stepIconLarge + : tutorial === tutorials[verticalTutorialId-2] || tutorial === tutorials[verticalTutorialId] ? + tutorial === tutorials[tutorialId-1] ? + clsx(this.props.classes.stepIconMedium, this.props.classes.stepIconActive) + : this.props.classes.stepIconMedium + : tutorial === tutorials[tutorialId-1] ? + clsx(this.props.classes.stepIconSmall, this.props.classes.stepIconActive) + : this.props.classes.stepIconSmall + }} + > + + + + + )})} + + + + + : null ); }; } -export default withRouter(withStyles(styles, {withTheme: true})(StepperVertical)); +export default withRouter(withStyles(styles, {withTheme: true})(withWidth()(StepperVertical))); diff --git a/src/components/Tutorial/Tutorial.js b/src/components/Tutorial/Tutorial.js index caebc9d..7a2ccf0 100644 --- a/src/components/Tutorial/Tutorial.js +++ b/src/components/Tutorial/Tutorial.js @@ -9,6 +9,7 @@ import NotFound from '../NotFound'; import tutorials from './tutorials.json'; +import withWidth, { isWidthUp } from '@material-ui/core/withWidth'; import Tabs from '@material-ui/core/Tabs'; import Tab from '@material-ui/core/Tab'; import Grid from '@material-ui/core/Grid'; @@ -47,7 +48,7 @@ class Tutorial extends Component { {/* width of vertical stepper is 30px*/} - +