diff --git a/client/src/App.tsx b/client/src/App.tsx index 0050f9b..2c85016 100755 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -26,6 +26,7 @@ import { assetsPath } from "./Common"; // history replaced by react-router's useNavigate import "./App.css"; import equal from "fast-deep-equal"; +import { Box } from "@mui/material"; type AudioEffect = HTMLAudioElement & { hasPlayed?: boolean }; const audioEffects: Record = {}; @@ -407,7 +408,7 @@ const Table: React.FC = () => { )}
-
+ {error && (
@@ -454,11 +455,15 @@ const Table: React.FC = () => { {state === "normal" && } {color && state === "game-order" && } - {!winnerDismissed && } - {houseRulesActive && } + {!winnerDismissed && ( + + )} + {houseRulesActive && ( + + )} -
+
@@ -489,7 +494,9 @@ const Table: React.FC = () => { min="0" max="100" onInput={(e) => { - const alpha = parseFloat((e.currentTarget as HTMLInputElement).value) / 100; + const alpha = + parseFloat((e.currentTarget as HTMLInputElement).value) / + 100; localStorage.setItem("volume", alpha.toString()); setVolume(alpha); @@ -516,13 +523,25 @@ const Table: React.FC = () => { tradeActive: boolean; setTradeActive: (v: boolean) => void; }>; - return ; + return ( + + ); })()} {name !== "" && } {/* name !== "" && */} {loaded && ( )}
diff --git a/client/src/HouseRules.tsx b/client/src/HouseRules.tsx index f260a22..31ed75a 100644 --- a/client/src/HouseRules.tsx +++ b/client/src/HouseRules.tsx @@ -11,6 +11,10 @@ import equal from "fast-deep-equal"; import Paper from "@mui/material/Paper"; import Button from "@mui/material/Button"; import Switch from "@mui/material/Switch"; +import Dialog from "@mui/material/Dialog"; +import DialogTitle from "@mui/material/DialogTitle"; +import DialogContent from "@mui/material/DialogContent"; +import DialogActions from "@mui/material/DialogActions"; // import "./HouseRules.css"; @@ -396,52 +400,47 @@ const HouseRules: React.FC = ({ houseRulesActive }) => { } return ( - - House Rules - - {ruleList.map((item) => { - const defaultChecked = item.defaultChecked; - if (!(item.key in rules)) { - rules[item.key] = { - enabled: defaultChecked, - }; - } - const checked = rules[item.key].enabled; - if (checked !== state[item.key]) { - setState({ ...state, [item.key]: checked }); - } + + + House Rules + + + {ruleList.map((item) => { + const defaultChecked = item.defaultChecked; + if (!(item.key in rules)) { + rules[item.key] = { + enabled: defaultChecked, + }; + } + const checked = rules[item.key].enabled; + if (checked !== state[item.key]) { + setState({ ...state, [item.key]: checked }); + } - return ( -
-
- {item.label}: {item.description} + return ( +
+
+ {item.label}: {item.description} +
+
+ setRule(e, item.key)} + disabled={gameState !== "lobby" || !name} + /> +
+ {checked && item.element}
-
- setRule(e, item.key)} - disabled={gameState !== "lobby" || !name} - /> -
- {checked && item.element} -
- ); - })} - - + ); + })} + + + + + ); };