From 5cfb3c18de97241db9505af773c79e2bac94a641 Mon Sep 17 00:00:00 2001 From: Delucse <46593742+Delucse@users.noreply.github.com> Date: Tue, 15 Sep 2020 18:42:04 +0200 Subject: [PATCH] code-window is always visible for an assessment --- src/components/CodeViewer.js | 3 ++- src/components/Tutorial/Assessment.js | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/CodeViewer.js b/src/components/CodeViewer.js index bdf9677..e4f74da 100644 --- a/src/components/CodeViewer.js +++ b/src/components/CodeViewer.js @@ -7,6 +7,7 @@ import "prismjs/themes/prism.css"; import "prismjs/plugins/line-numbers/prism-line-numbers"; import "prismjs/plugins/line-numbers/prism-line-numbers.css"; +import withWidth from '@material-ui/core/withWidth'; import { withStyles } from '@material-ui/core/styles'; import MuiAccordion from '@material-ui/core/Accordion'; import MuiAccordionSummary from '@material-ui/core/AccordionSummary'; @@ -136,4 +137,4 @@ const mapStateToProps = state => ({ xml: state.workspace.code.xml }); -export default connect(mapStateToProps, null)(CodeViewer); +export default connect(mapStateToProps, null)(withWidth()(CodeViewer)); diff --git a/src/components/Tutorial/Assessment.js b/src/components/Tutorial/Assessment.js index 0ff93e0..ba67f0c 100644 --- a/src/components/Tutorial/Assessment.js +++ b/src/components/Tutorial/Assessment.js @@ -6,6 +6,7 @@ import BlocklyWindow from '../Blockly/BlocklyWindow'; import SolutionCheck from './SolutionCheck'; import CodeViewer from '../CodeViewer'; +import withWidth, { isWidthDown } from '@material-ui/core/withWidth'; import Grid from '@material-ui/core/Grid'; import Card from '@material-ui/core/Card'; import Typography from '@material-ui/core/Typography'; @@ -27,12 +28,12 @@ class Assessment extends Component { - + Arbeitsauftrag {currentTask.text1} - + @@ -54,4 +55,4 @@ const mapStateToProps = state => ({ currentTutorialId: state.tutorial.currentId }); -export default connect(mapStateToProps, null)(Assessment); +export default connect(mapStateToProps, null)(withWidth()(Assessment));