Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
230 changes: 31 additions & 199 deletions project-app/components/Map/Map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ import "leaflet/dist/leaflet.css";
import { icon } from "leaflet";
import { MapContainer, TileLayer, Marker, Popup, useMap } from "react-leaflet";
import { OpenStreetMapProvider, GeoSearchControl } from "leaflet-geosearch";
import { GestureHandling } from "leaflet-gesture-handling";
import "leaflet-defaulticon-compatibility";
import "leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.webpack.css";
import "leaflet-gesture-handling/dist/leaflet-gesture-handling.css";

export function ChangeView({ coords }) {
const map = useMap();
map.setView(coords, 12);
return null;
}
//stops map from scrolling while hovering over it (user must press ctrl to enable zoom scroll))
L.Map.addInitHook("addHandler", "gestureHandling", GestureHandling);

const ICON = icon({
iconUrl: "/litter.svg",
iconSize: [48, 48],
iconSize: [38, 38],
});

export default function Map() {
Expand Down Expand Up @@ -78,7 +82,13 @@ export default function Map() {
};

return (
<MapContainer center={center} zoom={12} style={{ height: "50vh" }}>
<MapContainer
zoomControl={false}
center={center}
zoom={12}
gestureHandling={true}
style={{ height: "60vh" }}
>
<TileLayer
attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
Expand All @@ -92,210 +102,32 @@ export default function Map() {
<DraggableMarker />
<Marker icon={ICON} position={[50.764687233616314, 0.282817434969637]}>
<Popup>
<h3 className="text-xl font-bold">Eastbourne Pier Cleanup</h3>
<br />
<span className="text-lg font-bold">Location: </span>
<span className="text-lg"> Eastbourne Pier</span>
<br />
<br />
<span className="text-lg font-bold">Date: </span>
<span className="text-lg"> 22.08.22</span>
<br />
<br />
<span className="text-lg font-bold">Time: </span>
<span className="text-lg"> 09:00 - 12:00</span>
<br />
<br />
<span className="text-lg font-bold">Host: </span>
<span className="text-lg"> Blake Lawrence</span>
<br />
<br />
<span className="text-lg font-bold">Notes: </span>
<span className="text-lg">
Easy walk, no hills, will be collecting on sand and pavement
</span>
<br />
<button className="p-2 border rounded bg-[#004F54] p-2 border rounded bg-[#004F54] text-white mt-4">
Join
</button>
</Popup>
</Marker>
<Marker icon={ICON} position={[50.75557501067619, 0.2649897700883658]}>
<Popup>
<h3 className="text-xl font-bold">Eastbourne Pier Cleanup</h3>
<br />
<span className="text-lg font-bold">Location: </span>
<span className="text-lg"> Eastbourne Pier</span>
<br />
<br />
<span className="text-lg font-bold">Date: </span>
<span className="text-lg"> 22.08.22</span>
<br />
<br />
<span className="text-lg font-bold">Time: </span>
<span className="text-lg"> 09:00 - 12:00</span>
<br />
<br />
<span className="text-lg font-bold">Host: </span>
<span className="text-lg"> Blake Lawrence</span>
<br />
<br />
<span className="text-lg font-bold">Notes: </span>
<span className="text-lg">
Easy walk, no hills, will be collecting on sand and pavement
</span>
<br />
<button className="p-2 border rounded bg-[#004F54] p-2 border rounded bg-[#004F54] text-white mt-4">
Join
</button>
</Popup>
</Marker>
<Marker icon={ICON} position={[50.77767391366154, 0.3014166296154623]}>
<Popup>
<h3 className="text-xl font-bold">Eastbourne Pier Cleanup</h3>
<br />
<span className="text-lg font-bold">Location: </span>
<span className="text-lg"> Eastbourne Pier</span>
<br />
<br />
<span className="text-lg font-bold">Date: </span>
<span className="text-lg"> 22.08.22</span>
<br />
<br />
<span className="text-lg font-bold">Time: </span>
<span className="text-lg"> 09:00 - 12:00</span>
<br />
<br />
<span className="text-lg font-bold">Host: </span>
<span className="text-lg"> Blake Lawrence</span>
<br />
<br />
<span className="text-lg font-bold">Notes: </span>
<span className="text-lg">
Easy walk, no hills, will be collecting on sand and pavement
</span>
<br />
<button className="p-2 border rounded bg-[#004F54] p-2 border rounded bg-[#004F54] text-white mt-4">
Join
</button>
</Popup>
</Marker>
<Marker icon={ICON} position={[50.75898456492425, 0.2400856926565753]}>
<Popup>
<h3 className="text-xl font-bold">Eastbourne Pier Cleanup</h3>
<br />
<span className="text-lg font-bold">Location: </span>
<span className="text-lg"> Eastbourne Pier</span>
<br />
<br />
<span className="text-lg font-bold">Date: </span>
<span className="text-lg"> 22.08.22</span>
<br />
<br />
<span className="text-lg font-bold">Time: </span>
<span className="text-lg"> 09:00 - 12:00</span>
<br />
<br />
<span className="text-lg font-bold">Host: </span>
<span className="text-lg"> Blake Lawrence</span>
<br />
<br />
<span className="text-lg font-bold">Notes: </span>
<span className="text-lg">
Easy walk, no hills, will be collecting on sand and pavement
</span>
<br />
<button className="p-2 border rounded bg-[#004F54] text-white mt-4">
Join
</button>
</Popup>
</Marker>
<Marker icon={ICON} position={[50.78029517229998, -1.075059110234425]}>
<Popup>
<h3 className="text-xl font-bold">Eastbourne Pier Cleanup</h3>
<br />
<span className="text-lg font-bold">Location: </span>
<span className="text-lg"> Eastbourne Pier</span>
<br />
<br />
<span className="text-lg font-bold">Date: </span>
<span className="text-lg"> 22.08.22</span>
<br />
<br />
<span className="text-lg font-bold">Time: </span>
<span className="text-lg"> 09:00 - 12:00</span>
<br />
<br />
<span className="text-lg font-bold">Host: </span>
<span className="text-lg"> Blake Lawrence</span>
<br />
<br />
<span className="text-lg font-bold">Notes: </span>
<span className="text-lg">
Easy walk, no hills, will be collecting on sand and pavement
</span>
<br />
<button className="p-2 border rounded bg-[#004F54] p-2 border rounded bg-[#004F54] text-white mt-4">
Join
</button>
</Popup>
</Marker>
<Marker icon={ICON} position={[50.776949712097135, -1.1435608447074601]}>
<Popup>
<h3 className="text-xl font-bold">Eastbourne Pier Cleanup</h3>
<br />
<span className="text-lg font-bold">Location: </span>
<span className="text-lg"> Eastbourne Pier</span>
<br />
<br />
<span className="text-lg font-bold">Date: </span>
<span className="text-lg"> 22.08.22</span>
<br />
<br />
<span className="text-lg font-bold">Time: </span>
<span className="text-lg"> 09:00 - 12:00</span>
<br />
<br />
<span className="text-lg font-bold">Host: </span>
<span className="text-lg"> Blake Lawrence</span>
<br />
<br />
<span className="text-lg font-bold">Notes: </span>
<span className="text-lg">
Easy walk, no hills, will be collecting on sand and pavement
</span>
<br />
<button className="p-2 border rounded bg-[#004F54] p-2 border rounded bg-[#004F54] text-white mt-4">
Join
</button>
</Popup>
</Marker>
<Marker icon={ICON} position={[50.80959469871429, -0.5261761200190278]}>
<Popup>
<h3 className="text-xl font-bold">Eastbourne Pier Cleanup</h3>
<br />
<span className="text-lg font-bold">Location: </span>
<span className="text-lg"> Eastbourne Pier</span>
<br />
<br />
<span className="text-lg font-bold">Date: </span>
<span className="text-lg"> 22.08.22</span>
<br />
<br />
<span className="text-lg font-bold">Time: </span>
<span className="text-lg"> 09:00 - 12:00</span>
<h3 className="text-xs sm:text-sm font-bold underline">
Eastbourne Pier Cleanup
</h3>

<span className="text-[9px] sm:text-xs font-bold">Location: </span>
<span className="text-[8px]"> Eastbourne Pier</span>
<br />

<span className="text-[9px] sm:text-xs font-bold">Date: </span>
<span className="text-[8px]"> 22.08.22</span>
<br />
<span className="text-lg font-bold">Host: </span>
<span className="text-lg"> Blake Lawrence</span>

<span className="text-[9px] sm:text-xs font-bold">Time: </span>
<span className="text-[8px] sm:text-md"> 09:00 - 12:00</span>
<br />

<span className="text-[9px] sm:text-xs font-bold">Host: </span>
<span className="text-[8px]"> Blake Lawrence</span>

<br />
<span className="text-lg font-bold">Notes: </span>
<span className="text-lg">
<span className="text-[9px] sm:text-xs font-bold">Notes: </span>
<span className="text-[8px]">
Easy walk, no hills, will be collecting on sand and pavement
</span>
<br />
<button className="p-2 border rounded bg-[#004F54] p-2 border rounded bg-[#004F54] text-white mt-4">
<button className="flex items-center justify-center w-6 sm:w-10 text-[9px] sm:text-xs p-1 border rounded bg-[#004F54] p-2 border rounded bg-[#004F54] text-white mt-1">
Join
</button>
</Popup>
Expand Down
2 changes: 1 addition & 1 deletion project-app/components/Weather/SearchBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";

const SearchBar = ({ fetchWeather, handleChange, city }) => {
return (
<div className="w-96 xl:w-80 ml-4 xl:ml-40 mr-4">
<div className="w-90 sm:w-1/2 md:w-2/5 lg:w-72 xl:w-80 ml-4 mr-4 mb-2 mt-2 sm:mb-4">
<label
htmlFor="default-search"
className="mb-2 text-sm font-medium text-gray-900 sr-only dark:text-gray-300"
Expand Down
8 changes: 4 additions & 4 deletions project-app/components/Weather/Weather.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Weather = () => {
console.log(data);
setWeatherObject(data);
//uncomment the below city State after development stage - means each time you make a change, props cant be found
setCity("");
// setCity("");
}

useEffect(() => {
Expand All @@ -35,10 +35,10 @@ const Weather = () => {

return (
<div id="weather" className="mt-8">
<h2 className="text-3xl text-[#004F54] md:text-5xl font-bold ml-40">
Check The Weather
<h2 className="text-lg sm:text-xl md:text-2xl lg:text-3xl text-[#004F54] font-bold ml-4">
Check The Weather...
</h2>
<div className="flex flex-col sm:flex-row md:justify-start">
<div className="flex flex-col sm:flex-row sm:items-center md:justify-start">
<SearchBar
handleChange={handleChange}
fetchWeather={fetchWeather}
Expand Down
Loading