aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-01-08 16:49:34 +0100
committerlonkaars <l.leblansch@gmail.com>2021-01-08 16:49:34 +0100
commita3d251baadf15b412ef85e063f5fbb48fdb0f32a (patch)
tree92d6622669cbde2a34343bc4ff988e49e4a98de7
parentd16049cbcde6c4b1de048f8c2f2fde859ac89564 (diff)
1e aangepaste spelregels dinges klaar
-rw-r--r--src/components/gameSettings.tsx41
-rw-r--r--src/components/ui.tsx40
-rw-r--r--src/pages/game.tsx4
-rw-r--r--src/routes.tsx1
4 files changed, 63 insertions, 23 deletions
diff --git a/src/components/gameSettings.tsx b/src/components/gameSettings.tsx
index 19eadb7..79a5029 100644
--- a/src/components/gameSettings.tsx
+++ b/src/components/gameSettings.tsx
@@ -1,6 +1,6 @@
import { ReactNode } from 'react';
-import { Button, Vierkant, CheckBox } from './ui';
+import { Button, Vierkant, CheckBox, Input } from './ui';
import { DialogBox } from './dialogBox';
import BuildRoundedIcon from '@material-ui/icons/BuildRounded';
@@ -46,18 +46,29 @@ export function CurrentGameSettings(/*props: CurrentGameSettingsProps*/) {
</div>;
}
-interface GameSettingsSectionProps {
+function GameSettingsSection(props: {
children?: ReactNode;
title: string;
state: boolean;
-}
-
-function GameSettingsSection(props: GameSettingsSectionProps) {
+}) {
return <Vierkant style={{
backgroundColor: "var(--background-alt)",
- width: "calc(100% - 12px)"
+ width: "calc(100% - 12px)",
+ padding: 16
}}>
- <div>{props.children}</div>
+ <span style={{
+ verticalAlign: "top",
+ fontSize: 14,
+ fontWeight: 600
+ }}>{props.title}</span>
+ <CheckBox state={props.state} style={{
+ verticalAlign: "top",
+ float: "right",
+ margin: -3
+ }}/>
+ <div style={{
+ marginTop: 16
+ }}>{props.children}</div>
</Vierkant>
}
@@ -68,8 +79,22 @@ export function EditGameSettings() {
maxHeight: 500,
overflowY: "scroll"
}}>
- <CheckBox state={false}/>
<GameSettingsSection title="Tijdslimiet" state={false}>
+ <div style={{
+ display: "grid",
+ gridTemplateColumns: "1fr 1fr 1fr",
+ gridGap: 16,
+ marginBottom: 16
+ }}>
+ <Input type="number" label="min"/>
+ <Input type="number" label="sec"/>
+ <Input type="number" label="plus"/>
+ </div>
+ <CheckBox state={false}/>
+ <span style={{
+ verticalAlign: "super",
+ marginLeft: 4
+ }}>Timer gebruiken voor bijde spelers</span>
</GameSettingsSection>
</div>
</DialogBox>;
diff --git a/src/components/ui.tsx b/src/components/ui.tsx
index a9ca479..4f836c2 100644
--- a/src/components/ui.tsx
+++ b/src/components/ui.tsx
@@ -54,23 +54,35 @@ export function Button(props: {
</div>;
}
-export function Input(props: { label?: string }) {
+export function Input(props: {
+ label?: string,
+ style?: CSSProperties,
+ type?: string
+}) {
+ return <input type={props.type || "text"} placeholder={props.label} spellCheck={false} style={{
+ padding: 12,
+ border: 0,
+ width: "calc(100% - 24px)",
+ fontSize: 14,
+ backgroundColor: "var(--page-background)",
+ color: "var(--text-alt)",
+ borderRadius: 8,
+ fontFamily: "Inter",
+ ...props.style
+ }}/>
+}
+
+export function SearchBar(props: { label?: string }) {
return <div style={{
marginTop: 24,
borderRadius: 8,
overflow: "hidden",
width: "100%"
}}>
- <input type="text" placeholder={props.label} spellCheck={false} style={{
- padding: 12,
- border: 0,
+ <Input label={props.label} style={{
width: "calc(100% - 24px - 41px)",
- fontSize: 14,
- backgroundColor: "var(--page-background)",
- color: "var(--text-alt)",
- borderBottomLeftRadius: 8,
- borderTopLeftRadius: 8,
- fontFamily: "Inter"
+ borderTopRightRadius: 0,
+ borderBottomRightRadius: 0
}}/>
<div style={{
width: 41,
@@ -91,13 +103,17 @@ export function Input(props: { label?: string }) {
}
export class CheckBox extends Component<{
- state?: boolean
+ state?: boolean,
+ style?: CSSProperties
}> {
state = { on: this.props.state || false }
public toggle = () => this.setState({ on: !this.state.on })
render() {
- return <div onClick={this.toggle}>
+ return <div onClick={this.toggle} style={{
+ ...this.props.style,
+ display: "inline-block"
+ }}>
{
this.state.on ?
<CheckBoxIcon style={{ fontSize: 24 }}/> :
diff --git a/src/pages/game.tsx b/src/pages/game.tsx
index f5dfd39..18007cb 100644
--- a/src/pages/game.tsx
+++ b/src/pages/game.tsx
@@ -5,7 +5,7 @@ import { CenteredPage } from '../components/page';
import { VoerBord } from '../components/voerBord';
import { DialogBox } from '../components/dialogBox';
import { CurrentGameSettings } from '../components/gameSettings';
-import { Button, Input } from '../components/ui';
+import { Button, SearchBar } from '../components/ui';
import { GameBar } from '../components/gameBar';
import WifiTetheringRoundedIcon from '@material-ui/icons/WifiTetheringRounded';
@@ -73,7 +73,7 @@ export default function GamePage() {
<h2 style={InviteButtonLabelStyle}>Uitnodigen via link</h2>
</Button>
</div>
- <Input label="Zoeken in vriendenlijst"/>
+ <SearchBar label="Zoeken in vriendenlijst"/>
</DialogBox>
</CenteredPage>
</div>
diff --git a/src/routes.tsx b/src/routes.tsx
index 0b042d6..5310baf 100644
--- a/src/routes.tsx
+++ b/src/routes.tsx
@@ -1,7 +1,6 @@
import { Switch, Route } from 'react-router-dom';
import './global.css';
-import './dark.css';
import HomePage from './pages/home';
import SettingsPage from './pages/settings';