From f8172bd157f92a04f408534afd1065cabe64c3b3 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 19 Oct 2020 05:12:50 -0700 Subject: [PATCH] Use proper variables --- src/components/CharacterGrid/index.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/CharacterGrid/index.tsx b/src/components/CharacterGrid/index.tsx index 665df305..cb2d3eb3 100644 --- a/src/components/CharacterGrid/index.tsx +++ b/src/components/CharacterGrid/index.tsx @@ -11,6 +11,8 @@ export enum GridType { } interface Props { + userId?: string + grid: GridArray editable: boolean exists: boolean onSelect: (type: GridType, character: Character, position: number) => void @@ -19,8 +21,9 @@ interface Props { const CharacterGrid = (props: Props) => { const numCharacters: number = 5 - const [characters, setCharacters] = useState>({}) - const [partyId, setPartyId] = useState('') + function receiveCharacter(character: Character, position: number) { + props.onSelect(GridType.Character, character, position) + } return (
@@ -31,9 +34,9 @@ const CharacterGrid = (props: Props) => {
  • {}} + onReceiveData={receiveCharacter} position={i} - character={characters[i]} + character={props.grid[i]} />
  • )