import { CSSProperties, Component } from 'react'; import { io } from 'socket.io-client'; import axios from 'axios'; import { userInfo } from '../api/api'; import * as cookies from 'react-cookies'; var socket = io("http://localhost:2080/api/game/socket/"); import { NavBar } from '../components/navbar'; import { CenteredPage } from '../components/page'; import { VoerBord } from '../components/voerBord'; import { DialogBox } from '../components/dialogBox'; import { CurrentGameSettings } from '../components/gameSettings'; import { Button, SearchBar } from '../components/ui'; import { GameBar } from '../components/gameBar'; import WifiTetheringRoundedIcon from '@material-ui/icons/WifiTetheringRounded'; import LinkRoundedIcon from '@material-ui/icons/LinkRounded'; var InviteButtonStyle: CSSProperties = { backgroundColor: "var(--page-background)", height: 160, padding: 12 } var InviteButtonIconStyle: CSSProperties = { fontSize: 100, position: "absolute", top: 12, left: "50%", transform: "translateX(-50%)" } var InviteButtonLabelStyle: CSSProperties = { position: "absolute", bottom: 12, left: "50%", transform: "translateX(-50%)", textAlign: "center", color: "var(--text-alt)", width: 136, fontSize: 20, userSelect: "none" } interface VoerGameProps { } class VoerGame extends Component { constructor(props: VoerGameProps) { super(props); } board = [...Array(7 * 6)].map(() => 0); userID = ""; move(column: number) { console.log(column) if(this.userID == "") { axios.request({ method: "get", url: `/api/user/info`, headers: {"content-type": "application/json"} }) .then(request => this.setState({ userID: request.data.id })) .catch(() => {}); } socket.emit("new_move", { move: column, token: cookies.load("token"), gameID: "fortnite" }) } render() { return
this.move(Number(m))}/>
} } export default function GamePage() { return (
{false &&
}
); }