More things for web

This commit is contained in:
LionTion committed 2026-09-10 18:19:52 +02:00
1 parent 78b1058276
commit a1ab487084
8 files changed
+87 -8

No files matched your search

+6
View File
@@ -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 => {