Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cdc6614c63 | |||
| 75740699f1 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "wedding",
|
||||
"version": "1.1.0",
|
||||
"version": "1.2.0",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": ">=6.5",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Navigation",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"private": true,
|
||||
"main": "./Navigation.js"
|
||||
}
|
||||
|
||||
@@ -48,3 +48,28 @@
|
||||
color: #fff;
|
||||
text-shadow: 1px 1px 4px var(--colour-nearblack);
|
||||
}
|
||||
|
||||
.button {
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 10px 20px;
|
||||
opacity: 0.75;
|
||||
outline: 0;
|
||||
border: 4px solid #fff;
|
||||
border-radius: 14px;
|
||||
background: var(--colour-nearblack);
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
font-size: 18px;
|
||||
line-height: 1.3333333;
|
||||
cursor: pointer;
|
||||
transition: opacity ease-in-out 0.25s, box-shadow ease-in-out 0.25s;
|
||||
}
|
||||
|
||||
.button:hover,
|
||||
.button:focus {
|
||||
opacity: 0.9;
|
||||
box-shadow: 0 0 4px #fff;
|
||||
}
|
||||
|
||||
@@ -18,10 +18,22 @@ class Giftlist extends React.Component {
|
||||
is the most amazing honeymoon possible. We have the basics covered but
|
||||
we’re hoping for the holiday of a lifetime. We would like to see
|
||||
and do everything we’ve dreamed about!</p>
|
||||
<p>Right now we’re busy curating our list, but fret not, we
|
||||
won’t take long! Please do check back here in the coming days,
|
||||
we’ll have a link on this page.</p>
|
||||
<p>Here’s how our gift list works. Just pick the item you’d
|
||||
most like to give us. You’ll then be asked to leave your name
|
||||
and any message you have for us. There is the option to use the PayPal
|
||||
system to send your gift (you can use a credit card – you
|
||||
don’t need a PayPal account). Or, on the day, you could bring
|
||||
the value of your gift in a card.</p>
|
||||
<p>We’ll send you a link to our online photo gallery when we get
|
||||
back and we’ll be sure to tell (bore) you all about it in great
|
||||
detail.</p>
|
||||
<p className={s.sig}>Dan and Hana</p>
|
||||
<a
|
||||
className={s.button}
|
||||
href="https://www.our-wedding-list.co.uk/danielandhana/list"
|
||||
>
|
||||
View our list
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,13 +6,13 @@ import NotFound from '../notFound/NotFound';
|
||||
import { rsvpEndDate, getRsvpEnd } from '../../config';
|
||||
|
||||
let title = 'RSVP';
|
||||
|
||||
let attending = 'day';
|
||||
export default {
|
||||
|
||||
path: '/rsvp/:password',
|
||||
|
||||
isEditable() {
|
||||
return new Date() < rsvpEndDate;
|
||||
return new Date() < rsvpEndDate[attending];
|
||||
},
|
||||
|
||||
async action({ params }) {
|
||||
@@ -35,6 +35,9 @@ export default {
|
||||
};
|
||||
}
|
||||
|
||||
// Assuming all connected guests have the same invite
|
||||
attending = people[0].ceremony ? 'day' : 'evening';
|
||||
|
||||
return {
|
||||
title,
|
||||
component: (
|
||||
@@ -42,7 +45,7 @@ export default {
|
||||
<Rsvp
|
||||
title={title}
|
||||
people={people}
|
||||
rsvpEnd={getRsvpEnd()}
|
||||
rsvpEnd={getRsvpEnd(attending)}
|
||||
isEditable={this.isEditable()}
|
||||
/>
|
||||
</Layout>
|
||||
|
||||
@@ -149,12 +149,6 @@ app.get('/rsvp/:code', bouncer.block, (req, res, next) => {
|
||||
|
||||
app.post('/rsvp/save', (req, res) => {
|
||||
try {
|
||||
if (new Date() > rsvpEndDate) {
|
||||
res.json({
|
||||
success: false,
|
||||
err: 'RSVP end date has elapsed',
|
||||
});
|
||||
} else {
|
||||
const update = {};
|
||||
update[req.body.prop] = req.body.value;
|
||||
Person.update(update, {
|
||||
@@ -165,7 +159,13 @@ app.post('/rsvp/save', (req, res) => {
|
||||
Person.findOne({
|
||||
where: { key: req.body.key },
|
||||
}).then(data => {
|
||||
if (data.completed) {
|
||||
const endDate = rsvpEndDate[(data.ceremony ? 'day' : 'evening')];
|
||||
if (new Date() > endDate) {
|
||||
return res.json({
|
||||
success: false,
|
||||
err: 'RSVP end date has elapsed',
|
||||
});
|
||||
} else if (data.completed) {
|
||||
const attending = `\nAttending: ${data.attending ? 'Yes' : 'No'}`;
|
||||
const starter = (data.attending && data.starter !== -1) ? `\nStarter: ${starters[data.starter]}` : '';
|
||||
const main = (data.attending && data.main !== -1) ? `\nMain: ${mains[data.main]}` : '';
|
||||
@@ -174,7 +174,7 @@ app.post('/rsvp/save', (req, res) => {
|
||||
sendSlackMsgWithDebounce(`${data.firstname} ${data.lastname} has saved their RSVP:${attending}${starter}${main}${dietary}`, '#wedding-rsvps', req.body.key);
|
||||
sendRSVPEmailWithDebounce(data);
|
||||
}
|
||||
res.json({
|
||||
return res.json({
|
||||
success: true,
|
||||
prop: req.body.prop,
|
||||
});
|
||||
@@ -192,7 +192,6 @@ app.post('/rsvp/save', (req, res) => {
|
||||
err,
|
||||
});
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
Rollbar.handleError(err);
|
||||
res.json({
|
||||
|
||||
Reference in New Issue
Block a user