add invite game mode

This commit is contained in:
2026-11-15 19:19:35 +03:00
parent 8f70bb639d
commit a91eccbeaa
12 changed files with 600 additions and 58 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ export default function CodeInput({ onSubmit }) {
const focusInput = (i) => inputsRef.current[i]?.focus()
const handleChange = (i, raw) => {
const chars = raw.toUpperCase().replace(/[^A-Z0-9]/g, '')
const chars = raw.toUpperCase().replace(/[^A-Z]/g, '')
if (!chars) return
const next = [...values]
// Поддержка вставки нескольких символов (paste в отдельное поле тоже)
@@ -47,7 +47,7 @@ export default function CodeInput({ onSubmit }) {
const handlePaste = (e) => {
e.preventDefault()
const text = e.clipboardData.getData('text').toUpperCase().replace(/[^A-Z0-9]/g, '')
const text = e.clipboardData.getData('text').toUpperCase().replace(/[^A-Z]/g, '')
if (!text) return
const next = Array(CODE_LENGTH).fill('')
for (let k = 0; k < Math.min(text.length, CODE_LENGTH); k++) next[k] = text[k]