fixed navigation links
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import useWebSocket from "react-use-websocket";
|
||||
import React from "react";
|
||||
import {useParams} from "react-router";
|
||||
import {useNavigate, useParams} from "react-router";
|
||||
import {GHButton} from "../components/Button";
|
||||
import useTitle from "../../utils/hooks/TitleHook";
|
||||
import Hand from "../components/Hand";
|
||||
@@ -18,6 +18,8 @@ const Room = () => {
|
||||
|
||||
useTitle('Mau!');
|
||||
|
||||
const navigateTo = useNavigate();
|
||||
|
||||
const {roomId} = useParams();
|
||||
|
||||
const WS_URL = `ws://${process.env.REACT_APP_API_URL}/room/${roomId}`;
|
||||
@@ -43,7 +45,7 @@ const Room = () => {
|
||||
const handleLeaveRoom = () => {
|
||||
const socket = websocket.getWebSocket();
|
||||
if (socket) socket.close();
|
||||
window.location.href = '/';
|
||||
navigateTo('/');
|
||||
}
|
||||
|
||||
const handleCardSend = (card: string) => {
|
||||
|
||||
Reference in New Issue
Block a user