Impelemented missing House Rules
This commit is contained in:
parent
25bb7d05a5
commit
279fc68718
@ -15,12 +15,16 @@ 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 Table from "@mui/material/Table";
|
||||
import TableBody from "@mui/material/TableBody";
|
||||
import TableCell from "@mui/material/TableCell";
|
||||
import TableContainer from "@mui/material/TableContainer";
|
||||
import TableRow from "@mui/material/TableRow";
|
||||
|
||||
// import "./HouseRules.css";
|
||||
|
||||
import { GlobalContext } from "./GlobalContext";
|
||||
import { Placard } from "./Placard";
|
||||
import { Box } from "@mui/material";
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
@ -404,7 +408,9 @@ const HouseRules: React.FC<HouseRulesProps> = ({ houseRulesActive }) => {
|
||||
|
||||
<DialogTitle>House Rules</DialogTitle>
|
||||
<DialogContent>
|
||||
<Box sx={{ display: "flex", flexDirection: "column" }}>
|
||||
<TableContainer>
|
||||
<Table>
|
||||
<TableBody>
|
||||
{ruleList.map((item) => {
|
||||
const defaultChecked = item.defaultChecked;
|
||||
if (!(item.key in rules)) {
|
||||
@ -418,11 +424,13 @@ const HouseRules: React.FC<HouseRulesProps> = ({ houseRulesActive }) => {
|
||||
}
|
||||
|
||||
return (
|
||||
<div key={item.key} className="HouseSelector">
|
||||
<div>
|
||||
<b>{item.label}</b>: {item.description}
|
||||
</div>
|
||||
<div>
|
||||
<React.Fragment key={item.key}>
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<b>{item.label}</b>
|
||||
</TableCell>
|
||||
<TableCell>{item.description}</TableCell>
|
||||
<TableCell>
|
||||
<Switch
|
||||
size={"small"}
|
||||
className="RuleSwitch"
|
||||
@ -431,12 +439,19 @@ const HouseRules: React.FC<HouseRulesProps> = ({ houseRulesActive }) => {
|
||||
onChange={(e) => setRule(e, item.key)}
|
||||
disabled={gameState !== "lobby" || !name}
|
||||
/>
|
||||
</div>
|
||||
{checked && item.element}
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
{checked && (
|
||||
<TableRow>
|
||||
<TableCell colSpan={3}>{item.element}</TableCell>
|
||||
</TableRow>
|
||||
)}
|
||||
</React.Fragment>
|
||||
);
|
||||
})}
|
||||
</Box>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={dismissClicked}>Close</Button>
|
||||
|
Loading…
x
Reference in New Issue
Block a user