mirror of
https://github.com/randyjc/Rahoot.git
synced 2026-03-14 04:25:35 +01:00
New config file and update README
This commit is contained in:
@@ -3,17 +3,15 @@ import Leaderboard from "@/components/game/states/Leaderboard"
|
||||
import Prepared from "@/components/game/states/Prepared"
|
||||
import Question from "@/components/game/states/Question"
|
||||
import Result from "@/components/game/states/Result"
|
||||
import Room from "./components/game/states/Room"
|
||||
import Podium from "./components/game/states/Podium"
|
||||
import Wait from "@/components/game/states/Wait"
|
||||
import Start from "@/components/game/states/Start"
|
||||
import Wait from "@/components/game/states/Wait"
|
||||
import Podium from "./components/game/states/Podium"
|
||||
import Room from "./components/game/states/Room"
|
||||
|
||||
import Circle from "@/components/icons/Circle"
|
||||
import Triangle from "@/components/icons/Triangle"
|
||||
import Square from "@/components/icons/Square"
|
||||
import Rhombus from "@/components/icons/Rhombus"
|
||||
|
||||
export const WEBSOCKET_URL = "http://localhost:5157"
|
||||
import Square from "@/components/icons/Square"
|
||||
import Triangle from "@/components/icons/Triangle"
|
||||
|
||||
export const ANSWERS_COLORS = [
|
||||
"bg-red-500",
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { createContext, useContext } from "react"
|
||||
import { io } from "socket.io-client"
|
||||
import { createContext, useContext, useState } from "react"
|
||||
import { WEBSOCKET_URL } from "@/constants"
|
||||
import { WEBSOCKET_PUBLIC_URL } from "../../config.mjs"
|
||||
|
||||
export const socket = io(WEBSOCKET_URL, {
|
||||
path: "/ws/",
|
||||
//addTrailingSlash: false,
|
||||
export const socket = io(WEBSOCKET_PUBLIC_URL, {
|
||||
transports: ["websocket"],
|
||||
})
|
||||
|
||||
@@ -18,7 +16,6 @@ export const SocketContextProvider = ({ children }) => {
|
||||
|
||||
export function useSocketContext() {
|
||||
const context = useContext(SocketContext)
|
||||
const [isConnected, setIsConnected] = useState(false)
|
||||
|
||||
return { socket: context }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user