import React, { useState, useRef } from "react"; import { Box, Label, Input, Button, Flex } from "theme-ui"; import { useHistory } from "react-router-dom"; import Modal from "../components/Modal"; function JoinModal({ isOpen, onRequestClose }) { let history = useHistory(); const [gameId, setGameId] = useState(""); function handleChange(event) { setGameId(event.target.value); } function handleSubmit(event) { event.preventDefault(); history.push(`/game/${gameId}`); } const inputRef = useRef(); function focusInput() { inputRef.current && inputRef.current.focus(); } return ( ); } export default JoinModal;