From 05cf20fe8b370f6a910b917a8df80cbba697ea6b Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Thu, 19 Mar 2020 17:33:57 +1100 Subject: [PATCH] Added styling co-authored-by: nthouliss --- src/components/AddMapButton.js | 38 ++++++++++++++++++++++++++++++ src/components/Map.js | 12 ++++++++++ src/components/Party.js | 8 +++++-- src/components/PartyVideo.js | 9 ++++++- src/components/Tokens.js | 8 +++++++ src/routes/Game.js | 43 ++++++++++++++++++---------------- src/routes/Home.js | 10 ++++++-- src/routes/Join.js | 34 +++++++++++++++++---------- 8 files changed, 124 insertions(+), 38 deletions(-) create mode 100644 src/components/AddMapButton.js create mode 100644 src/components/Map.js create mode 100644 src/components/Tokens.js diff --git a/src/components/AddMapButton.js b/src/components/AddMapButton.js new file mode 100644 index 0000000..76f31a2 --- /dev/null +++ b/src/components/AddMapButton.js @@ -0,0 +1,38 @@ +import React, { useRef } from "react"; +import { IconButton } from "theme-ui"; + +function AddMapButton({ handleMapChange }) { + const fileInputRef = useRef(); + + function handleIconClicked() { + if (fileInputRef.current) { + fileInputRef.current.click(); + } + } + + return ( + <> + + + + + + + + + ); +} + +export default AddMapButton; diff --git a/src/components/Map.js b/src/components/Map.js new file mode 100644 index 0000000..55a95c9 --- /dev/null +++ b/src/components/Map.js @@ -0,0 +1,12 @@ +import React from "react"; +import { Image, Flex } from "theme-ui"; + +function Map({ imageSource }) { + return ( + + + + ); +} + +export default Map; diff --git a/src/components/Party.js b/src/components/Party.js index e3f267d..6d5674e 100644 --- a/src/components/Party.js +++ b/src/components/Party.js @@ -6,9 +6,13 @@ import PartyVideo from "./PartyVideo"; function Party({ streams, localStreamId }) { return ( - + {Object.entries(streams).map(([id, stream]) => ( - + ))} ); diff --git a/src/components/PartyVideo.js b/src/components/PartyVideo.js index d835b66..8708257 100644 --- a/src/components/PartyVideo.js +++ b/src/components/PartyVideo.js @@ -9,7 +9,14 @@ function PartyVideo({ stream, muted }) { } }, [stream]); - return ); } diff --git a/src/routes/Home.js b/src/routes/Home.js index 808a8fd..ac9500a 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -17,8 +17,14 @@ function Home() { } return ( - - + + diff --git a/src/routes/Join.js b/src/routes/Join.js index c9f288f..70acd8f 100644 --- a/src/routes/Join.js +++ b/src/routes/Join.js @@ -1,6 +1,6 @@ import React, { useContext } from "react"; import { navigate } from "hookrouter"; -import { Container, Box, Label, Input, Button } from "theme-ui"; +import { Container, Box, Label, Input, Button, Flex } from "theme-ui"; import GameContext from "../contexts/GameContext"; @@ -17,18 +17,26 @@ function Join() { } return ( - - - - - - + + + + + + + + ); }