mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-04-11 00:30:19 +02:00
Fix photos + API hooks + cleaning
This commit is contained in:
@@ -1,18 +1,16 @@
|
||||
// React
|
||||
import { createContext, useContext, useMemo } from "react";
|
||||
// IO
|
||||
import { io } from "socket.io-client";
|
||||
// Util
|
||||
import { SOCKET_URL } from "../util/constants";
|
||||
|
||||
const IP = "172.16.1.180";
|
||||
const SOCKET_URL = `ws://${IP}/player`;
|
||||
const SERVER_URL = `http://${IP}/back`;
|
||||
const SocketContext = createContext();
|
||||
|
||||
export const teamSocket = io(SOCKET_URL, {
|
||||
path: "/back/socket.io",
|
||||
});
|
||||
|
||||
export const SocketContext = createContext();
|
||||
const teamSocket = io(SOCKET_URL, {path: "/back/socket.io"});
|
||||
|
||||
export const SocketProvider = ({ children }) => {
|
||||
const value = useMemo(() => ({ teamSocket, SERVER_URL }), []);
|
||||
const value = useMemo(() => ({ teamSocket }), []);
|
||||
|
||||
return (
|
||||
<SocketContext.Provider value={value}>{children}</SocketContext.Provider>
|
||||
|
||||
Reference in New Issue
Block a user