add DeviceSelection to CodeEditor,Project+Tutorial

This commit is contained in:
fbruc03 2022-11-15 16:22:29 +01:00
parent 6fcaff9cc3
commit 5974608fd8
3 changed files with 20 additions and 20 deletions

View File

@ -11,6 +11,7 @@ import Sidebar from "./Sidebar";
import Dialog from "../Dialog"; import Dialog from "../Dialog";
import SaveIcon from "./SaveIcon"; import SaveIcon from "./SaveIcon";
import store from "../../store"; import store from "../../store";
import DeviceSelection from "../DeviceSelection";
const CodeEditor = (props) => { const CodeEditor = (props) => {
//const [filehandle, setFileHandle] = useState(); //const [filehandle, setFileHandle] = useState();
@ -192,6 +193,7 @@ void loop() {
}} }}
/> />
</Grid> </Grid>
<DeviceSelection />
<Grid item lg={4} md={4}> <Grid item lg={4} md={4}>
<Button <Button
style={{ padding: "1rem", margin: "1rem" }} style={{ padding: "1rem", margin: "1rem" }}

View File

@ -18,6 +18,7 @@ import Divider from "@material-ui/core/Divider";
import Typography from "@material-ui/core/Typography"; import Typography from "@material-ui/core/Typography";
import Backdrop from "@material-ui/core/Backdrop"; import Backdrop from "@material-ui/core/Backdrop";
import CircularProgress from "@material-ui/core/CircularProgress"; import CircularProgress from "@material-ui/core/CircularProgress";
import DeviceSelection from "../DeviceSelection";
const styles = (theme) => ({ const styles = (theme) => ({
link: { link: {
@ -60,9 +61,8 @@ class ProjectHome extends Component {
this.setState({ this.setState({
snackbar: true, snackbar: true,
key: Date.now(), key: Date.now(),
message: `Dein angefragtes ${ message: `Dein angefragtes ${type === "gallery" ? "Galerie-" : ""
type === "gallery" ? "Galerie-" : "" }Projekt konnte nicht gefunden werden.`,
}Projekt konnte nicht gefunden werden.`,
type: "error", type: "error",
}); });
} }
@ -108,6 +108,7 @@ class ProjectHome extends Component {
/> />
<h1>{data}</h1> <h1>{data}</h1>
<DeviceSelection />
{this.props.progress ? ( {this.props.progress ? (
<Backdrop open invisible> <Backdrop open invisible>
<CircularProgress color="primary" /> <CircularProgress color="primary" />
@ -127,9 +128,8 @@ class ProjectHome extends Component {
}} }}
> >
<Link <Link
to={`/${ to={`/${data === "Projekte" ? "project" : "gallery"
data === "Projekte" ? "project" : "gallery" }/${project._id}`}
}/${project._id}`}
style={{ textDecoration: "none", color: "inherit" }} style={{ textDecoration: "none", color: "inherit" }}
> >
<h3 style={{ marginTop: 0 }}>{project.title}</h3> <h3 style={{ marginTop: 0 }}>{project.title}</h3>
@ -153,7 +153,7 @@ class ProjectHome extends Component {
</Typography> </Typography>
</Link> </Link>
{this.props.user && {this.props.user &&
this.props.user.email === project.creator ? ( this.props.user.email === project.creator ? (
<div> <div>
<Divider <Divider
style={{ style={{

View File

@ -37,6 +37,7 @@ import Tooltip from "@material-ui/core/Tooltip";
import IconButton from "@material-ui/core/IconButton"; import IconButton from "@material-ui/core/IconButton";
import Snackbar from "../Snackbar"; import Snackbar from "../Snackbar";
import Divider from "@material-ui/core/Divider"; import Divider from "@material-ui/core/Divider";
import DeviceSelection from "../DeviceSelection";
const styles = (theme) => ({ const styles = (theme) => ({
outerDiv: { outerDiv: {
@ -243,14 +244,11 @@ class TutorialHome extends Component {
cy="50%" cy="50%"
fill="none" fill="none"
stroke-width="10" stroke-width="10"
stroke-dashoffset={`${ stroke-dashoffset={`${75 * 2 * Math.PI * (1 - (50 / 100 + success / 2))
75 * 2 * Math.PI * (1 - (50 / 100 + success / 2)) }`}
}`} stroke-dasharray={`${75 * 2 * Math.PI * (1 - (50 / 100 - success / 2))
stroke-dasharray={`${ } ${75 * 2 * Math.PI * (1 - (50 / 100 + success / 2))
75 * 2 * Math.PI * (1 - (50 / 100 - success / 2)) }`}
} ${
75 * 2 * Math.PI * (1 - (50 / 100 + success / 2))
}`}
></circle> ></circle>
)} )}
{success < 1 && !error ? ( {success < 1 && !error ? (
@ -265,9 +263,8 @@ class TutorialHome extends Component {
cy="50%" cy="50%"
fill="none" fill="none"
stroke-width="10" stroke-width="10"
stroke-dashoffset={`${ stroke-dashoffset={`${75 * 2 * Math.PI * (1 - (50 / 100 + success / 2))
75 * 2 * Math.PI * (1 - (50 / 100 + success / 2)) }`}
}`}
stroke-dasharray={`${75 * 2 * Math.PI}`} stroke-dasharray={`${75 * 2 * Math.PI}`}
></circle> ></circle>
) : null} ) : null}
@ -279,8 +276,8 @@ class TutorialHome extends Component {
tutorialStatus === "Error" tutorialStatus === "Error"
? this.props.classes.outerDivError ? this.props.classes.outerDivError
: tutorialStatus === "Success" : tutorialStatus === "Success"
? this.props.classes.outerDivSuccess ? this.props.classes.outerDivSuccess
: null : null
)} )}
> >
<div className={this.props.classes.innerDiv}> <div className={this.props.classes.innerDiv}>
@ -311,6 +308,7 @@ class TutorialHome extends Component {
); );
})} })}
</Grid> </Grid>
<DeviceSelection />
{this.props.user ? ( {this.props.user ? (
<div> <div>
<h2>User Tutorials</h2> <h2>User Tutorials</h2>