Restructuration of the project folders

This commit is contained in:
Sebastien Riviere
2026-02-13 16:06:50 +01:00
parent 5f16500634
commit c1f1688794
188 changed files with 265 additions and 301 deletions

View File

@@ -0,0 +1,22 @@
import { createContext, useContext, useMemo } from "react";
import { io } from "socket.io-client";
const SOCKET_URL = `ws://0.0.0.0/player`;
const SERVER_URL = `http://0.0.0.0/back`;
export const teamSocket = io(SOCKET_URL, {
path: "/back/socket.io",
});
export const SocketContext = createContext();
export default function SocketProvider({ children }) {
const value = useMemo(() => ({ teamSocket, SERVER_URL }), [teamSocket]);
return (
<SocketContext.Provider value={value}>{children}</SocketContext.Provider>
);
}
export function useSocket() {
return useContext(SocketContext);
}