diff --git a/src/components/AddPartyMemberButton.js b/src/components/AddPartyMemberButton.js index e425dc9..b4920b4 100644 --- a/src/components/AddPartyMemberButton.js +++ b/src/components/AddPartyMemberButton.js @@ -14,7 +14,7 @@ function AddPartyMemberButton({ streamId }) { return ( <> - + + + + + + + + + + + + + + + + + + + + + + + + + + ); +} + +function EncounterIcon() { + return ( + + + + + + + ); +} + +function GameViewSwitch({ view, onViewChange }) { + return ( + + onViewChange("social")} + > + + + onViewChange("encounter")} + > + + + + ); +} + +export default GameViewSwitch; diff --git a/src/components/Party.js b/src/components/Party.js index 51dcea5..2a27901 100644 --- a/src/components/Party.js +++ b/src/components/Party.js @@ -1,28 +1,78 @@ import React from "react"; -import { Flex } from "theme-ui"; +import { Flex, Box } from "theme-ui"; import PartyVideo from "./PartyVideo"; import AddPartyMemberButton from "./AddPartyMemberButton"; +import GameViewSwitch from "./GameViewSwitch"; -function Party({ streams, localStreamId }) { - return ( - - {Object.entries(streams).map(([id, stream]) => ( - - ))} - - - ); +function Party({ streams, localStreamId, view, onViewChange }) { + if (view === "social") { + return ( + + + {Object.entries(streams).map(([id, stream]) => ( + + + + ))} + + + + + + + + + ); + } else if (view === "encounter") { + return ( + + {Object.entries(streams).map(([id, stream]) => ( + + + + ))} + + + + + + + + ); + } + + return null; } +Party.defaultProps = { view: "social" }; + export default Party; diff --git a/src/components/PartyVideo.js b/src/components/PartyVideo.js index 1a80c72..0ab1f76 100644 --- a/src/components/PartyVideo.js +++ b/src/components/PartyVideo.js @@ -1,5 +1,4 @@ import React, { useRef, useEffect } from "react"; -import { Box } from "theme-ui"; function PartyVideo({ stream, muted }) { const videoRef = useRef(); @@ -11,14 +10,12 @@ function PartyVideo({ stream, muted }) { }, [stream]); return ( - - +