diff --git a/src/components/Home/Home.jsx b/src/components/Home/Home.jsx index 051a4f2..ddeb496 100644 --- a/src/components/Home/Home.jsx +++ b/src/components/Home/Home.jsx @@ -32,6 +32,10 @@ import { DrawerOverlay, DrawerContent, DrawerCloseButton, + Alert, + AlertIcon, + AlertTitle, + AlertDescription, } from "@chakra-ui/react"; import { SettingsIcon, ChevronDownIcon, StarIcon } from "@chakra-ui/icons"; import logo from "../../assets/images/small_logo.png"; @@ -91,7 +95,6 @@ export default function Home() { const [focusLocation, setFocusLocation] = useState(); const [screenWidth, setScreenWidth] = useState(window.screen.width); const [uploadImg, setUploadImg] = useState(""); - console.log("In parent, setUploadImg type:", typeof setUploadImg); // LOGIN MODAL const { @@ -333,6 +336,7 @@ export default function Home() { + - - - Filter - - - - - + {isEdit ? ( + + + + Click on the Map to place your item 📍 + + + ) : ( + <> + + + Filter + + + + + - - - - - - {isFilterOff() ? ( - All Posts - ) : ( - - - Filter: ON - - - - )} - - - - - - - setSearch(e.target.value)} - /> - + + + + + + {isFilterOff() ? ( + All Posts + ) : ( + + + Filter: ON + + + + )} + + + + + + + setSearch(e.target.value)} + /> + - - - - + + + + - - - - - - + + + + + + + > + )} { return ( @@ -172,7 +172,7 @@ export default function Map({ itemDate: "", }); setIsCreate(!isCreate); - setUploadImg("") + setUploadImg(""); }) .catch((err) => console.log(err)); @@ -214,6 +214,33 @@ export default function Map({ ); } + const NewItemMarker = () => { + const map = useMapEvents({ + click(event) { + const { lat, lng } = event.latlng; + setPosition([lat, lng]); + }, + }); + + return position[0] !== centerPosition[0] && + position[1] !== centerPosition[1] ? ( + + + toggleDraggable()}> + Click to Confirm Location 🤔 + + + + ) : null; + }; + return ( } {!isEdit} {!isEdit && allMarkers} - {isEdit && ( + {/* {isEdit && ( - )} + )} */} + {isEdit && } {showDonut && focusLocation && ( <>