From 90d55c83cb4a6e3cf76622b0b8a2a9aa13fd2ba0 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Wed, 6 Jan 2021 13:53:56 +0100 Subject: spel pagina --- src/components/navbar.tsx | 2 +- src/components/page.tsx | 43 +++++++++++++++++++++---------------------- src/components/voerBord.tsx | 43 +++++++++++++++++++++++++++++++++++++++++++ src/pages/game.tsx | 16 ++++++++++++++++ src/pages/home.tsx | 6 +++--- src/pages/settings.tsx | 4 ++-- src/routes.tsx | 2 ++ 7 files changed, 88 insertions(+), 28 deletions(-) create mode 100644 src/components/voerBord.tsx create mode 100644 src/pages/game.tsx (limited to 'src') diff --git a/src/components/navbar.tsx b/src/components/navbar.tsx index 141119f..d0245dc 100644 --- a/src/components/navbar.tsx +++ b/src/components/navbar.tsx @@ -43,7 +43,7 @@ export function NavBar() {
- + diff --git a/src/components/page.tsx b/src/components/page.tsx index 44b00ba..b368eee 100644 --- a/src/components/page.tsx +++ b/src/components/page.tsx @@ -1,31 +1,30 @@ -import { Component, CSSProperties } from 'react'; +import { Component, ReactNode } from 'react'; -var CenteredPageStyle: CSSProperties = { - maxWidth: 802, - margin: "0 auto" +interface CenteredPageProps { + width?: number; + children?: ReactNode; } -export class CenteredPage extends Component { - render () { - return
-
{this.props.children}
-
; - } -} - -var PageTitleStyle: CSSProperties = { - color: "var(--text-alt)", - marginLeft: 6, - marginTop: 32, - marginBottom: 64, - fontSize: 25 +export function CenteredPage (props: CenteredPageProps) { + return
+
{props.children}
+
; } export class PageTitle extends Component { render () { - return

{this.props.children}

; + return

{this.props.children}

; } } diff --git a/src/components/voerBord.tsx b/src/components/voerBord.tsx new file mode 100644 index 0000000..28de567 --- /dev/null +++ b/src/components/voerBord.tsx @@ -0,0 +1,43 @@ +interface VoerBordProps { + width: number; + height: number; +} + +export function VoerBord(props: VoerBordProps) { + return + { + [...Array(props.height)].map(() => ( + + {[...Array(props.width)].map(() => ( + + ))} + + )) + } +
+
+
+
+
+} diff --git a/src/pages/game.tsx b/src/pages/game.tsx new file mode 100644 index 0000000..b248631 --- /dev/null +++ b/src/pages/game.tsx @@ -0,0 +1,16 @@ +import { NavBar } from '../components/navbar'; +import { CenteredPage, PageTitle } from '../components/page'; +import { VoerBord } from '../components/voerBord'; + +export default function GamePage() { + return ( +
+ + + Niew spel starten + + +
+ ); +} + diff --git a/src/pages/home.tsx b/src/pages/home.tsx index 3583cfb..7196fc4 100644 --- a/src/pages/home.tsx +++ b/src/pages/home.tsx @@ -51,10 +51,10 @@ var RightAlignedTableColumn: CSSProperties = { export default function HomePage() { return (
- - + + 4 op een rij - + Nieuw spel
diff --git a/src/pages/settings.tsx b/src/pages/settings.tsx index 7c886d6..7460055 100644 --- a/src/pages/settings.tsx +++ b/src/pages/settings.tsx @@ -6,8 +6,8 @@ import { Vierkant } from '../components/vierkant'; export default function SettingsPage() { return (
- - + + Instellingen

Account

diff --git a/src/routes.tsx b/src/routes.tsx index b9b39da..5310baf 100644 --- a/src/routes.tsx +++ b/src/routes.tsx @@ -4,11 +4,13 @@ import './global.css'; import HomePage from './pages/home'; import SettingsPage from './pages/settings'; +import GamePage from './pages/game'; export default function Router() { return + ; } -- cgit v1.2.3