|
|
@ -2,6 +2,9 @@ import React, { Component } from 'react'; |
|
|
|
import logo from './logo.svg'; |
|
|
|
import './App.css'; |
|
|
|
import openSocket from 'socket.io-client'; |
|
|
|
import NicknameInput from './components/NicknameInput'; |
|
|
|
|
|
|
|
const socket = openSocket('129.21.91.149:3000'); |
|
|
|
|
|
|
|
class App extends Component { |
|
|
|
constructor(props){ |
|
|
@ -22,23 +25,13 @@ class App extends Component { |
|
|
|
} |
|
|
|
|
|
|
|
componentDidMount(){ |
|
|
|
const socket = openSocket('129.21.91.149:3000'); |
|
|
|
socket.emit('register', 'User 2'); |
|
|
|
//socket.emit('createRoom', {password: 'pass', capacity: 4});
|
|
|
|
socket.emit('joinRoom', {roomName: 'pls', password: 'pass'}); |
|
|
|
socket.on('sendRooms', payload => this.renderRooms(payload)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
render() { |
|
|
|
if(this.state.progression === 'register'){ |
|
|
|
return( |
|
|
|
<div>At least I can read the goddamn state</div> |
|
|
|
); |
|
|
|
} else { |
|
|
|
return( |
|
|
|
<div>FUBAR</div> |
|
|
|
); |
|
|
|
} |
|
|
|
return( |
|
|
|
<NicknameInput socket = {socket}/> |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|