mirror of
https://github.com/randyjc/Rahoot.git
synced 2026-03-14 04:25:35 +01:00
Add leaderboard & Manager some features
This commit is contained in:
@@ -14,6 +14,7 @@ const gameStateComponent = {
|
||||
SHOW_QUESTION: Question,
|
||||
WAIT: Wait,
|
||||
SHOW_RESULT: Result,
|
||||
SHOW_LEADERBOARD: Leaderboard,
|
||||
}
|
||||
|
||||
export default function Game() {
|
||||
@@ -27,8 +28,6 @@ export default function Game() {
|
||||
return
|
||||
}
|
||||
|
||||
socket.emit("player:join", { username: "Test", room: player.room })
|
||||
|
||||
const [state, setState] = useState({
|
||||
status: {
|
||||
name: "WAIT",
|
||||
@@ -42,17 +41,15 @@ export default function Game() {
|
||||
|
||||
socket.on("game:status", (status) => {
|
||||
setState({
|
||||
...gameState,
|
||||
...state,
|
||||
status: status,
|
||||
question: {
|
||||
...state.question,
|
||||
current: status.question,
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
/*socket.on("game:", (question) => {
|
||||
setState({
|
||||
...state,
|
||||
|
||||
})*/
|
||||
|
||||
return (
|
||||
<GameWrapper>
|
||||
{gameStateComponent[state.status.name] &&
|
||||
|
||||
Reference in New Issue
Block a user