-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7fd08e0
commit 7447dee
Showing
18 changed files
with
24,421 additions
and
2,282 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import { Route, Routes } from "react-router-dom"; | ||
import IndexPage from "./pages/IndexPage"; | ||
import RegisterCard from "./components/header/RegisterCard"; | ||
import LoginCard from "./components/header/LoginCard"; | ||
import DetectLocation from "./pages/DetectLocationPage"; | ||
import Map from "./components/Map"; | ||
|
||
function App() { | ||
return ( | ||
<Routes> | ||
<Route index element={<IndexPage />}></Route> | ||
<Route exact path="/find-restaurants" element={<DetectLocation />}></Route> | ||
<Route path="/your-location" element={<Map />}></Route> | ||
</Routes> | ||
); | ||
} | ||
|
||
export default App | ||
export default App; |
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
src/components/header/LoginCard.jsx → src/components/LoginCard.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { GoogleMap, useJsApiLoader } from "@react-google-maps/api"; | ||
import { useCallback, useState } from "react"; | ||
|
||
function Map() { | ||
|
||
const { isLoaded } = useJsApiLoader({ | ||
id: "google-map-script", | ||
googleMapsApiKey: import.meta.env.REACT_APP_GOOGLE_MAP_API_KEY, | ||
}); | ||
const [map, setMap] = useState(null) | ||
|
||
const onLoad = useCallback((map) => { | ||
const bounds = new window.google.maps.LatLngBounds(map.center); | ||
map.fitBounds(bounds); | ||
|
||
setMap(map) | ||
}, []) | ||
|
||
const onUnmount = useCallback(function callback(map) { | ||
setMap(null) | ||
}, []) | ||
|
||
return isLoaded ? ( | ||
<GoogleMap | ||
mapContainerStyle={{ width: "100vw", height: "100vh" }} | ||
center={{ lat: 26.862471, lng: 75.762413 }} | ||
zoom={10} | ||
onLoad={onLoad} | ||
onUnmount={onUnmount} | ||
> | ||
{/* Child components, such as markers, info windows, etc. */} | ||
<></> | ||
</GoogleMap> | ||
) : ( | ||
<div>Loading...</div> | ||
); | ||
} | ||
|
||
export default Map; |
3 changes: 2 additions & 1 deletion
3
src/components/header/RegisterCard.jsx → src/components/RegisterCard.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { useState } from "react"; | ||
import { FaSearch } from "react-icons/fa"; | ||
import {TbCurrentLocation} from "react-icons/tb" | ||
import { Link } from "react-router-dom"; | ||
|
||
function SearchBar() { | ||
return ( | ||
<div className="bg-white w-full rounded-xl h-12 flex items-center px-4 shadow-xl"> | ||
<FaSearch className="text-primary text-xl" /> | ||
<input | ||
placeholder="Type to Search..." | ||
className="bg-transparent border-none text-xl h-full w-full ml-2.5 focus:outline-none"> | ||
</input> | ||
<Link to="/your-location"><TbCurrentLocation className="text-primary text-2xl" /></Link> | ||
</div> | ||
); | ||
} | ||
|
||
export default SearchBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function SearchResult() { | ||
return ( | ||
<div className="px-5 py-2.5 hover:bg-gray-300"></div> | ||
); | ||
} | ||
|
||
export default SearchResult; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import SearchResult from "./SearchResult"; | ||
|
||
function SearchResultList() { | ||
return ( | ||
<div className="w-full bg-white flex flex-col rounded-xl mt-4 max-h-80 overflow-y-scroll shadow-l"> | ||
<SearchResult /> | ||
</div> | ||
); | ||
} | ||
|
||
export default SearchResultList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import SearchBar from "../components/SearchBar"; | ||
import SearchResultList from "../components/SearchResultsList"; | ||
|
||
function DetectLocation() { | ||
return ( | ||
<div className="bg-secondary w-screen h-screen"> | ||
<div className="w-2/5 flex min-w-200 flex-col m-auto items-center pt-80"> | ||
<SearchBar /> | ||
<SearchResultList /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default DetectLocation; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function NearByRestaurants() { | ||
return ( | ||
<div> | ||
<Maps /> | ||
</div> | ||
) | ||
} | ||
|
||
export default NearByRestaurants; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.