Update packages

This commit is contained in:
aronmal 2023-05-13 15:21:24 +02:00
parent f1ea064d4c
commit dacc33bf21
Signed by: aronmal
GPG key ID: 816B7707426FC612
5 changed files with 660 additions and 441 deletions

View file

@ -14,10 +14,6 @@ import OtpInput from "react-otp-input"
import { toast } from "react-toastify"
import { Icons } from "react-toastify"
function isInputOnlyNumbers(input: string) {
return /^\d+$/.test(input)
}
export function isAuthenticated(res: Response) {
if (status[`${res.status}_CLASS`] === status.classes.SUCCESSFUL)
return res.json()
@ -127,12 +123,7 @@ export default function Start() {
useEffect(() => {
if (otp.length !== 4) return
if (!isInputOnlyNumbers(otp))
toast("Der Code darf nur Zahlen beinhalten!", {
type: "warning",
theme: "dark",
})
else gameFetch(otp)
gameFetch(otp)
}, [otp, gameFetch])
return (
@ -176,6 +167,8 @@ export default function Start() {
value={otp}
onChange={setOtp}
numInputs={4}
inputType="number"
inputStyle="inputStyle"
placeholder="0000"
renderSeparator={<span>-</span>}
renderInput={(props) => <input {...props} />}
@ -200,6 +193,8 @@ export default function Start() {
value={otp}
onChange={setOtp}
numInputs={4}
inputType="number"
inputStyle="inputStyle"
placeholder="0000"
renderSeparator={<span>-</span>}
renderInput={(props) => <input {...props} />}