-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added buttons below map #40
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ import './App.css' | |
import Map from './Map/Map' | ||
|
||
|
||
|
||
function App() { | ||
|
||
return ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
.leaflet-container { | ||
width: 100vw; | ||
height: 100vh; | ||
} | ||
|
||
.button-container { | ||
padding-left: 1rem; | ||
padding-right: 1rem; | ||
margin-top: 2rem; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I played around with the styles locally and to get a style that didn't push the buttons down to a place the user couldn't scroll to since the map would just move, I got this to render like the wireframes: .leaflet-container-wrapper {
display: flex;
flex-flow: column nowrap;
height: 100vh;
}
.leaflet-container {
width: 100vw;
height: 100%;
flex-grow: 1;
}
.button-container {
display: flex;
flex-flow: row nowrap;
justify-content: center;
z-index: 1000;
width: 100vw;
padding: 1rem 0;
background-color: white;
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. God bless you flexbox |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
import './Map.css' | ||
import { MapContainer, TileLayer, Marker, Popup } from 'react-leaflet' | ||
import 'leaflet/dist/leaflet.css' | ||
import Button from 'react-bootstrap/Button'; | ||
|
||
|
||
function Map() { | ||
|
||
return ( | ||
<div className="leaflet-container"> | ||
<MapContainer center={[39.952584, -75.165222]} zoom={13} scrollWheelZoom={true}> | ||
<TileLayer | ||
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' | ||
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" | ||
/> | ||
<Marker position={[39.952584, -75.165222]}> | ||
<Popup> | ||
This spots got a good vibe | ||
</Popup> | ||
</Marker> | ||
</MapContainer> | ||
<div className="leaflet-container-wrapper"> | ||
<div className="leaflet-container"> | ||
<MapContainer center={[39.952584, -75.165222]} zoom={13} scrollWheelZoom={true}> | ||
<TileLayer | ||
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' | ||
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" | ||
/> | ||
<Marker position={[39.952584, -75.165222]}> | ||
<Popup> | ||
This spots got a good vibe | ||
</Popup> | ||
</Marker> | ||
</MapContainer> | ||
</div> | ||
<div className="button-container"> | ||
<Button style={{backgroundColor:"#ADD8E6", marginLeft: '1rem', marginRight: '1rem'}} variant="primary">Near Me</Button> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The objects in the style section are all the same and could be refactored out to a |
||
<Button style={{backgroundColor:"#ADD8E6", marginLeft: '1rem', marginRight: '1rem'}} variant="primary">On the Way To</Button> | ||
<Button style={{backgroundColor:"#ADD8E6", marginLeft: '1rem', marginRight: '1rem'}} variant="primary">Around Destination</Button> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will actually be for #40, the link should point to the PR rather than the issue