titlehook for dynamic tab titles
This commit is contained in:
@@ -2,9 +2,12 @@ import useWebSocket from "react-use-websocket";
|
||||
import React from "react";
|
||||
import {useParams} from "react-router";
|
||||
import {GHButton} from "../components/Button";
|
||||
import useTitle from "../../utils/TitleHook";
|
||||
|
||||
const Room = () => {
|
||||
|
||||
useTitle('Mau!');
|
||||
|
||||
const {roomId} = useParams();
|
||||
|
||||
const WS_URL = `ws://localhost:5062/room/${roomId}`;
|
||||
@@ -38,7 +41,10 @@ const Room = () => {
|
||||
<div>
|
||||
<h1>Room {roomId}</h1>
|
||||
<GHButton onClick={handleLeaveRoom}>Leave Room</GHButton>
|
||||
<form>
|
||||
<form onSubmit={(event) => {
|
||||
event.preventDefault();
|
||||
handleSend();
|
||||
}}>
|
||||
<input type="text" name="message" placeholder="Send a message" value={message}
|
||||
onChange={handleMessageChange}/>
|
||||
<span onClick={handleSend}>Send</span>
|
||||
|
||||
Reference in New Issue
Block a user