diff --git a/components/JoinParty.tsx b/components/JoinParty.tsx index 6c422b1..969accc 100644 --- a/components/JoinParty.tsx +++ b/components/JoinParty.tsx @@ -1,7 +1,7 @@ "use client"; import { useContext } from "react"; -import { SubmitHandler, useForm } from "react-hook-form"; +import { Controller, SubmitHandler, useForm } from "react-hook-form"; import { useSWRConfig } from "swr"; import { ErrorContext } from "./App"; @@ -11,7 +11,7 @@ type Inputs = { export default function JoinParty() { const { mutate } = useSWRConfig(); - const { register, handleSubmit } = useForm(); + const { handleSubmit, control } = useForm(); const { setError } = useContext(ErrorContext); const onSubmit: SubmitHandler = async ({ code }) => { @@ -33,11 +33,18 @@ export default function JoinParty() { return (
- ( + field.onChange(e.target.value.toUpperCase())} + className="input input-bordered" + placeholder="Party Code" + required + /> + )} />