This commit is contained in:
Zoë Hoekstra 2022-08-11 19:21:30 +02:00
parent 725fb05bb3
commit a6ee9a8c76
No known key found for this signature in database
GPG Key ID: F9B7B7D8130F3323
2 changed files with 6 additions and 10 deletions

@ -1,11 +1,11 @@
import React, {useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
interface baubleProps { interface baubleProps {
callback: () => boolean; callback: () => boolean;
} }
export const ConnectionBauble = (props: baubleProps): React.ReactElement => { export const ConnectionBauble = (props: baubleProps): React.ReactElement => {
const [connection, setConnection] = useState(props.callback()) const [connection, setConnection] = useState(props.callback());
useEffect(() => { useEffect(() => {
setInterval(() => { setInterval(() => {
@ -13,9 +13,5 @@ export const ConnectionBauble = (props: baubleProps): React.ReactElement => {
}, 1000); }, 1000);
}); });
return ( return <div className="ConnectionBauble">{connection ? "Connected" : "Disconnected"}</div>;
<div className="ConnectionBauble"> };
{connection? "Connected" : "Disconnected"}
</div>
);
}

@ -9,7 +9,7 @@ import { GameOptionsTab } from "../GameOptionsTab";
import { GameOptionsPage } from "./GameOptionsPage"; import { GameOptionsPage } from "./GameOptionsPage";
import { OptionsSlider } from "./OptionsSlider"; import { OptionsSlider } from "./OptionsSlider";
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
import { ConnectionBaub, ConnectionBauble } from "./ConnectionBauble"; import { ConnectionBauble } from "./ConnectionBauble";
interface IProps { interface IProps {
currentTab: GameOptionsTab; currentTab: GameOptionsTab;