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 {
callback: () => boolean;
}
export const ConnectionBauble = (props: baubleProps): React.ReactElement => {
const [connection, setConnection] = useState(props.callback())
export const ConnectionBauble = (props: baubleProps): React.ReactElement => {
const [connection, setConnection] = useState(props.callback());
useEffect(() => {
setInterval(() => {
@ -13,9 +13,5 @@ export const ConnectionBauble = (props: baubleProps): React.ReactElement => {
}, 1000);
});
return (
<div className="ConnectionBauble">
{connection? "Connected" : "Disconnected"}
</div>
);
}
return <div className="ConnectionBauble">{connection ? "Connected" : "Disconnected"}</div>;
};

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