From 2ab7cfe761b47eed848becbc9386f6a94ef44d3d Mon Sep 17 00:00:00 2001 From: lonkaars Date: Mon, 8 Mar 2021 15:43:25 +0100 Subject: game/resign thingy --- components/gameBar.tsx | 15 ++++++++------- components/ui.tsx | 8 +++++++- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'components') diff --git a/components/gameBar.tsx b/components/gameBar.tsx index 439caea..cacb5e8 100644 --- a/components/gameBar.tsx +++ b/components/gameBar.tsx @@ -6,18 +6,18 @@ import ExitToAppRoundedIcon from '@material-ui/icons/ExitToAppRounded'; import NavigateNextRoundedIcon from '@material-ui/icons/NavigateNextRounded'; import NavigateBeforeRoundedIcon from '@material-ui/icons/NavigateBeforeRounded'; -interface GameBarModuleProps { +function GameBarModule(props: { children?: ReactNode; -} - -function GameBarModule(props: GameBarModuleProps) { + onclick?: () => void; +}) { return {props.children} + verticalAlign: "top", + cursor: props.onclick ? "pointer" : "default" + }} onclick={props.onclick}>{props.children} } var GameBarSpacer = () =>
; @@ -30,6 +30,7 @@ export function GameBar(props: { turn: boolean; player1: boolean; active: boolean; + resignFunction: () => void; }) { return 00:00 - + diff --git a/components/ui.tsx b/components/ui.tsx index e6fdceb..e395a47 100644 --- a/components/ui.tsx +++ b/components/ui.tsx @@ -14,6 +14,7 @@ export function Vierkant(props: { className?: string; id?: string; fullwidth?: boolean; + onclick?: () => void; }) { return {props.children} + }} + href={props.href} + className={props.className} + id={props.id} + onClick={props.onclick} + >{props.children} } export function Button(props: { -- cgit v1.2.3