resolve some warnings

This commit is contained in:
Mario Pesch 2022-03-01 14:56:08 +01:00
parent d62a27c2cc
commit 8823c09d3f
4 changed files with 32 additions and 24 deletions

View File

@ -190,7 +190,7 @@ class Compile extends Component {
className={`compileBlocks ${this.props.classes.iconButton}`} className={`compileBlocks ${this.props.classes.iconButton}`}
onClick={() => this.compile()} onClick={() => this.compile()}
> >
<FontAwesomeIcon icon={faClipboardCheck} size="m" /> <FontAwesomeIcon icon={faClipboardCheck} size="xs" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
) : ( ) : (

View File

@ -1,47 +1,55 @@
import React, { Component } from 'react'; import React, { Component } from "react";
import PropTypes from 'prop-types'; import PropTypes from "prop-types";
import { connect } from 'react-redux'; 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 { Card } from "@material-ui/core";
import * as Blockly from 'blockly' import * as Blockly from "blockly";
import CardContent from '@material-ui/core/CardContent'; import CardContent from "@material-ui/core/CardContent";
import Typography from '@material-ui/core/Typography'; import Typography from "@material-ui/core/Typography";
import ReactMarkdown from 'react-markdown'; import ReactMarkdown from "react-markdown";
class TooltipViewer extends Component { class TooltipViewer extends Component {
render() { render() {
return ( return (
<Card className="tooltipViewer" style={{ height: '100%', margin: '1vH 0 0 0', maxHeight: '19vH', overflow: 'auto' }} ref={this.myDiv}> <Card
className="tooltipViewer"
style={{
height: "100%",
margin: "1vH 0 0 0",
maxHeight: "19vH",
overflow: "auto",
}}
ref={this.myDiv}
>
<CardContent> <CardContent>
<Typography variant="h5" component="h2"> <Typography variant="h5" component="h2">
{Blockly.Msg.tooltip_viewer} {Blockly.Msg.tooltip_viewer}
</Typography> </Typography>
<Typography variant="body2" component="p">
<ReactMarkdown linkTarget="_blank">{this.props.tooltip}</ReactMarkdown>
{this.props.helpurl !== '' ? <ReactMarkdown>{`${Blockly.Msg.tooltip_moreInformation} [${Blockly.Msg.labels_here}](${this.props.helpurl})`}</ReactMarkdown> : null} <ReactMarkdown linkTarget="_blank">
{this.props.tooltip}
</ReactMarkdown>
</Typography> {this.props.helpurl !== "" ? (
<ReactMarkdown>{`${Blockly.Msg.tooltip_moreInformation} [${Blockly.Msg.labels_here}](${this.props.helpurl})`}</ReactMarkdown>
) : null}
</CardContent> </CardContent>
</Card> </Card>
); );
}; }
} }
TooltipViewer.propTypes = { TooltipViewer.propTypes = {
tooltip: PropTypes.string.isRequired, tooltip: PropTypes.string.isRequired,
helpurl: PropTypes.string.isRequired helpurl: PropTypes.string.isRequired,
}; };
const mapStateToProps = state => ({ const mapStateToProps = (state) => ({
tooltip: state.workspace.code.tooltip, tooltip: state.workspace.code.tooltip,
helpurl: state.workspace.code.helpurl helpurl: state.workspace.code.helpurl,
}); });
export default connect(mapStateToProps, null)(withWidth()(TooltipViewer)); export default connect(mapStateToProps, null)(withWidth()(TooltipViewer));

View File

@ -63,7 +63,7 @@ class SolutionCheck extends Component {
style={{ width: "40px", height: "40px", marginRight: "5px" }} style={{ width: "40px", height: "40px", marginRight: "5px" }}
onClick={() => this.check()} onClick={() => this.check()}
> >
<FontAwesomeIcon icon={faClipboardCheck} size="m" /> <FontAwesomeIcon icon={faClipboardCheck} size="xs" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>

View File

@ -190,7 +190,7 @@ class Compile extends Component {
className={`compileBlocks ${this.props.classes.iconButton}`} className={`compileBlocks ${this.props.classes.iconButton}`}
onClick={() => this.compile()} onClick={() => this.compile()}
> >
<FontAwesomeIcon icon={faClipboardCheck} size="m" /> <FontAwesomeIcon icon={faClipboardCheck} size="xs" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
) : ( ) : (