From 8823c09d3fa33eb4dc1d16316153021ee1516fba Mon Sep 17 00:00:00 2001 From: Mario Pesch Date: Tue, 1 Mar 2022 14:56:08 +0100 Subject: [PATCH] resolve some warnings --- src/components/CodeEditor/Compile.js | 2 +- src/components/TooltipViewer.js | 50 ++++++++++++++---------- src/components/Tutorial/SolutionCheck.js | 2 +- src/components/Workspace/Compile.js | 2 +- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/src/components/CodeEditor/Compile.js b/src/components/CodeEditor/Compile.js index 2a357af..b3d477e 100644 --- a/src/components/CodeEditor/Compile.js +++ b/src/components/CodeEditor/Compile.js @@ -190,7 +190,7 @@ class Compile extends Component { className={`compileBlocks ${this.props.classes.iconButton}`} onClick={() => this.compile()} > - + ) : ( diff --git a/src/components/TooltipViewer.js b/src/components/TooltipViewer.js index 47790e1..7d69a57 100644 --- a/src/components/TooltipViewer.js +++ b/src/components/TooltipViewer.js @@ -1,47 +1,55 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { connect } from 'react-redux'; +import React, { Component } from "react"; +import PropTypes from "prop-types"; +import { connect } from "react-redux"; -import withWidth from '@material-ui/core/withWidth'; +import withWidth from "@material-ui/core/withWidth"; -import { Card } from '@material-ui/core'; -import * as Blockly from 'blockly' -import CardContent from '@material-ui/core/CardContent'; +import { Card } from "@material-ui/core"; +import * as Blockly from "blockly"; +import CardContent from "@material-ui/core/CardContent"; -import Typography from '@material-ui/core/Typography'; -import ReactMarkdown from 'react-markdown'; +import Typography from "@material-ui/core/Typography"; +import ReactMarkdown from "react-markdown"; class TooltipViewer extends Component { - - render() { - return ( - + {Blockly.Msg.tooltip_viewer} - - {this.props.tooltip} - {this.props.helpurl !== '' ? {`${Blockly.Msg.tooltip_moreInformation} [${Blockly.Msg.labels_here}](${this.props.helpurl})`} : null} + + {this.props.tooltip} + - + {this.props.helpurl !== "" ? ( + {`${Blockly.Msg.tooltip_moreInformation} [${Blockly.Msg.labels_here}](${this.props.helpurl})`} + ) : null} ); - }; + } } TooltipViewer.propTypes = { tooltip: PropTypes.string.isRequired, - helpurl: PropTypes.string.isRequired + helpurl: PropTypes.string.isRequired, }; -const mapStateToProps = state => ({ +const mapStateToProps = (state) => ({ tooltip: state.workspace.code.tooltip, - helpurl: state.workspace.code.helpurl + helpurl: state.workspace.code.helpurl, }); export default connect(mapStateToProps, null)(withWidth()(TooltipViewer)); diff --git a/src/components/Tutorial/SolutionCheck.js b/src/components/Tutorial/SolutionCheck.js index 9c3e54d..0f1ddeb 100644 --- a/src/components/Tutorial/SolutionCheck.js +++ b/src/components/Tutorial/SolutionCheck.js @@ -63,7 +63,7 @@ class SolutionCheck extends Component { style={{ width: "40px", height: "40px", marginRight: "5px" }} onClick={() => this.check()} > - + diff --git a/src/components/Workspace/Compile.js b/src/components/Workspace/Compile.js index 2a357af..b3d477e 100644 --- a/src/components/Workspace/Compile.js +++ b/src/components/Workspace/Compile.js @@ -190,7 +190,7 @@ class Compile extends Component { className={`compileBlocks ${this.props.classes.iconButton}`} onClick={() => this.compile()} > - + ) : (