From 5856e80fcb78446be37456ec1e5c47b2ab02201f Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 9 Apr 2021 17:10:50 +0200 Subject: dprint format :tada: --- components/voerBord.tsx | 95 +++++++++++++++++++++++++++++-------------------- 1 file changed, 57 insertions(+), 38 deletions(-) (limited to 'components/voerBord.tsx') diff --git a/components/voerBord.tsx b/components/voerBord.tsx index 946aa9c..93e350c 100644 --- a/components/voerBord.tsx +++ b/components/voerBord.tsx @@ -1,10 +1,16 @@ function Disc() { - return
+ return
; } export function VoerBord(props: { @@ -13,40 +19,53 @@ export function VoerBord(props: { onMove: (move: number) => void; active: boolean; }) { - return + return
- { - [...Array(props.height).keys()].map((row) => ( - - {[...Array(props.width).keys()].map((column) => ( - + {[...Array(props.width).keys()].map((column) => ( + - ))} - - )) - } + cursor: props.active ? 'pointer' : 'default', + }} + id={`pos-${(props.height - row - 1) * props.width + column}`} + onClick={event => { + props.onMove(Number((event.target as HTMLElement).id.split('-')[1])); + }} + /> + + ))} + + ))} -
-
- -
( +
+
+ +
{ - props.onMove(Number((event.target as HTMLElement).id.split("-")[1])) - }}/> -
+ ; } -- cgit v1.2.3