import React, {useState, useCallback, useRef} from 'react'; import { getFeatures } from '@ijl/cli'; import logo from '../assets/logo-white.svg'; import arrow from '../assets/36-arrow-right.svg'; import { Keyboard } from '../components/keyboard'; import { MainWrapper, InputElement, InputLabel, InputWrapper, LogoImg, ArrowImg, IconButton, StartWrapper, StartI, StartInput, StartLabel, HalfLine, HideGroup, Circle, LineSvg, } from './style'; import { socket } from "../socket"; const keyboardFeature = getFeatures('hub-video-start')?.keyboard; const Input = ({ onStart }) => { const [value, setValue] = useState(''); const [inFocuse, setInfocuse] = useState(false); const handleChange = useCallback(event => { setValue(event.target.value.toUpperCase()) }, [setValue]); const handleSubmit = useCallback((event) => { event.preventDefault(); if (value === 'SBER') { onStart() } }, [value]) return ( <>
Ввод: setInfocuse(true)} id="input" autoComplete="off" />
{keyboardFeature && inFocuse && ( )} ) } export const Line = ({ hide, reverse, speed, delay, radius, progress, width, color }) => ( ) Line.defaultProps = { reverse: false } const Start = () => { // const socketRef = useRef({ sent: false }); const [sended, setSend] = useState(false); const handleCheck = () => { // if (!socketRef.current.sent) { if (!sended) { socket.emit('play') // socketRef.current.sent = true setSend(true) } } return ( СТАРТ ) } export const MainPage = () => { const [showStart, setShowStart] = useState(false); return ( {!showStart && setShowStart(true)} />} {showStart && } ); };