More things for web
This commit is contained in:
1 parent
78b1058276
commit
a1ab487084
8 files changed
+87
-8
No files matched your search
@@ -3,6 +3,8 @@
|
||||
import { ChangeEvent, SyntheticEvent, useEffect, useRef, useState } from "react";
|
||||
import styles from "../../css/WelcomeScreen.module.css";
|
||||
import ChargedButton from "../ChargedButton";
|
||||
import { useLocalStorage } from "@/hooks/useLocalStorage";
|
||||
import { PREF } from "@/utils/const";
|
||||
|
||||
const CODE_LENGTH = 9;
|
||||
const COOLDOWN_MS = 3000;
|
||||
@@ -13,6 +15,8 @@ export default function WelcomeScreen() {
|
||||
const [isCooldown, setIsCooldown] = useState(false);
|
||||
const tourCodeRef = useRef("");
|
||||
const cooldownRef = useRef(-1);
|
||||
const [, setCode ] = useLocalStorage(PREF.code, "");
|
||||
const [, setStep ] = useLocalStorage(PREF.step, "0");
|
||||
|
||||
const checkCooldown = () => {
|
||||
if (cooldownRef.current === -1) return false;
|
||||
@@ -47,6 +51,8 @@ export default function WelcomeScreen() {
|
||||
setLastSubmitTs(cooldownRef.current);
|
||||
|
||||
console.log("submitted", value);
|
||||
setCode(value);
|
||||
setStep("1");
|
||||
};
|
||||
|
||||
const handleChange = (event: ChangeEvent<HTMLInputElement>): boolean => {
|
||||
|
||||
Reference in new issue
Block a user