diff options
author | lonkaars <l.leblansch@gmail.com> | 2021-02-03 09:35:55 +0100 |
---|---|---|
committer | lonkaars <l.leblansch@gmail.com> | 2021-02-03 09:35:55 +0100 |
commit | 66146fb2826cb06777558743bd70f91147fd27a0 (patch) | |
tree | 036047ce50d6ea3302659f862437eedf9e4c18a3 /components | |
parent | 2e290d9540cf69d64e3c3b460587ca9a60a3f0b5 (diff) |
working edit game rules :tada:
Diffstat (limited to 'components')
-rw-r--r-- | components/gameSettings.tsx | 10 | ||||
-rw-r--r-- | components/ui.tsx | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/components/gameSettings.tsx b/components/gameSettings.tsx index c41d55a..8bffeee 100644 --- a/components/gameSettings.tsx +++ b/components/gameSettings.tsx @@ -38,6 +38,12 @@ export class CurrentGameSettings extends Component { setGameRules = (newRules: ruleset) => this.setState({ ruleset: newRules }); render() { + var timelimit_str = this.state.ruleset.timelimit.enabled ? + `${this.state.ruleset.timelimit.minutes}m${this.state.ruleset.timelimit.seconds}s plus ${this.state.ruleset.timelimit.addmove}` : + "Geen tijdslimiet" + var ranked_str = this.state.ruleset.ranked ? + "Gerangschikt" : + "Niet gerangschikt" return <div style={{ position: "relative", height: 80, @@ -53,8 +59,8 @@ export class CurrentGameSettings extends Component { left: 0, transform: "translateY(-50%)" }}> - Geen tijdslimiet<br/> - Gerangschikt + {timelimit_str}<br/> + {ranked_str} </p> <Button style={{ width: 150, diff --git a/components/ui.tsx b/components/ui.tsx index 8745c67..ef9d8f3 100644 --- a/components/ui.tsx +++ b/components/ui.tsx @@ -74,7 +74,7 @@ export function Input(props: { min={props.min} max={props.max} placeholder={props.label} spellCheck={false} - value={props.value} + defaultValue={props.value ? String(props.value) : ""} style={{ padding: 12, border: 0, |