import React, {useState, useCallback, useRef, useMemo} from 'react'; import { getFeatures } from '@ijl/cli'; import logo from '../assets/logo.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, Svg, CircleDiv, FullScreenButton, InputHolder, } from './style'; import { socket } from "../socket"; const keyboardFeature = getFeatures('hub-video-start')?.keyboard; const fullScreenFeature = getFeatures('hub-video-start')?.fullScreen; const Input = ({ onStart }) => { const [value, setValue] = useState(''); const [inFocuse, setInfocuse] = useState(true); const handleChange = useCallback(event => { setValue(event.target.value.toUpperCase()) }, [setValue]); const inputRef = useRef(null); const handleSubmit = useCallback((event) => { event.preventDefault(); if (value === 'SBER') { onStart() } }, [value]) return ( <>
Ввод: setInfocuse(true)} ref={inputRef} onClick={(event) => { event.preventDefault(); event.stopPropagation(); inputRef.current.blur(); }} id="input" autoComplete="off" /> setInfocuse(true)} />
{keyboardFeature && inFocuse && ( )} ) } export const Line = ({ hide, reverse, speed, delay, radius, progress, width, color }) => ( ) Line.defaultProps = { reverse: false } const Start = () => { const [sended, setSend] = useState(false); const handleCheck = () => { if (!sended) { socket.emit('play') setSend(true) } } return ( {/* */} СТАРТ ) } export const MainPage = () => { const [showStart, setShowStart] = useState(false); const [isFull, setFull] = useState(false); const handleFullScreen = useCallback(() => { const elem = document.documentElement; if (elem.requestFullscreen) { elem.requestFullscreen(); } else if (elem.webkitRequestFullscreen) { /* Safari */ elem.webkitRequestFullscreen(); } else if (elem.msRequestFullscreen) { /* IE11 */ elem.msRequestFullscreen(); } setFull(true); }, []); return ( {fullScreenFeature && !isFull && На весь экран} {/* */} {!showStart && setShowStart(true)} />} {showStart && } ); };