diff --git a/nest_frontend/components/base/BoxMap.js b/nest_frontend/components/base/BoxMap.js new file mode 100644 index 0000000..cf8cf43 --- /dev/null +++ b/nest_frontend/components/base/BoxMap.js @@ -0,0 +1,32 @@ +import React from "react" +import Style from "./BoxMap.module.css" +import BoxFull from "./BoxFull" +import { MapContainer, TileLayer } from "react-leaflet" + + +export default function BoxMap({ header, setMap, startingPosition, startingZoom, button, ...props }) { + return ( + + + +
+
+ {button} +
+
+
+
+ ) +} diff --git a/nest_frontend/components/interactive/BoxConditionMap.module.css b/nest_frontend/components/base/BoxMap.module.css similarity index 79% rename from nest_frontend/components/interactive/BoxConditionMap.module.css rename to nest_frontend/components/base/BoxMap.module.css index dcb726c..8a33217 100644 --- a/nest_frontend/components/interactive/BoxConditionMap.module.css +++ b/nest_frontend/components/base/BoxMap.module.css @@ -1,4 +1,4 @@ -.BoxConditionMapContents { +.BoxMapContents { display: flex; flex-direction: column; padding: 0; @@ -9,6 +9,3 @@ height: 300px; border-radius: 0 0 25px 25px; } - -.Button { -} \ No newline at end of file diff --git a/nest_frontend/components/interactive/BoxConditionMap.js b/nest_frontend/components/interactive/BoxConditionMap.js index 0cf8bdc..1315b4e 100644 --- a/nest_frontend/components/interactive/BoxConditionMap.js +++ b/nest_frontend/components/interactive/BoxConditionMap.js @@ -1,13 +1,11 @@ import React, { useCallback, useContext, useEffect, useState } from "react" -import BoxFull from "../base/BoxFull" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import { faMapPin, faPlus } from "@fortawesome/free-solid-svg-icons" -import Style from "./BoxConditionMap.module.css" import ButtonIconOnly from "../base/ButtonIconOnly" -import { MapContainer, TileLayer } from "react-leaflet" import useRepositoryEditor from "../../hooks/useRepositoryEditor" import Condition from "../../utils/Condition" import ContextLanguage from "../../contexts/ContextLanguage" +import BoxMap from "../base/BoxMap" const STARTING_POSITION = { lat: 41.89309, lng: 12.48289 } @@ -99,7 +97,7 @@ export default function BoxConditionMap({ ...props }) { } return ( - {strings.searchBy} @@ -109,30 +107,17 @@ export default function BoxConditionMap({ ...props }) { {strings.byZone} } - childrenClassName={Style.BoxConditionMapContents} - {...props} - > - - -
-
- -
-
-
-
+ } + {...props} + /> ) }