diff options
author | lonkaars <l.leblansch@gmail.com> | 2021-02-01 11:48:31 +0100 |
---|---|---|
committer | lonkaars <l.leblansch@gmail.com> | 2021-02-01 11:48:31 +0100 |
commit | 1e415fe064cde08e2fdae55ac3846d60d492a700 (patch) | |
tree | 1635a67690e0db6e299832de501798dd7a9e6425 /components | |
parent | ee1c55cf82fc8155d61cbe8b9357af910670e9fd (diff) |
input min/max
Diffstat (limited to 'components')
-rw-r--r-- | components/gameSettings.tsx | 15 | ||||
-rw-r--r-- | components/ui.tsx | 18 |
2 files changed, 23 insertions, 10 deletions
diff --git a/components/gameSettings.tsx b/components/gameSettings.tsx index c037fe3..15e3591 100644 --- a/components/gameSettings.tsx +++ b/components/gameSettings.tsx @@ -120,10 +120,15 @@ function GameSettingsSection(props: { </GameSettingsSection> */ -export class EditGameSettings extends Component<{ +type editGameSettingsProps = { parentState: { editGameRulesDialogVisible: boolean; }; hideEditGameRules: () => void; -}> { +}; + +export class EditGameSettings extends Component<editGameSettingsProps> { + constructor(props: editGameSettingsProps) { + super(props); + } render () { return <DialogBox title="Spelregels aanpassen" style={{ @@ -143,9 +148,9 @@ export class EditGameSettings extends Component<{ gridGap: 16, margin: "16px 0" }}> - <Input type="number" label="min"/> - <Input type="number" label="sec"/> - <Input type="number" label="plus"/> + <Input type="number" label="min" min={0} max={60}/> + <Input type="number" label="sec" min={0} max={60}/> + <Input type="number" label="plus" min={0}/> </div> <CheckBox state={false}/> <span style={{ diff --git a/components/ui.tsx b/components/ui.tsx index 3afd97a..492bab7 100644 --- a/components/ui.tsx +++ b/components/ui.tsx @@ -58,12 +58,20 @@ export function Button(props: { } export function Input(props: { - label?: string, - style?: CSSProperties, - type?: string, - id?: string + label?: string; + style?: CSSProperties; + type?: string; + id?: string; + min?: number; + max?: number; }) { - return <input id={props.id} type={props.type || "text"} placeholder={props.label} spellCheck={false} style={{ + return <input + id={props.id} + type={props.type || "text"} + min={props.min} max={props.max} + placeholder={props.label} + spellCheck={false} + style={{ padding: 12, border: 0, width: "calc(100% - 24px)", |