feat(map in message): Added map in message of invite

This commit is contained in:
Laurian-Dufrechou
2023-05-21 00:41:50 +02:00
parent 5d0b0747b6
commit 366d6abf86
4 changed files with 97 additions and 14 deletions
+32
View File
@@ -0,0 +1,32 @@
import { Flex } from "@chakra-ui/react";
import { MapContainer, Marker, TileLayer } from "react-leaflet";
import SimpleMarkerBar from "./SimpleMarkerBar";
import MarkerClusterGroup from "@christopherpickering/react-leaflet-markercluster";
import "leaflet/dist/leaflet.css";
type MapBarProps = {
lat: string;
lon: string;
name: string;
align: "left" | "right";
};
export default function MapBar({ lat, lon, name, align }: MapBarProps) {
return (
<Flex justifyContent={align}>
<MapContainer
center={[Number(lat), Number(lon)]}
zoom={13}
minZoom={6}
zoomControl={false}
style={{ width: "50%", height: "20rem" }}
>
<TileLayer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
/>
<SimpleMarkerBar lat={lat} lon={lon} name={name} />
</MapContainer>
</Flex>
);
}