fix: [closes #59] prevent users from using empty room names

This commit is contained in:
Jeremy Kahn 2022-10-29 12:54:40 -05:00
parent 73e09041cc
commit 95d6ed6f11

View File

@ -47,6 +47,8 @@ export function Home({ userId }: HomeProps) {
navigate(`/private/${roomName}`)
}
const isRoomNameValid = roomName.length > 0
return (
<Box className="Home">
<main className="mt-6 px-4 max-w-3xl text-center mx-auto">
@ -83,6 +85,7 @@ export function Home({ userId }: HomeProps) {
sx={{
marginTop: 2,
}}
disabled={!isRoomNameValid}
>
Join public room
</Button>
@ -93,6 +96,7 @@ export function Home({ userId }: HomeProps) {
marginTop: 2,
marginLeft: 2,
}}
disabled={!isRoomNameValid}
>
Join private room
</Button>