|
@@ -1,10 +1,34 @@
|
|
|
import React, { useState } from 'react';
|
|
|
+import styled from 'styled-components';
|
|
|
import { sendGuess } from "../../../domain/GGSHService";
|
|
|
import Loading from '../../util/Loading';
|
|
|
import GuessPane from "./GuessPane";
|
|
|
import PositionedStreetView from "./PositionedStreetView";
|
|
|
import useRoundInfo from "./useRoundInfo";
|
|
|
|
|
|
+const Container = styled.div`
|
|
|
+ height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-flow: column nowrap;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ @media only screen and (min-width: 600px) and (min-height: 600px) {
|
|
|
+ display: block;
|
|
|
+ position: relative;
|
|
|
+ margin-bottom: 2px;
|
|
|
+ margin-right: 2px;
|
|
|
+ }
|
|
|
+`
|
|
|
+
|
|
|
+const StreetViewWrapper = styled.div`
|
|
|
+ height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ margin-bottom: 2px;
|
|
|
+ flex: 3;
|
|
|
+`
|
|
|
+
|
|
|
const GamePanelContainer = ({ gameId, playerName, onRoundEnd, onGameEnd }) => {
|
|
|
const [submitDisabled, setSubmitDisabled] = useState(false);
|
|
|
const [selectedPoint, setSelectedPoint] = useState(null);
|
|
@@ -33,10 +57,10 @@ const GamePanelContainer = ({ gameId, playerName, onRoundEnd, onGameEnd }) => {
|
|
|
}
|
|
|
|
|
|
return (
|
|
|
- <div className="game-panel">
|
|
|
- <div className="game-panel__streetview">
|
|
|
+ <Container>
|
|
|
+ <StreetViewWrapper>
|
|
|
<PositionedStreetView position={targetPoint} />
|
|
|
- </div>
|
|
|
+ </StreetViewWrapper>
|
|
|
<GuessPane
|
|
|
roundSeconds={roundSeconds}
|
|
|
onTimeout={handleSubmitGuess}
|
|
@@ -44,7 +68,7 @@ const GamePanelContainer = ({ gameId, playerName, onRoundEnd, onGameEnd }) => {
|
|
|
onSubmitGuess={handleSubmitGuess}
|
|
|
submitDisabled={submitDisabled || selectedPoint === null}
|
|
|
/>
|
|
|
- </div>
|
|
|
+ </Container>
|
|
|
);
|
|
|
}
|
|
|
|