diff --git a/src/pages/Home/Home.tsx b/src/pages/Home/Home.tsx index eddcef9..e2e7b59 100644 --- a/src/pages/Home/Home.tsx +++ b/src/pages/Home/Home.tsx @@ -1,16 +1,25 @@ import React, { useState } from 'react' +import { useNavigate } from 'react-router-dom' +import Button from '@mui/material/Button' +import FormControl from '@mui/material/FormControl' import Typography from '@mui/material/Typography' import TextField from '@mui/material/TextField' import { v4 as uuid } from 'uuid' export function Home() { const [roomName, setRoomName] = useState(uuid()) + const navigate = useNavigate() const handleRoomNameChange = (event: React.ChangeEvent) => { const { value } = event.target setRoomName(value) } + const handleFormSubmit = (event: React.SyntheticEvent) => { + event.preventDefault() + navigate(`/public/${roomName}`) + } + return (
@@ -25,13 +34,22 @@ export function Home() {
- +
+ + + +
+ +
+
)