Update packages
This commit is contained in:
parent
f1ea064d4c
commit
dacc33bf21
5 changed files with 660 additions and 441 deletions
|
@ -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} />}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue