Sfoglia il codice sorgente

Making street view pano height an optional prop to make it easier to mitigate that issue later

Kirk Trombley 5 anni fa
parent
commit
f417ac3e03
1 ha cambiato i file con 10 aggiunte e 7 eliminazioni
  1. 10 7
      ui/src/components/game-panel.component.jsx

+ 10 - 7
ui/src/components/game-panel.component.jsx

@@ -10,7 +10,6 @@ const getMapUrl = googleApiKey => `https://maps.googleapis.com/maps/api/js?key=$
 const PositionedStreetView = compose(
   withProps({
     loadingElement: <div style={{ height: `100%` }} />,
-    containerElement: <div style={{ height: `70vh` }} />,
     mapElement: <div style={{ height: `100%` }} />,
   }),
   withScriptjs,
@@ -61,20 +60,24 @@ const GamePanel = ({
   selectedPoint,
   roundSeconds,
   onTimeout,
+  panoHeight = "85vh",
 }) => (
   <div style={{
     display: "flex",
     justifyContent: "space-between",
     alignItems: "center"
   }}>
-    <div style={{ flexGrow: 3 }}>
-      <PositionedStreetView
-        googleMapURL={getMapUrl(googleApiKey)}
-        point={streetViewPoint}
-      />
+    <div style={{ flex: 3 }}>
+      <div style={{ position: "relative", height: "100%"}}>
+        <PositionedStreetView
+          googleMapURL={getMapUrl(googleApiKey)}
+          containerElement={<div style={{ height: panoHeight }} />}
+          point={streetViewPoint}
+        />
+      </div>
     </div>
     <div style={{
-      flexGrow: 1,
+      flex: 1,
       display: "flex",
       flexDirection: "column",
       justifyContent:"space-around",