Skip to content

Commit

Permalink
Merge pull request #40 from CodeForPhilly/buttons
Browse files Browse the repository at this point in the history
Added buttons below map
  • Loading branch information
sodamodo authored May 6, 2023
2 parents 3ccb959 + 2ad3851 commit 66dd1ad
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to release number versioning.
- Added Docker containers with docker-compose [#10](https://github.com/CodeForPhilly/third-places/pull/10)
- Set up Leaflet React component and boiletplate homepage[#7](https://github.com/CodeForPhilly/third-places/issues/7)
- Added initial Django models & migration [#21](https://github.com/CodeForPhilly/third-places/pull/21)
- Added buttons at bottom of Map [#40](https://github.com/CodeForPhilly/third-places/pull/40)

### Changed
- Made Leaflet map element fullscreen and rmeoved title[#27](https://github.com/CodeForPhilly/third-places/issues/27)
Expand Down
1 change: 0 additions & 1 deletion src/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import './App.css'
import Map from './Map/Map'



function App() {

return (
Expand Down
19 changes: 18 additions & 1 deletion src/app/src/Map/Map.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
.leaflet-container-wrapper {
display: flex;
flex-flow: column nowrap;
height: 100vh;
}

.leaflet-container {
width: 100vw;
height: 100vh;
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;
}
34 changes: 21 additions & 13 deletions src/app/src/Map/Map.tsx
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() {

const buttonStyle = {backgroundColor:"#ADD8E6", marginLeft: '1rem', marginRight: '1rem'}
return (
<div className="leaflet-container">
<MapContainer center={[39.952584, -75.165222]} zoom={13} scrollWheelZoom={true}>
<TileLayer
attribution='&copy; <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='&copy; <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={buttonStyle} variant="primary">Near Me</Button>
<Button style={buttonStyle} variant="primary">On the Way To</Button>
<Button style={buttonStyle} variant="primary">Around Destination</Button>
</div>
</div>
)
}

Expand Down

0 comments on commit 66dd1ad

Please sign in to comment.