import Grid from '@mui/material/Grid' import { makeStyles } from '@material-ui/core' import { useSelector } from 'react-redux' import { useState,useRef } from 'react' import io from 'socket.io-client'; import Moveable from "react-moveable"; import { OnDrag } from "react-moveable"; import LeftBar from './LeftBar' import CentralBar from './CentralBar' import RightBar from './RightBar' import CallBar from './CallBar'; import { getRightIsOpen } from '../../redux/control/selector' import { getChatMemo } from '../../redux/chat/selector' import { getNightMode } from '../../redux/authorization/selector' import wallpaper from '../../img/wallpaper.jpg' import wallpaperNight from '../../img/wallpaperNight.jpg' import { prodSocketURL } from '../../helpers'; const socket = io(prodSocketURL) const useStyles = makeStyles({ container: { minHeight: '100vh', maxHeight: '100vh', }, centralAndRight: { display:'flex' }, myVideo: { width: 250, height: 'auto', cursor: 'pointer', position: 'absolute', top: 0, left: 0, zIndex: 150, backgroundColor:'#28e217', }, }) const HomePage = () => { const classes = useStyles() const rightIsOpen = useSelector(getRightIsOpen) const myVideoRef = useRef(null); const chatDivRef = useRef(null) const nightMode = useSelector(getNightMode) const { companionId } = useSelector(getChatMemo) const [callStatus,setCallStatus] = useState('') const backgroundImage = `url(${nightMode ? wallpaperNight : wallpaper})` const handleStartCall = () => setCallStatus('requesting') return (