import React, {Component} from "react"; import { Backdrop, Box, CircularProgress, Fade, Modal, Stack, Typography, Button, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions } from "@mui/material"; import {FunctionTest} from "../IPCConstants"; interface StartupState { statusTxt: string, open: boolean, nextStep: boolean, cloudConnect: boolean, connectionIssue: boolean, openWifiQuestion: boolean, } export default class Startup extends Component<{}, StartupState> { constructor(props: {}) { super(props); this.state = { statusTxt: "Smart-Monopoly wird gestartet...", open: false, nextStep: false, cloudConnect: false, connectionIssue: false, openWifiQuestion: false }; } componentDidMount() { setTimeout(() => { this.setState((prevState) => ({ ...prevState, open: true, statusTxt: "Möchten Sie CloudConnect+ nutzen?" })); this.cloudDecision(true).then(); }, 1) } componentWillUnmount() { } connectToCloud = () => { } checkForNext = () => { if(this.state.cloudConnect) { // Connect to cloud } else { // Just start } } handleClose = () => this.setState((prevState) => ({ ...prevState, open: false })); style = { position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', width: 600, bgcolor: 'background.paper', border: '2px solid #0000', boxShadow: 24, p: 4, }; async cloudDecision(decision: boolean) { this.handleClose(); this.setState((prevState) => ({ ...prevState, cloudConnect: decision, openWifiQuestion: false })); if(decision) { this.setState((prevState) => ({ ...prevState, statusTxt: "WiFi-Verbindung wird hergestellt..." })); let status = (await window.api.request("FUNCTION_TEST", {})).data as FunctionTest; if(!status.hasInternet) { this.setState((prevState) => ({ ...prevState, openWifiQuestion: true })); } else { this.checkForNext(); } } else { this.setState((prevState) => ({ ...prevState, statusTxt: "Ready to go!" })); this.checkForNext(); } } render() { return
Keine Internetverbindung! Es wurde keine Internetverbindung erkannt.

Möchten Sie eine WLAN-Verbindung einrichten?
Andernfalls können Sie SmartMonopoly offline nutzen.
CloudConnect+ nutzen? Möchten Sie für diese Sitzung CloudConnect+ aktivieren, um das mitspielen mit Mobilen Endgeräten zu ermöglichen?
Dafür wird eine WiFi-Verbindung hergestellt

Willkommen!


{this.state.statusTxt}


} }