Make map responsive

Keep all visible in nav
This commit is contained in:
2017-03-03 21:22:44 +00:00
parent 90ac57bcbc
commit 8023484aa7
8 changed files with 37 additions and 45 deletions

View File

@@ -14,7 +14,7 @@ class Map extends React.Component {
}; };
render() { render() {
const CeremonyGoogleMap = withGoogleMap(() => ( const GMap = withGoogleMap(() => (
<GoogleMap <GoogleMap
defaultZoom={this.props.defaultZoom} defaultZoom={this.props.defaultZoom}
defaultCenter={{ lat: this.props.lat, lng: this.props.lng }} defaultCenter={{ lat: this.props.lat, lng: this.props.lng }}
@@ -29,12 +29,25 @@ class Map extends React.Component {
</GoogleMap> </GoogleMap>
)); ));
return ( return (
<CeremonyGoogleMap <GMap
containerElement={ containerElement={
<div style={{ height: '360px', width: '360px' }} /> <div
style={{
height: '360px',
width: '100%',
'max-width': '480px',
overflow: 'hidden',
}}
/>
} }
mapElement={ mapElement={
<div style={{ height: '360px', width: '360px' }} /> <div
style={{
height: '360px',
width: '100%',
'max-width': '480px',
}}
/>
} }
/> />
); );

View File

@@ -17,16 +17,13 @@
} }
.link, .link,
.link:active,
.link:visited { .link:visited {
color: rgba(255, 255, 255, 0.8); color: rgba(255, 255, 255, 0.8);
} }
.active,
.link:active,
.link:hover { .link:hover {
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
border-color: #fff; border-color: #fff;
} }
.active {
display: none;
}

View File

@@ -52,7 +52,3 @@
.hotelLink:focus { .hotelLink:focus {
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
} }
.map {
width: 360px;
}

View File

@@ -55,14 +55,12 @@ class Accomodation extends React.Component {
<li key={index}><a className={s.hotelLink} href={hotel.url}>{hotel.title}</a></li> <li key={index}><a className={s.hotelLink} href={hotel.url}>{hotel.title}</a></li>
))} ))}
</ul> </ul>
<div className={s.map}> <Map
<Map defaultZoom={12}
defaultZoom={12} lat={offley[0].lat}
lat={offley[0].lat} lng={offley[0].lng}
lng={offley[0].lng} markers={hotels}
markers={hotels} />
/>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -46,7 +46,3 @@
color: #fff; color: #fff;
text-shadow: 1px 1px 4px var(--colour-nearblack); text-shadow: 1px 1px 4px var(--colour-nearblack);
} }
.map {
width: 360px;
}

View File

@@ -30,14 +30,12 @@ class Ceremony extends React.Component {
<p>The Church is located at the southern end of Kings Langley high street. <p>The Church is located at the southern end of Kings Langley high street.
Parking is available across the road at the Rose and Crown pub Parking is available across the road at the Rose and Crown pub
(Dan may be there before 1pm 😉).</p> (Dan may be there before 1pm 😉).</p>
<div className={s.map}> <Map
<Map defaultZoom={14}
defaultZoom={14} lat={markers[0].lat}
lat={markers[0].lat} lng={markers[0].lng}
lng={markers[0].lng} markers={markers}
markers={markers} />
/>
</div>
<h3>About the church</h3> <h3>About the church</h3>
<p>All Saints Church is a medieval church with parts dating from the 13th century. <p>All Saints Church is a medieval church with parts dating from the 13th century.
The main features of the body of the Church are the beautiful reredos, depicting The main features of the body of the Church are the beautiful reredos, depicting

View File

@@ -46,7 +46,3 @@
color: #fff; color: #fff;
text-shadow: 1px 1px 4px var(--colour-nearblack); text-shadow: 1px 1px 4px var(--colour-nearblack);
} }
.map {
width: 360px;
}

View File

@@ -33,14 +33,12 @@ class Reception extends React.Component {
followed by music until late.</p> followed by music until late.</p>
<h3>Where</h3> <h3>Where</h3>
<p>The venue is approximately 30 minute drive from the Church.</p> <p>The venue is approximately 30 minute drive from the Church.</p>
<div className={s.map}> <Map
<Map defaultZoom={12}
defaultZoom={12} lat={offley[0].lat}
lat={offley[0].lat} lng={offley[0].lng}
lng={offley[0].lng} markers={offley}
markers={offley} />
/>
</div>
</div> </div>
</div> </div>
</div> </div>