Ver Fonte

renaming useMapWithMarkers to be clearer

Kirk Trombley há 5 anos atrás
pai
commit
f7603e6070

+ 2 - 2
client/src/components/screens/RoundSummary/RoundSummary.jsx

@@ -1,7 +1,7 @@
 import React, { useRef } from "react";
 import styled from "styled-components";
 import { useLastRound } from "../../../domain/gameStore";
-import useMapWithMarkers from "./useMapWithMarkers";
+import useMarkersFromGuesses from "./useMarkersFromGuesses";
 import useMap from "../../../hooks/useMap";
 import useClickMarker from "../../../hooks/useClickMarker";
 import NextRoundButton from "./NextRoundButton";
@@ -36,7 +36,7 @@ export default () => {
   const mapRef = useMap(mapDivRef, targetPoint.lat, targetPoint.lng, 4);
 
   // add the player guess markers
-  useMapWithMarkers(mapRef, roundNum, targetPoint);
+  useMarkersFromGuesses(mapRef, roundNum, targetPoint);
 
   // let the current player click the map to add a new marker
   useClickMarker(mapRef, ({ lat, lng }) => {

+ 1 - 3
client/src/components/screens/RoundSummary/useMapWithMarkers.jsx → client/src/components/screens/RoundSummary/useMarkersFromGuesses.jsx

@@ -5,7 +5,7 @@ import { makeQuestionMarker, makeFlagMarker, makeLine } from "./markers";
 import getColorGenerator from "./getColorGenerator";
 import { useRef } from "react";
 
-const useMapWithMarkers = (mapRef, roundNum, targetPoint) => {
+export default (mapRef, roundNum, targetPoint) => {
   // set up the flag at the target point
   useEffect(() => {
     const targetMarker = makeFlagMarker(mapRef.current, targetPoint);
@@ -47,5 +47,3 @@ const useMapWithMarkers = (mapRef, roundNum, targetPoint) => {
     return () => drawings.forEach((drawing) => drawing.setMap(null));
   }, [players, mapRef, targetPoint, playerColors]);
 };
-
-export default useMapWithMarkers;