From 5c0272fc2d722083b4cb60de4b9159ae3204681d Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Mon, 13 Apr 2020 18:29:46 +1000 Subject: [PATCH] Moved join screen to a modal --- src/App.js | 4 --- src/components/Modal.js | 3 ++- src/{routes/Join.js => modals/JoinModal.js} | 30 +++++++++++---------- src/routes/Home.js | 14 ++++++---- 4 files changed, 27 insertions(+), 24 deletions(-) rename src/{routes/Join.js => modals/JoinModal.js} (69%) diff --git a/src/App.js b/src/App.js index ac1b803..f5afa39 100644 --- a/src/App.js +++ b/src/App.js @@ -5,7 +5,6 @@ import { HashRouter as Router, Switch, Route } from "react-router-dom"; import theme from "./theme.js"; import Home from "./routes/Home"; import Game from "./routes/Game"; -import Join from "./routes/Join"; import About from "./routes/About"; import FAQ from "./routes/FAQ"; @@ -20,9 +19,6 @@ function App() { - - - diff --git a/src/components/Modal.js b/src/components/Modal.js index 79c23d6..1b9bd00 100644 --- a/src/components/Modal.js +++ b/src/components/Modal.js @@ -2,7 +2,7 @@ import React from "react"; import Modal from "react-modal"; import { useThemeUI, Close } from "theme-ui"; -function StyledModal({ isOpen, onRequestClose, children }) { +function StyledModal({ isOpen, onRequestClose, children, ...props }) { const { theme } = useThemeUI(); return ( @@ -22,6 +22,7 @@ function StyledModal({ isOpen, onRequestClose, children }) { maxHeight: "100%", }, }} + {...props} > {children} @@ -44,13 +46,13 @@ function Join() { name="id" value={gameId || ""} onChange={handleChange} + ref={inputRef} /> -