|
@@ -3,7 +3,7 @@ import { compose, withProps } from "recompose";
|
|
|
import { withScriptjs, withGoogleMap, StreetViewPanorama, GoogleMap, Marker } from "react-google-maps";
|
|
|
import { gameInfo, getGuesses, sendGuess } from "../../services/ggsh.service";
|
|
|
import withGoogleApiKey from "../with-google-key.component";
|
|
|
-import RoundTimer from "../round-timer.component";
|
|
|
+import GuessPane from "./guess-pane.component";
|
|
|
import Loading from '../loading.component';
|
|
|
|
|
|
// TODO want a button for moving the pano back to start somehow
|
|
@@ -30,32 +30,6 @@ const PositionedStreetView = compose(
|
|
|
/>
|
|
|
);
|
|
|
|
|
|
-const SelectionMap = compose(
|
|
|
- withProps({
|
|
|
- loadingElement: <div style={{ height: `100%` }} />,
|
|
|
- containerElement: <div style={{ height: `100%` }} />,
|
|
|
- mapElement: <div style={{ height: `100%` }} />,
|
|
|
- }),
|
|
|
- withScriptjs,
|
|
|
- withGoogleMap
|
|
|
-)(({onClick, markerPosition}) =>
|
|
|
- <GoogleMap
|
|
|
- defaultZoom={1}
|
|
|
- defaultCenter={{ lat: 25, lng: -25}}
|
|
|
- clickableIcons={false}
|
|
|
- options={{
|
|
|
- disableDefaultUI: true,
|
|
|
- fullscreenControl: true,
|
|
|
- }}
|
|
|
- onClick={onClick}>
|
|
|
- {markerPosition ? <Marker
|
|
|
- clickable={false}
|
|
|
- draggable={false}
|
|
|
- position={markerPosition}
|
|
|
- /> : null}
|
|
|
- </GoogleMap>
|
|
|
-);
|
|
|
-
|
|
|
const GamePanel = ({
|
|
|
googleApiKey,
|
|
|
onSelectPoint,
|
|
@@ -80,29 +54,13 @@ const GamePanel = ({
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style={{
|
|
|
- height: "100%",
|
|
|
- flex: 1,
|
|
|
- display: "flex",
|
|
|
- flexDirection: "column",
|
|
|
- justifyContent:"space-around",
|
|
|
- }}>
|
|
|
- <RoundTimer style={{ flex: 1 }} seconds={roundSeconds} onTimeout={onTimeout} />
|
|
|
- <div style={{ height: "100%", margin: "5px", flex: 6 }}>
|
|
|
- <SelectionMap
|
|
|
- googleMapURL={getMapUrl(googleApiKey)}
|
|
|
- onClick={({ latLng }) => onSelectPoint({ lat: latLng.lat(), lng: latLng.lng() })}
|
|
|
- markerPosition={selectedPoint}
|
|
|
- />
|
|
|
- </div>
|
|
|
- <button
|
|
|
- style={{ margin: "5px", flex: 1 }}
|
|
|
- onClick={onSubmitGuess}
|
|
|
- disabled={submitDisabled || selectedPoint === null}
|
|
|
- >
|
|
|
- Submit Guess
|
|
|
- </button>
|
|
|
- </div>
|
|
|
+ <GuessPane
|
|
|
+ roundSeconds={roundSeconds}
|
|
|
+ onTimeout={onTimeout}
|
|
|
+ onSelectPoint={onSelectPoint}
|
|
|
+ onSubmitGuess={onSubmitGuess}
|
|
|
+ submitDisabled={submitDisabled || selectedPoint === null}
|
|
|
+ />
|
|
|
</div>
|
|
|
);
|
|
|
|