complete MUI migration

This commit is contained in:
fbruc03 2022-12-05 12:01:51 +01:00
parent 8716649be7
commit ae61d2b11b
30 changed files with 59 additions and 54 deletions

View File

@ -53,7 +53,7 @@ td {
padding-top: 12px; padding-top: 12px;
padding-bottom: 12px; padding-bottom: 12px;
text-align: left; text-align: left;
background-color: #4eaf47; border-color: #4eaf47;
color: white; color: white;
} }

View File

@ -9,11 +9,11 @@ import { loadUser } from "./actions/authActions";
import "./App.css"; import "./App.css";
import { ThemeProvider, StyledEngineProvider, createTheme, adaptV4Theme } from "@mui/material/styles"; import { ThemeProvider, StyledEngineProvider, createTheme } from "@mui/material/styles";
import Content from "./components/Content"; import Content from "./components/Content";
const theme = createTheme(adaptV4Theme({ const theme = createTheme({
palette: { palette: {
primary: { primary: {
main: "#4EAF47", main: "#4EAF47",
@ -26,7 +26,7 @@ const theme = createTheme(adaptV4Theme({
compile: "#e27136", compile: "#e27136",
}, },
}, },
})); });
class App extends Component { class App extends Component {
componentDidMount() { componentDidMount() {

View File

@ -30,7 +30,7 @@ class Breadcrumbs extends Component {
this.props.content && this.props.content.length > 0 ? this.props.content && this.props.content.length > 0 ?
<MaterialUIBreadcrumbs separator="" style={{marginBottom: '20px'}}> <MaterialUIBreadcrumbs separator="" style={{marginBottom: '20px'}}>
<Link to={'/'} style={{textDecoration: 'none'}}> <Link to={'/'} style={{textDecoration: 'none'}}>
<FontAwesomeIcon className={clsx(this.props.classes.home, this.props.classes.hover)} icon={faHome} size="xs"/> <FontAwesomeIcon className={clsx(this.props.classes.home, this.props.classes.hover)} icon={faHome} size="xs"/>
</Link> </Link>
{this.props.content.splice(0, this.props.content.length-1).map((content, i) => ( {this.props.content.splice(0, this.props.content.length-1).map((content, i) => (
<Link to={content.link} style={{textDecoration: 'none'}} key={i}> <Link to={content.link} style={{textDecoration: 'none'}} key={i}>

View File

@ -189,7 +189,7 @@ class Compile extends Component {
className={`compileBlocks ${this.props.classes.iconButton}`} className={`compileBlocks ${this.props.classes.iconButton}`}
onClick={() => this.compile()} onClick={() => this.compile()}
size="large"> size="large">
<FontAwesomeIcon icon={faClipboardCheck} size="xs" /> <FontAwesomeIcon icon={faClipboardCheck} size="xs" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
) : ( ) : (
@ -201,6 +201,7 @@ class Compile extends Component {
> >
<FontAwesomeIcon <FontAwesomeIcon
icon={faClipboardCheck} icon={faClipboardCheck}
style={{ marginRight: "5px" }} style={{ marginRight: "5px" }}
/>{" "} />{" "}
Kompilieren Kompilieren
@ -301,6 +302,7 @@ class Compile extends Component {
> >
<FontAwesomeIcon <FontAwesomeIcon
icon={faClipboardCheck} icon={faClipboardCheck}
style={{ marginRight: "5px" }} style={{ marginRight: "5px" }}
/>{" "} />{" "}
Starte Übertragung Starte Übertragung

View File

@ -17,6 +17,7 @@ const SaveIcon = ({ loading }) => (
<FontAwesomeIcon <FontAwesomeIcon
style={{ position: "absolute" }} style={{ position: "absolute" }}
icon={faCircleNotch} icon={faCircleNotch}
spin={true} spin={true}
size="2x" size="2x"
color="grey" color="grey"
@ -30,6 +31,7 @@ const SaveIcon = ({ loading }) => (
transform: "translate(-50%,-50%)", transform: "translate(-50%,-50%)",
}} }}
icon={faSave} icon={faSave}
color={loading ? "grey" : "green"} color={loading ? "grey" : "green"}
size={loading ? "1x" : "lg"} size={loading ? "1x" : "lg"}
/> />

View File

@ -161,7 +161,7 @@ class Home extends Component {
}} }}
onClick={() => this.onChange()} onClick={() => this.onChange()}
size="large"> size="large">
<FontAwesomeIcon icon={faCode} size="xs" /> <FontAwesomeIcon icon={faCode} size="xs" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>

View File

@ -214,11 +214,11 @@ class Navbar extends Component {
</div> </div>
<List> <List>
{[ {[
{ {
text: Blockly.Msg.navbar_blockly, text: Blockly.Msg.navbar_blockly,
icon: faPuzzlePiece, icon: faPuzzlePiece,
link: "/", link: "/",
}, },
{ {
text: Blockly.Msg.navbar_tutorials, text: Blockly.Msg.navbar_tutorials,
icon: faChalkboardTeacher, icon: faChalkboardTeacher,
@ -329,9 +329,9 @@ class Navbar extends Component {
onClick={ onClick={
item.function item.function
? () => { ? () => {
item.function(); item.function();
this.toggleDrawer(); this.toggleDrawer();
} }
: this.toggleDrawer : this.toggleDrawer
} }
> >

View File

@ -70,7 +70,7 @@ class Snackbar extends Component {
className={this.props.type === 'error' ? this.props.classes.error : this.props.classes.success} className={this.props.type === 'error' ? this.props.classes.error : this.props.classes.success}
action={ action={
<IconButton onClick={this.onClose} style={{color: 'inherit'}} size="large"> <IconButton onClick={this.onClose} style={{color: 'inherit'}} size="large">
<FontAwesomeIcon icon={faTimes} size="xs"/> <FontAwesomeIcon icon={faTimes} size="xs" />
</IconButton> </IconButton>
} }
message={this.props.message} message={this.props.message}

View File

@ -116,7 +116,7 @@ class Assessment extends Component {
}} }}
onClick={() => this.onChange()} onClick={() => this.onChange()}
size="large"> size="large">
<FontAwesomeIcon icon={faCode} size="xs" /> <FontAwesomeIcon icon={faCode} size="xs" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
<BlocklyWindow <BlocklyWindow

View File

@ -139,7 +139,6 @@ class BlocklyExample extends Component {
<Switch <Switch
checked={this.state.checked} checked={this.state.checked}
onChange={(e) => this.onChange(e.target.checked)} onChange={(e) => this.onChange(e.target.checked)}
color="primary"
/> />
} }
/> />

View File

@ -407,7 +407,7 @@ class Builder extends Component {
<FormControlLabel <FormControlLabel
style={{ color: "black" }} style={{ color: "black" }}
value="new" value="new"
control={<Radio color="primary" />} control={<Radio />}
label={Blockly.Msg.builder_createNew} label={Blockly.Msg.builder_createNew}
labelPlacement="end" labelPlacement="end"
/> />
@ -417,7 +417,7 @@ class Builder extends Component {
style={{ color: "black" }} style={{ color: "black" }}
disabled={this.props.index === 0} disabled={this.props.index === 0}
value="change" value="change"
control={<Radio color="primary" />} control={<Radio />}
label={Blockly.Msg.builder_changeExisting} label={Blockly.Msg.builder_changeExisting}
labelPlacement="end" labelPlacement="end"
/> />
@ -425,7 +425,7 @@ class Builder extends Component {
style={{ color: "black" }} style={{ color: "black" }}
disabled={this.props.index === 0} disabled={this.props.index === 0}
value="delete" value="delete"
control={<Radio color="primary" />} control={<Radio />}
label={Blockly.Msg.builder_deleteExisting} label={Blockly.Msg.builder_deleteExisting}
labelPlacement="end" labelPlacement="end"
/> />

View File

@ -97,7 +97,6 @@ class Media extends Component {
<Switch <Switch
checked={this.state.checked} checked={this.state.checked}
onChange={(e) => this.onChangeSwitch(e.target.checked)} onChange={(e) => this.onChangeSwitch(e.target.checked)}
color="primary"
/> />
} }
/> />
@ -106,13 +105,13 @@ class Media extends Component {
<RadioGroup row value={this.state.radioValue} onChange={(e) => {this.onChangeRadio(e.target.value);}}> <RadioGroup row value={this.state.radioValue} onChange={(e) => {this.onChangeRadio(e.target.value);}}>
<FormControlLabel style={{color: 'black'}} <FormControlLabel style={{color: 'black'}}
value="picture" value="picture"
control={<Radio color="primary" />} control={<Radio />}
label="Bild" label="Bild"
labelPlacement="end" labelPlacement="end"
/> />
<FormControlLabel style={{color: 'black'}} <FormControlLabel style={{color: 'black'}}
value="youtube" value="youtube"
control={<Radio color="primary" />} control={<Radio />}
label="Youtube-Video" label="Youtube-Video"
labelPlacement="end" labelPlacement="end"
/> />

View File

@ -63,7 +63,6 @@ class Public extends Component {
<Checkbox <Checkbox
checked={this.props.value} checked={this.props.value}
onChange={this.handleChange} onChange={this.handleChange}
color="primary"
name="checkedA" name="checkedA"
inputProps={{ "aria-label": "secondary checkbox" }} inputProps={{ "aria-label": "secondary checkbox" }}
/> />

View File

@ -41,7 +41,6 @@ class Requirements extends Component {
checked={this.props.value.filter(id => id === tutorial._id).length > 0} checked={this.props.value.filter(id => id === tutorial._id).length > 0}
onChange={(e) => this.onChange(e)} onChange={(e) => this.onChange(e)}
name="requirements" name="requirements"
color="primary"
/> />
} }
label={tutorial.title} label={tutorial.title}

View File

@ -64,7 +64,6 @@ class Review extends Component {
<Checkbox <Checkbox
checked={this.props.value} checked={this.props.value}
onChange={this.handleChange} onChange={this.handleChange}
color="primary"
name="checkedA" name="checkedA"
inputProps={{ "aria-label": "secondary checkbox" }} inputProps={{ "aria-label": "secondary checkbox" }}
/> />

View File

@ -86,7 +86,7 @@ class Step extends Component {
style={index === 0 ? {} : { marginBottom: "5px" }} style={index === 0 ? {} : { marginBottom: "5px" }}
onClick={() => this.props.addStep(index + 1)} onClick={() => this.props.addStep(index + 1)}
size="large"> size="large">
<FontAwesomeIcon icon={faPlus} size="xs" /> <FontAwesomeIcon icon={faPlus} size="xs" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
{index !== 0 ? ( {index !== 0 ? (
@ -101,7 +101,7 @@ class Step extends Component {
style={{ marginBottom: "5px" }} style={{ marginBottom: "5px" }}
onClick={() => this.props.changeStepIndex(index, index - 1)} onClick={() => this.props.changeStepIndex(index, index - 1)}
size="large"> size="large">
<FontAwesomeIcon icon={faAngleDoubleUp} size="xs" /> <FontAwesomeIcon icon={faAngleDoubleUp} size="xs" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
<Tooltip <Tooltip
@ -114,7 +114,7 @@ class Step extends Component {
style={{ marginBottom: "5px" }} style={{ marginBottom: "5px" }}
onClick={() => this.props.changeStepIndex(index, index + 1)} onClick={() => this.props.changeStepIndex(index, index + 1)}
size="large"> size="large">
<FontAwesomeIcon icon={faAngleDoubleDown} size="xs" /> <FontAwesomeIcon icon={faAngleDoubleDown} size="xs" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
<Tooltip title={`Schritt ${index + 1} löschen`} arrow> <Tooltip title={`Schritt ${index + 1} löschen`} arrow>
@ -126,7 +126,7 @@ class Step extends Component {
)} )}
onClick={() => this.props.removeStep(index)} onClick={() => this.props.removeStep(index)}
size="large"> size="large">
<FontAwesomeIcon icon={faTrash} size="xs" /> <FontAwesomeIcon icon={faTrash} size="xs" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
</div> </div>

View File

@ -23,14 +23,14 @@ class StepType extends Component {
<RadioGroup row value={this.props.value === 'task' ? 'task' : 'instruction'} onChange={(e) => this.onChange(e.target.value)}> <RadioGroup row value={this.props.value === 'task' ? 'task' : 'instruction'} onChange={(e) => this.onChange(e.target.value)}>
<FormControlLabel style={{color: 'black'}} <FormControlLabel style={{color: 'black'}}
value="instruction" value="instruction"
control={<Radio color="primary" />} control={<Radio />}
label="Anleitung" label="Anleitung"
labelPlacement="end" labelPlacement="end"
/> />
<FormControlLabel style={{color: 'black'}} <FormControlLabel style={{color: 'black'}}
disabled={this.props.index === 0} disabled={this.props.index === 0}
value="task" value="task"
control={<Radio color="primary" />} control={<Radio />}
label="Aufgabe" label="Aufgabe"
labelPlacement="end" labelPlacement="end"
/> />

View File

@ -98,7 +98,7 @@ class Hardware extends Component {
aria-label="Vollbild" aria-label="Vollbild"
onClick={() => this.handleClickOpen(hardwareInfo)} onClick={() => this.handleClickOpen(hardwareInfo)}
size="large"> size="large">
<FontAwesomeIcon icon={faExpandAlt} size="xs" /> <FontAwesomeIcon icon={faExpandAlt} size="xs" />
</IconButton> </IconButton>
} }
/> />

View File

@ -78,7 +78,6 @@ class HintTutorialExists extends Component {
checked={this.state.checked} checked={this.state.checked}
onChange={(e) => this.onChange(e)} onChange={(e) => this.onChange(e)}
name="dialog" name="dialog"
color="primary"
/> />
} }
label={Blockly.Msg.labels_donotshowagain} label={Blockly.Msg.labels_donotshowagain}

View File

@ -166,6 +166,7 @@ class Requirement extends Component {
icon={ icon={
tutorialStatus === "Success" ? faCheck : faTimes tutorialStatus === "Success" ? faCheck : faTimes
} }
/> />
) : ( ) : (
<Typography <Typography

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()}
size="large"> size="large">
<FontAwesomeIcon icon={faClipboardCheck} size="xs" /> <FontAwesomeIcon icon={faClipboardCheck} size="xs" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>

View File

@ -127,6 +127,7 @@ class StepperHorizontal extends Component {
<FontAwesomeIcon <FontAwesomeIcon
className={this.props.classes.icon} className={this.props.classes.icon}
icon={tutorialStatus === "Success" ? faCheck : faTimes} icon={tutorialStatus === "Success" ? faCheck : faTimes}
/> />
</div> </div>
) : null} ) : null}

View File

@ -287,6 +287,7 @@ class TutorialHome extends Component {
icon={ icon={
tutorialStatus === "Success" ? faCheck : faTimes tutorialStatus === "Success" ? faCheck : faTimes
} }
/> />
) : ( ) : (
<Typography <Typography
@ -380,7 +381,7 @@ class TutorialHome extends Component {
}); });
}} }}
size="large"> size="large">
<FontAwesomeIcon icon={faShareAlt} size="xs" /> <FontAwesomeIcon icon={faShareAlt} size="xs" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
<Tooltip <Tooltip
@ -391,7 +392,7 @@ class TutorialHome extends Component {
className={`publicTutorial ${this.props.classes.button}`} className={`publicTutorial ${this.props.classes.button}`}
disabled={!tutorial.public} disabled={!tutorial.public}
size="large"> size="large">
<FontAwesomeIcon icon={faEye} size="xs" /> <FontAwesomeIcon icon={faEye} size="xs" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
{tutorial.review ? ( {tutorial.review ? (

View File

@ -42,7 +42,7 @@ export class Account extends Component {
<ListItem> <ListItem>
<Tooltip title='Nutzername'> <Tooltip title='Nutzername'>
<ListItemIcon> <ListItemIcon>
<FontAwesomeIcon icon={faUser} /> <FontAwesomeIcon icon={faUser} />
</ListItemIcon> </ListItemIcon>
</Tooltip> </Tooltip>
<ListItemText primary={`Name: ${user.name}`} /> <ListItemText primary={`Name: ${user.name}`} />
@ -50,14 +50,14 @@ export class Account extends Component {
<ListItem> <ListItem>
<Tooltip title='Email'> <Tooltip title='Email'>
<ListItemIcon> <ListItemIcon>
<FontAwesomeIcon icon={faAt} /> <FontAwesomeIcon icon={faAt} />
</ListItemIcon> </ListItemIcon>
</Tooltip> </Tooltip>
<ListItemText primary={`Email: ${user.email}`} /> <ListItemText primary={`Email: ${user.email}`} />
</ListItem> </ListItem>
<ListItem> <ListItem>
<ListItemIcon> <ListItemIcon>
<FontAwesomeIcon icon={faUserTag} /> <FontAwesomeIcon icon={faUserTag} />
</ListItemIcon> </ListItemIcon>
<ListItemText primary={`Userrolle: ${user.blocklyRole}`} /> <ListItemText primary={`Userrolle: ${user.blocklyRole}`} />
</ListItem> </ListItem>
@ -98,7 +98,7 @@ export class Account extends Component {
<ListItem> <ListItem>
<Tooltip title='Modell'> <Tooltip title='Modell'>
<ListItemIcon> <ListItemIcon>
<FontAwesomeIcon icon={faBox} /> <FontAwesomeIcon icon={faBox} />
</ListItemIcon> </ListItemIcon>
</Tooltip> </Tooltip>
<div> <div>
@ -109,7 +109,7 @@ export class Account extends Component {
<ListItem> <ListItem>
<Tooltip title='Standort'> <Tooltip title='Standort'>
<ListItemIcon> <ListItemIcon>
<FontAwesomeIcon icon={faMapMarkerAlt} /> <FontAwesomeIcon icon={faMapMarkerAlt} />
</ListItemIcon> </ListItemIcon>
</Tooltip> </Tooltip>
<div> <div>
@ -120,7 +120,7 @@ export class Account extends Component {
<ListItem> <ListItem>
<Tooltip title='Sensoren'> <Tooltip title='Sensoren'>
<ListItemIcon> <ListItemIcon>
<FontAwesomeIcon icon={faCloudSunRain} /> <FontAwesomeIcon icon={faCloudSunRain} />
</ListItemIcon> </ListItemIcon>
</Tooltip> </Tooltip>
<div> <div>

View File

@ -165,6 +165,7 @@ export class Login extends Component {
<FontAwesomeIcon <FontAwesomeIcon
size="xs" size="xs"
icon={this.state.showPassword ? faEyeSlash : faEye} icon={this.state.showPassword ? faEyeSlash : faEye}
/> />
</IconButton> </IconButton>
</InputAdornment> </InputAdornment>

View File

@ -189,7 +189,7 @@ class Compile extends Component {
className={`compileBlocks ${this.props.classes.iconButton}`} className={`compileBlocks ${this.props.classes.iconButton}`}
onClick={() => this.compile()} onClick={() => this.compile()}
size="large"> size="large">
<FontAwesomeIcon icon={faClipboardCheck} size="xs" /> <FontAwesomeIcon icon={faClipboardCheck} size="xs" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
) : ( ) : (
@ -202,6 +202,7 @@ class Compile extends Component {
<FontAwesomeIcon <FontAwesomeIcon
icon={faClipboardCheck} icon={faClipboardCheck}
style={{ marginRight: "5px" }} style={{ marginRight: "5px" }}
/>{" "} />{" "}
Kompilieren Kompilieren
</Button> </Button>
@ -302,6 +303,7 @@ class Compile extends Component {
<FontAwesomeIcon <FontAwesomeIcon
icon={faClipboardCheck} icon={faClipboardCheck}
style={{ marginRight: "5px" }} style={{ marginRight: "5px" }}
/>{" "} />{" "}
Starte Übertragung Starte Übertragung
</Button> </Button>

View File

@ -62,7 +62,7 @@ class DeleteProject extends Component {
className={this.props.classes.buttonTrash} className={this.props.classes.buttonTrash}
onClick={() => this.props.deleteProject(this.props.projectType, this.props.project._id)} onClick={() => this.props.deleteProject(this.props.projectType, this.props.project._id)}
size="large"> size="large">
<FontAwesomeIcon icon={faTrashAlt} size="xs" /> <FontAwesomeIcon icon={faTrashAlt} size="xs" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>

View File

@ -47,7 +47,7 @@ class DownloadProject extends Component {
className={`saveBlocks ${this.props.classes.button}`} className={`saveBlocks ${this.props.classes.button}`}
onClick={() => this.downloadXmlFile()} onClick={() => this.downloadXmlFile()}
size="large"> size="large">
<FontAwesomeIcon icon={faFileDownload} size="xs" /> <FontAwesomeIcon icon={faFileDownload} size="xs" />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
</div> </div>

View File

@ -49,11 +49,11 @@ class ResetWorkspace extends Component {
} }
toggleDialog = () => { toggleDialog = () => {
this.setState({ open: !this.state}); this.setState({ open: !this.state });
} }
openDialog = () => { openDialog = () => {
this.setState({open: true}); this.setState({ open: true });
} }
resetWorkspace = () => { resetWorkspace = () => {
@ -82,7 +82,7 @@ class ResetWorkspace extends Component {
className={this.props.classes.button} className={this.props.classes.button}
onClick={() => this.openDialog()} onClick={() => this.openDialog()}
size="large"> size="large">
<FontAwesomeIcon icon={faShare} size="xs" flip='horizontal' /> <FontAwesomeIcon icon={faShare} size="xs" flip='horizontal' />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
@ -92,7 +92,7 @@ class ResetWorkspace extends Component {
type={this.state.type} type={this.state.type}
key={this.state.key} key={this.state.key}
/> />
<Dialog <Dialog
open={this.state.open} open={this.state.open}
title={Blockly.Msg.resetDialog_headline} title={Blockly.Msg.resetDialog_headline}
content={Blockly.Msg.resetDialog_text} content={Blockly.Msg.resetDialog_text}
@ -101,8 +101,8 @@ class ResetWorkspace extends Component {
button={Blockly.Msg.button_cancel} button={Blockly.Msg.button_cancel}
> <div style={{ marginTop: '10px' }}> > <div style={{ marginTop: '10px' }}>
<Button variant='contained' color='primary' onClick={() => { this.resetWorkspace(); this.toggleDialog(); }}>Zurücksetzen</Button> <Button variant='contained' color='primary' onClick={() => { this.resetWorkspace(); this.toggleDialog(); }}>Zurücksetzen</Button>
</div></Dialog> </div></Dialog>
</div> </div>
); );
}; };

View File

@ -152,6 +152,7 @@ class WorkspaceName extends Component {
<div style={{ width: "40px", display: "flex" }}> <div style={{ width: "40px", display: "flex" }}>
<FontAwesomeIcon <FontAwesomeIcon
icon={faPen} icon={faPen}
style={{ height: "18px", width: "18px", margin: "auto" }} style={{ height: "18px", width: "18px", margin: "auto" }}
/> />
</div> </div>