Keep improving
This commit is contained in:
parent
d3e8a43b34
commit
da53662d6e
8 changed files with 165 additions and 60 deletions
|
@ -79,7 +79,6 @@ export default function Home({ q }: Props) {
|
|||
},
|
||||
})
|
||||
|
||||
console.log(res)
|
||||
setGameProps(res)
|
||||
|
||||
await toast.promise(router.push("/lobby"), {
|
||||
|
@ -101,14 +100,12 @@ export default function Home({ q }: Props) {
|
|||
|
||||
useEffect(() => {
|
||||
if (otp.length !== 4) return
|
||||
if (!isInputOnlyNumbers(otp)) {
|
||||
if (!isInputOnlyNumbers(otp))
|
||||
toast("Der Code darf nur Zahlen beinhalten!", {
|
||||
type: "warning",
|
||||
theme: "dark",
|
||||
})
|
||||
return
|
||||
}
|
||||
gameFetch(otp)
|
||||
else gameFetch(otp)
|
||||
}, [otp, gameFetch])
|
||||
|
||||
return (
|
||||
|
@ -121,11 +118,7 @@ export default function Home({ q }: Props) {
|
|||
className="-mt-2 w-20 self-start rounded-xl border-b-4 border-shield-gray bg-voidDark text-2xl text-grayish duration-100 active:border-b-0 active:border-t-4 sm:-mt-6 sm:w-40 sm:px-2 sm:text-5xl"
|
||||
onClick={() =>
|
||||
setTimeout(() => {
|
||||
// Navigate to the same page with the `start` query parameter set to `false`
|
||||
router.push({
|
||||
pathname: router.pathname,
|
||||
query: null,
|
||||
})
|
||||
router.push("/")
|
||||
}, 200)
|
||||
}
|
||||
>
|
||||
|
@ -149,9 +142,7 @@ export default function Home({ q }: Props) {
|
|||
icon={faUserPlus}
|
||||
disabled={!session}
|
||||
>
|
||||
{q === "join" ? (
|
||||
"Raum beitreten"
|
||||
) : (
|
||||
{q === "join" && session?.user ? (
|
||||
<OtpInput
|
||||
shouldAutoFocus
|
||||
containerStyle={{ color: "initial" }}
|
||||
|
@ -162,6 +153,8 @@ export default function Home({ q }: Props) {
|
|||
renderSeparator={<span>-</span>}
|
||||
renderInput={(props) => <input {...props} />}
|
||||
/>
|
||||
) : (
|
||||
"Raum beitreten"
|
||||
)}
|
||||
</OptionButton>
|
||||
<OptionButton icon={faEye}>Zuschauen</OptionButton>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue