From 9df7de05f43b21b6a21688aa1899a0896d7a7177 Mon Sep 17 00:00:00 2001 From: Delucse <46593742+Delucse@users.noreply.github.com> Date: Mon, 21 Sep 2020 12:16:10 +0200 Subject: [PATCH] adjustment of colours and messages in case of error --- .../Tutorial/Builder/BlocklyExample.js | 2 +- src/components/Tutorial/Builder/Hardware.js | 2 +- src/components/Tutorial/Builder/Id.js | 18 +++++++++++++++--- src/components/Tutorial/Builder/Textfield.js | 17 ++++++++++++++--- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/components/Tutorial/Builder/BlocklyExample.js b/src/components/Tutorial/Builder/BlocklyExample.js index 2ecfa12..5b2c5b3 100644 --- a/src/components/Tutorial/Builder/BlocklyExample.js +++ b/src/components/Tutorial/Builder/BlocklyExample.js @@ -97,7 +97,7 @@ class BlocklyExample extends Component { /> : Musterlösung} {this.state.checked ? !this.props.value || this.props.error ? - Reiche deine Blöcke ein, indem du auf den rot gefärbten Button klickst. + {`Reiche deine Blöcke ein, indem du auf den '${this.props.task ? 'Musterlösung einreichen' : 'Beispiel einreichen'}'-Button klickst.`} : this.state.input ? Die letzte Einreichung erfolgte um {this.state.input} Uhr. : null : null} {this.state.checked ? (() => { diff --git a/src/components/Tutorial/Builder/Hardware.js b/src/components/Tutorial/Builder/Hardware.js index fa0f452..f469851 100644 --- a/src/components/Tutorial/Builder/Hardware.js +++ b/src/components/Tutorial/Builder/Hardware.js @@ -68,7 +68,7 @@ class Requirements extends Component {
Hardware Beachte, dass die Reihenfolge des Auswählens maßgebend ist. - {this.props.error ? Wähle mindestens eine Hardware aus. : null} + {this.props.error ? Wähle mindestens eine Hardware-Komponente aus. : null} {hardware.map((picture,i) => ( this.onChange(picture.id)} classes={{tile: this.props.value.filter(value => value === picture.id).length > 0 ? this.props.classes.active : this.props.classes.border}}> diff --git a/src/components/Tutorial/Builder/Id.js b/src/components/Tutorial/Builder/Id.js index bb4ebde..964f812 100644 --- a/src/components/Tutorial/Builder/Id.js +++ b/src/components/Tutorial/Builder/Id.js @@ -16,6 +16,12 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; const styles = theme => ({ errorColor: { color: theme.palette.error.dark + }, + errorColorShrink: { + color: `rgba(0, 0, 0, 0.54) !important` + }, + errorBorder: { + borderColor: `${theme.palette.error.dark} !important` } }); @@ -53,10 +59,16 @@ class Id extends Component { render() { return (
- - ID + + + ID + {this.props.error ? Gib eine positive ganzzahlige Zahl ein. : null} - Beachte, dass die ID eindeutig sein muss. Sie muss sich also zu den anderen Tutorials unterscheiden. + Beachte, dass die ID eindeutig sein muss. Sie muss sich also zu den anderen Tutorials unterscheiden.
); }; diff --git a/src/components/Tutorial/Builder/Textfield.js b/src/components/Tutorial/Builder/Textfield.js index 46bae8f..d601784 100644 --- a/src/components/Tutorial/Builder/Textfield.js +++ b/src/components/Tutorial/Builder/Textfield.js @@ -14,7 +14,13 @@ const styles = theme => ({ padding: '18.5px 14px 18.5px 24px' }, errorColor: { - color: theme.palette.error.dark + color: `${theme.palette.error.dark} !important` + }, + errorColorShrink: { + color: `rgba(0, 0, 0, 0.54) !important` + }, + errorBorder: { + borderColor: `${theme.palette.error.dark} !important` } }); @@ -48,10 +54,15 @@ class Textfield extends Component { render() { return ( - {this.props.label} + + {this.props.label} +