diff --git a/src/components/Gameboard/Gameboard.tsx b/src/components/Gameboard/Gameboard.tsx index 3cefb8e..c942fe8 100644 --- a/src/components/Gameboard/Gameboard.tsx +++ b/src/components/Gameboard/Gameboard.tsx @@ -10,14 +10,13 @@ import AvailableChips from '../Resources/AvailableChips'; import AllPlayers from '../Player/AllPlayers'; import CardRow from '../Card/CardRow'; import { validateChips } from '../Player/ActionMethods'; +import SelectionView from '../Resources/SelectionView'; export default function Gameboard({ state, setState }: StateProps) { const [view, setView] = useState(
Loading...
); // callbacks for lifting state const liftSelection = useCallback((value: keyof ResourceCost) => { - console.log(value) - if (!state.actions.getChips.active) return; setState((prev: AppState) => { @@ -83,6 +82,7 @@ export default function Gameboard({ state, setState }: StateProps) {Your selection is {state.actions.getChips.valid || "not"} valid
} - { - state.actions.getChips.active && - state.actions.getChips.selection?.map((each) =>{each}
) - } { Object.keys(state.gameboard.tradingResources).map((key: string | keyof ResourceCost) => { return ( @@ -31,7 +26,6 @@ export default function AvailableChips({ state, setState, liftSelection }: Resou ) }) } -Card will display here
+ > + ) + default: + return <>>; + } + }) + }, [state]) + + return ( +{each}
) + } +