-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
559d5c9
commit 92ab9c3
Showing
19 changed files
with
450 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Action types | ||
*/ | ||
|
||
// Lobby | ||
export const JOIN_TABLE = 'JOIN_TABLE'; | ||
export const LEAVE_TABLE = 'LEAVE_TABLE'; | ||
export const SELECT_TABLE = 'SELECT_TABLE'; | ||
export const UPDATE_TABLE_LIST = 'UPDATE_TABLE_LIST'; | ||
|
||
// Table | ||
export const TAKE_SEAT = 'TAKE_SEAT'; | ||
export const STAND_UP = 'STAND_UP'; | ||
export const DEAL_CARDS = 'DEAL_CARDS'; | ||
export const SHOW_CARDS = 'SHOW_CARDS'; | ||
export const CLEAR_CARDS = 'CLEAR_CARDS'; | ||
export const UPDATE_GAME_STATE = 'UPDATE_GAME_STATE'; | ||
|
||
// Chat | ||
export const ADD_CHAT_MESSAGE = 'ADD_CHAT_MESSAGE'; | ||
|
||
|
||
/* | ||
* Action creators | ||
*/ | ||
|
||
export const joinTable = (name) => { | ||
return {type: JOIN_TABLE, name}; | ||
}; | ||
|
||
export const leaveTable = () => { | ||
return {type: LEAVE_TABLE}; | ||
}; | ||
|
||
export const selectTable = (name) => { | ||
return {type: SELECT_TABLE, name}; | ||
} | ||
|
||
export const updateTableList = (tableList) => { | ||
return {type: UPDATE_TABLE_LIST, tableList}; | ||
}; | ||
|
||
export const takeSeat = (seatNum) => { | ||
return {type: TAKE_SEAT, seatNum}; | ||
} | ||
|
||
export const standUp = () => { | ||
return {type: STAND_UP}; | ||
}; | ||
|
||
export const dealCards = () => { | ||
return {type: DEAL_CARDS}; | ||
} | ||
|
||
export const showCards = (handList) => { | ||
return {type: SHOW_CARDS, handList}; | ||
} | ||
|
||
export const clearCards = () => { | ||
return {type: CLEAR_CARDS} | ||
} | ||
|
||
export const updateGameState = (newState) => { | ||
return {type: UPDATE_GAME_STATE, newState}; | ||
} | ||
|
||
export const addChatMessage = (message) => { | ||
return {type: ADD_CHAT_MESSAGE, message}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
import Table from './Table' | ||
import Lobby from './Lobby' | ||
|
||
const App = () => ( | ||
<div className="content"> | ||
<h1>HU4Rolls</h1> | ||
<Lobby /> | ||
<Table /> | ||
</div> | ||
); | ||
|
||
export default App; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
class SocketProvider extends Component { | ||
getChildContext() { | ||
return { | ||
socket: this.props.socket | ||
}; | ||
} | ||
|
||
render() { | ||
return this.props.children; | ||
} | ||
} | ||
|
||
SocketProvider.childContextTypes = { | ||
socket: PropTypes.object | ||
} | ||
|
||
export default SocketProvider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.