-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Vishesh-Pandey/feat/create-room
add create room option
- Loading branch information
Showing
4 changed files
with
81 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { useNavigate } from "react-router-dom"; | ||
|
||
function CreateRoom() { | ||
const navigate = useNavigate(); | ||
|
||
const createLiveRoom = () => { | ||
const roomId = Math.floor(Math.random() * 1000); | ||
navigate(`${roomId}`); | ||
}; | ||
|
||
return ( | ||
<div className="text-center py-5"> | ||
<button | ||
onClick={createLiveRoom} | ||
className="bg-green-300 p-4 rounded-md hover:bg-green-400 duration-500" | ||
> | ||
Create Room | ||
</button> | ||
</div> | ||
); | ||
} | ||
|
||
export default CreateRoom; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters