Sfoglia il codice sorgente

Removed the map-div class from the css

Kirk Trombley 5 anni fa
parent
commit
951a5128ce

+ 7 - 1
client/src/components/screens/GamePanel/ClickMarkerMap.jsx

@@ -1,10 +1,16 @@
 import React, { useRef } from "react";
+import styled from "styled-components";
 import useMap from "../../../hooks/useMap";
 import useClickMarker from "./useClickMarker";
 
+const MapDiv = styled.div`
+  height: 100%;
+  width: 100%;
+`
+
 export default ({ onMarkerMoved }) => {
   const mapDivRef = useRef(null);
   const mapRef = useMap(mapDivRef);
   useClickMarker(mapRef, onMarkerMoved);
-  return <div className="map-div" ref={mapDivRef} />
+  return <MapDiv ref={mapDivRef} />
 }

+ 7 - 1
client/src/components/screens/RoundSummary/RoundSummary.jsx

@@ -1,8 +1,14 @@
 import React, { useRef } from "react";
+import styled from "styled-components";
 import useMap from "../../../hooks/useMap";
 import useMarkedPoints from "./useMarkedPoints";
 import RoundInfoPane from "./RoundInfoPane";
 
+const MapDiv = styled.div`
+  height: 100%;
+  width: 100%;
+`
+
 export default ({ gameId, round, onNext }) => {
   const {
     roundNum,
@@ -17,7 +23,7 @@ export default ({ gameId, round, onNext }) => {
 
   return (
     <div className="round-summary">
-      <div className="round-summary__map"><div className="map-div" ref={mapDivRef} /></div>
+      <div className="round-summary__map"><MapDiv ref={mapDivRef} /></div>
       <RoundInfoPane {...{ gameId, selectedPoint, targetPoint, roundNum, score, totalScore, onNext }}/>
     </div>
   );

+ 0 - 5
client/src/index.css

@@ -17,8 +17,3 @@ code {
   width: 100% !important;
   height: 100% !important;
 }
-
-.map-div {
-  height: 100%;
-  width: 100%;
-}