Add Ceremony page with google map

Add nav bar to public pages
This commit is contained in:
2017-03-01 23:28:26 +00:00
parent 92899edbe5
commit 6a7b57dbe4
17 changed files with 273 additions and 5 deletions

View File

@@ -0,0 +1,31 @@
import React from 'react';
import { withGoogleMap, GoogleMap, Marker } from 'react-google-maps';
class CeremonyMap extends React.Component {
render() {
const CeremonyGoogleMap = withGoogleMap(() => (
<GoogleMap
defaultZoom={14}
defaultCenter={{ lat: 51.7109, lng: -0.4479 }}
>
<Marker
title="All Saints' Church"
position={{ lat: 51.7109, lng: -0.4479 }}
key="0"
/>
</GoogleMap>
));
return (
<CeremonyGoogleMap
containerElement={
<div style={{ height: '360px', width: '360px' }} />
}
mapElement={
<div style={{ height: '360px', width: '360px' }} />
}
/>
);
}
}
export default CeremonyMap;

View File

@@ -0,0 +1,6 @@
{
"name": "CeremonyMap",
"version": "0.0.0",
"private": true,
"main": "./CeremonyMap.js"
}

View File

@@ -23,6 +23,7 @@ class Html extends React.Component {
<link rel="apple-touch-icon" href="apple-touch-icon.png" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Palanquin+Dark|Niconne" />
{style && <style id="css" dangerouslySetInnerHTML={{ __html: style }} />}
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAY-RO-FaBZyAh8FDJneMc6NjMdK2D8WtQ" />
</head>
<body>
<div id="app" dangerouslySetInnerHTML={{ __html: children }} />

View File

@@ -1,15 +1,18 @@
import React, { PropTypes } from 'react';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import s from './Layout.css';
import Navigation from '../Navigation';
class Layout extends React.Component {
static propTypes = {
children: PropTypes.node.isRequired,
current: PropTypes.string,
};
render() {
return (
<div>
<Navigation current={this.props.current} />
{this.props.children}
</div>
);

View File

@@ -0,0 +1,32 @@
.root {
position: fixed;
top: 0;
right: 0;
left: 0;
text-align: center;
background: rgba(0, 0, 0, 0.1);
}
.link {
display: inline-block;
padding: 8px 8px 6px;
text-decoration: none;
font-size: 1.125em;
border-bottom: 2px solid transparent;
transition: color 0.3s ease-in, border-color 0.3s ease-in;
}
.link,
.link:active,
.link:visited {
color: rgba(255, 255, 255, 0.8);
}
.link:hover {
color: rgba(255, 255, 255, 1);
border-color: #fff;
}
.active {
display: none;
}

View File

@@ -0,0 +1,24 @@
import React, { PropTypes } from 'react';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import s from './Navigation.css';
import Link from '../Link';
class Navigation extends React.Component {
static propTypes = {
current: PropTypes.string,
};
render() {
if (!this.props.current) {
return null;
}
return (
<div className={s.root} role="navigation">
<Link className={[s.link, this.props.current === 'home' ? s.active : null].join(' ')} to="/">RSVP</Link>
<Link className={[s.link, this.props.current === 'ceremony' ? s.active : null].join(' ')} to="/ceremony">Church</Link>
</div>
);
}
}
export default withStyles(s)(Navigation);

View File

@@ -0,0 +1,6 @@
{
"name": "Navigation",
"version": "0.0.0",
"private": true,
"main": "./Navigation.js"
}

View File

@@ -0,0 +1,56 @@
@import '../../components/variables.css';
.root {
width: 100vw;
height: 100vh;
}
.bgImage {
position: fixed;
width: 100vw;
height: 100vh;
background: url('/img/church_2560.jpg');
background-size: cover;
background-position-x: 54%;
background-color: #c1c1c1;
filter: grayscale(1) brightness(0.6);
z-index: -1;
transition: filter ease-in-out 0.5s;
}
.bgImageFocus {
filter: grayscale(0.4) brightness(1);
}
.container {
padding-top: 50px;
margin: 0 20px;
}
.headings {
max-width: 640px;
margin: 0 auto 40px;
text-align: center;
color: #fff;
text-shadow: 3px 3px 8px var(--colour-nearblack);
font-size: 1.3em;
}
.headings h1 {
margin: 0 0 10px;
}
.subheading {
font-family: var(--font-family-cursive);
}
.content {
max-width: 960px;
margin: 0 auto;
color: #fff;
text-shadow: 1px 1px 4px var(--colour-nearblack);
}
.map {
width: 360px;
}

View File

@@ -0,0 +1,53 @@
import React from 'react';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import s from './Ceremony.css';
import CeremonyMap from '../../components/CeremonyMap';
class Ceremony extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
focusBgImage = (focus) => {
this.setState({ focusBgImage: focus });
}
render() {
return (
<div className={s.root}>
<div
className={[
s.bgImage,
this.state.focusBgImage ? s.bgImageFocus : null,
].join(' ')}
/>
<div className={s.container}>
<div className={s.headings}>
<h1>All Saints&#8217; Church</h1>
<h2 className={s.subheading}>Church Lane<br />Kings Langley<br />WD4 8JS</h2>
</div>
<div className={s.content}>
<h3>When</h3>
<p>The Ceremony begins at 1pm</p>
<h3>Where</h3>
<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
(Dan may be there before 1pm 😉).</p>
<div className={s.map}>
<CeremonyMap />
</div>
<h3>About the church</h3>
<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 Last Supper, and the fine Jacobean pulpit with its intricate carvings.
The Tower has a peal of 8 bells that are regularly rung before Services.</p>
<p>The church was chosen because it is Dan&#8217;s family church.</p>
</div>
</div>
</div>
);
}
}
export default withStyles(s)(Ceremony);

View File

@@ -0,0 +1,15 @@
import React from 'react';
import Ceremony from './Ceremony';
import Layout from '../../components/Layout';
export default {
path: '/ceremony',
action() {
return {
title: 'Ceremony',
component: <Layout current="ceremony"><Ceremony /></Layout>,
};
},
};

View File

@@ -23,7 +23,7 @@
}
.container {
padding-top: 5vh;
padding-top: 50px;
margin: 0 20px;
}

View File

@@ -9,7 +9,7 @@ export default {
action() {
return {
title: 'Welcome',
component: <Layout><Home /></Layout>,
component: <Layout current="home"><Home /></Layout>,
};
},
};

View File

@@ -9,6 +9,7 @@ export default {
children: [
require('./home').default,
require('./rsvp').default,
require('./ceremony').default,
require('./login').default,
require('./admin').default,
require('./adminPeople').default,

View File

@@ -7,6 +7,6 @@
.container {
margin: 0 auto;
padding: 0 0 40px;
padding: 50px 0 40px;
max-width: var(--max-content-width);
}

View File

@@ -38,7 +38,7 @@ export default {
return {
title,
component: (
<Layout>
<Layout current="home">
<Rsvp
title={title}
people={people}