Add picture in chat and button to dashboard

Took 28 minutes
This commit is contained in:
Lucàs
2023-05-22 14:41:49 +02:00
parent 68f377ce37
commit eb1e3e08bd
6 changed files with 55 additions and 45 deletions
+14 -17
View File
@@ -1,31 +1,28 @@
import { Flex } from "@chakra-ui/react";
import { MapContainer, TileLayer } from "react-leaflet";
import SimpleMarkerBar from "./SimpleMarkerBar";
import "leaflet/dist/leaflet.css";
import {Flex} from '@chakra-ui/react';
import {MapContainer, TileLayer} from 'react-leaflet';
import SimpleMarkerBar from './SimpleMarkerBar';
import 'leaflet/dist/leaflet.css';
type MapBarProps = {
lat: string;
lon: string;
name: string;
align: "left" | "right";
align: 'left' | 'right';
};
export default function MapBar({ lat, lon, name, align }: MapBarProps) {
export default function MapBar({lat, lon, name}: MapBarProps) {
return (
<Flex justifyContent={align}>
<MapContainer
center={[Number(lat), Number(lon)]}
zoom={13}
minZoom={6}
zoomControl={false}
style={{ width: "100%", height: "20rem" }}
>
center={[Number(lat), Number(lon)]}
zoom={13}
minZoom={6}
zoomControl={false}
style={{width: '100%', 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'
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} />
<SimpleMarkerBar lat={lat} lon={lon} name={name}/>
</MapContainer>
</Flex>
);
}