diff --git a/client/assets/styles/styles.css b/client/assets/styles/styles.css index 0f79e760..d871153b 100644 --- a/client/assets/styles/styles.css +++ b/client/assets/styles/styles.css @@ -446,7 +446,7 @@ header { flex: 1 1 50%; } -.create-form input { +.create-form .login-input { width: 50%; } diff --git a/client/src/app.jsx b/client/src/app.jsx index 06da152a..e22eff9a 100644 --- a/client/src/app.jsx +++ b/client/src/app.jsx @@ -23,8 +23,8 @@ document.fonts.load('16pt "Jura"').then(() => { setupKeys(store); const ws = createSocket(events); - store.dispatch(actions.setWs(ws)); ws.connect(); + events.setWs(ws); const App = () => ( diff --git a/client/src/components/instance.component.jsx b/client/src/components/instance.component.jsx index 8ef11ff3..bb9aed6b 100644 --- a/client/src/components/instance.component.jsx +++ b/client/src/components/instance.component.jsx @@ -65,7 +65,7 @@ function Instance(args) { {p.name} - {p.score.wins} / {p.score.losses} + {p.wins} / {p.losses} {pText} ); diff --git a/client/src/components/instance.create.form.jsx b/client/src/components/instance.create.form.jsx index 33d7e219..fe0b3fa8 100644 --- a/client/src/components/instance.create.form.jsx +++ b/client/src/components/instance.create.form.jsx @@ -6,9 +6,9 @@ const addState = connect( function receiveState(state) { const { ws, team } = state; - function sendInstanceNew(sConstructs, name, players) { + function sendInstanceNew(sConstructs, name, pve) { if (sConstructs.length) { - return ws.sendInstanceNew(sConstructs, name, players); + return ws.sendInstanceNew(sConstructs, name, pve); } return false; } @@ -24,19 +24,19 @@ class InstanceCreateForm extends Component { constructor(props) { super(props); - this.state = { players: 2, name: '' }; + this.state = { pve: false, name: '' }; const { sendInstanceNew } = props; this.sendInstanceNew = sendInstanceNew.bind(this); this.nameInput = this.nameInput.bind(this); - this.playersChange = this.playersChange.bind(this); + this.pveChange = this.pveChange.bind(this); this.handleSubmit = this.handleSubmit.bind(this); } - playersChange(event) { - this.setState({ players: Number(event.target.value) }); + pveChange() { + this.setState({ pve: !this.state.pve }); } nameInput(event) { @@ -45,8 +45,8 @@ class InstanceCreateForm extends Component { handleSubmit(event) { event.preventDefault(); - this.sendInstanceNew(this.props.team, this.state.name, this.state.players); - this.setState({ name: '', players: 2 }); + this.sendInstanceNew(this.props.team, this.state.name, this.state.pve); + this.setState({ name: '', pve: false }); } render() { @@ -62,21 +62,17 @@ class InstanceCreateForm extends Component { type="text" disabled={disabled} value={this.state.name} - placeholder="name" + placeholder="game name" onInput={this.nameInput} /> - - - - - - - - +