From 763d21dc09ea1ae5bf7bda03763386039de396a9 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 18 Apr 2021 19:34:00 +0200 Subject: edit game rules working (still some inline css) --- components/dialogBox.tsx | 19 ++++------ components/gameSettings.tsx | 85 ++++++++------------------------------------- 2 files changed, 22 insertions(+), 82 deletions(-) (limited to 'components') diff --git a/components/dialogBox.tsx b/components/dialogBox.tsx index 0a61762..4ead7c5 100644 --- a/components/dialogBox.tsx +++ b/components/dialogBox.tsx @@ -9,20 +9,15 @@ export function DialogBox(props: { title: string; onclick?: () => void; hidden?: boolean; + className?: string; }) { - return -

{props.title}

+ return +

{props.title}

- + {props.children}
; diff --git a/components/gameSettings.tsx b/components/gameSettings.tsx index 3c3a699..bb01284 100644 --- a/components/gameSettings.tsx +++ b/components/gameSettings.tsx @@ -30,60 +30,24 @@ export function CurrentGameSettings() { .catch(() => {}); }, []); - /* showEditGameRules = () => this.setState({ editGameRulesDialogVisible: true }); */ - /* hideEditGameRules = () => this.setState({ editGameRulesDialogVisible: false }); */ - /* setGameRules = (newRules: ruleset) => this.setState({ ruleset: newRules }); */ - var timelimit_str = ruleset.timelimit.enabled ? `${ruleset.timelimit.minutes}m${ruleset.timelimit.seconds}s plus ${ruleset.timelimit.addmove}` : 'Geen tijdslimiet'; var ranked_str = ruleset.ranked ? 'Gerangschikt' : 'Niet gerangschikt'; - return
-

+ return

+

{timelimit_str}
{ranked_str}

@@ -105,13 +69,7 @@ function GameSettingsSection(props: { }) { return