diff options
-rw-r--r-- | components/gameSettings.tsx | 10 | ||||
-rw-r--r-- | components/ui.tsx | 2 | ||||
-rw-r--r-- | pages/index.tsx | 2 |
3 files changed, 10 insertions, 4 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, diff --git a/pages/index.tsx b/pages/index.tsx index ff4e2b7..d56c70b 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -70,7 +70,7 @@ export default class HomePage extends Component { info: request.data, loggedIn: request.status == 200 })) - .catch(console.log); + .catch(() => {}); } constructor(props: {}) { |