From f48a2dc60221de8952edec97203abef302086bd9 Mon Sep 17 00:00:00 2001 From: Rob Clayburn Date: Thu, 8 Nov 2018 23:02:05 +0000 Subject: [PATCH] styled componets and unikitty update - hide selected character from UI --- client/package.json | 5 +- client/src/Games/AddGame.tsx | 2 +- client/src/Games/AddPlayer.tsx | 25 +- client/src/Games/AssignCharacters.tsx | 17 +- client/src/Games/CharacterSelect.tsx | 13 +- client/src/Games/PlayerList.tsx | 33 +- client/src/Games/PlayerSelect.tsx | 5 +- client/yarn.lock | 822 ++++++++++++++++++++++---- server/db.json | 40 +- 9 files changed, 812 insertions(+), 150 deletions(-) diff --git a/client/package.json b/client/package.json index 4ea1e674..15ca631e 100644 --- a/client/package.json +++ b/client/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "dependencies": { - "@infosum/unikitty": "^3.0.14", + "@infosum/unikitty": "^5.1.12", "@types/node": "*", "@types/prop-types": "^15.5.3", "@types/react": "*", @@ -19,7 +19,8 @@ "react-apollo": "^2.1.9", "react-dom": "^16.4.1", "react-router-dom": "^4.3.1", - "recompose": "^0.27.1" + "recompose": "^0.27.1", + "styled-components": "^4.0.3" }, "devDependencies": { "@types/jest": "^23.3.0", diff --git a/client/src/Games/AddGame.tsx b/client/src/Games/AddGame.tsx index 86ee1858..da82d03d 100644 --- a/client/src/Games/AddGame.tsx +++ b/client/src/Games/AddGame.tsx @@ -87,6 +87,7 @@ const AddGame: React.SFC> = ({ history }) => { contract={contract} > {({ setValue, formData, validate, errors }) => { + console.log('formrdata', formData); return

New Game

@@ -109,7 +110,6 @@ const AddGame: React.SFC> = ({ history }) => { type="button" onClick={async (e) => { try { - e.preventDefault(); await validate(formData); const game = { variables: { diff --git a/client/src/Games/AddPlayer.tsx b/client/src/Games/AddPlayer.tsx index 1d66d8b8..aa9028a2 100644 --- a/client/src/Games/AddPlayer.tsx +++ b/client/src/Games/AddPlayer.tsx @@ -1,7 +1,18 @@ -import { Button, Form, FormGroup, Input, Label } from '@infosum/unikitty'; import gql from 'graphql-tag'; import * as React from 'react'; -import { graphql, MutateProps } from 'react-apollo'; +import { + graphql, + MutateProps, +} from 'react-apollo'; + +import { + Button, + Form, + FormGroup, + Input, + Label, +} from '@infosum/unikitty'; + import { IPlayer } from './PlayerList'; const initialData: IPlayer = { @@ -25,7 +36,10 @@ const AddPlayer: React.SFC> = (props) => { setValue('player', e.target.value)} /> + onChange={(e) => setValue('user', { + ...formData.user, + name: e.target.value, + })} />