From 9959cbf4b14c0aa0bcc3dc6bcd08d62d8d072865 Mon Sep 17 00:00:00 2001 From: Mikayla Dobson Date: Mon, 18 Jul 2022 20:12:40 -0500 Subject: [PATCH] to do: unify state, lift components to app level --- src/App.tsx | 24 ++++++++++++++++++++++++ src/components/Gameboard/Gameboard.tsx | 6 +++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 6b843e9..52d0edd 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,10 +1,34 @@ import Gameboard from './components/Gameboard/Gameboard' import './App.css' +import { useCallback, useEffect, useState } from 'react' function App() { + const [state, setState] = useState({ + gameboard: null, + store: null, + players: null, + round: 0 + }) + + useEffect(() => { + if (!state.players) { + console.log('no players!'); + } + }, []); + + const getGameboard = useCallback(() => { + + }, []) + return (
+ {/* + + < INVENTORY /> + < PLAYERS /> + + */}
) } diff --git a/src/components/Gameboard/Gameboard.tsx b/src/components/Gameboard/Gameboard.tsx index 9bf8cc0..6ddd277 100644 --- a/src/components/Gameboard/Gameboard.tsx +++ b/src/components/Gameboard/Gameboard.tsx @@ -33,9 +33,9 @@ export default function Gameboard() { useEffect(() => { setView( <> - - + + ) }, [state.cardRows]); @@ -89,7 +89,7 @@ export default function Gameboard() { return (
-

Gameboard

+

SPLENDOR

{ view }
)