This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This will be the BriefTemplate model which all Briefs will need to use. A BriefTemplate will always reference a 'type' which will be | |
// how we identify what further fields to use for that particular Brief. | |
{ | |
type: { | |
type: String, | |
enum: ['WEBSITE', 'ANDROID_APP'], | |
default: 'WEBSITE' | |
}, | |
status: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import '../utils'; | |
.bbc_arabic { | |
direction: #{map-deep-get($SCRIPT_TYPE_METRICS,BBC_ARABIC,DIRECTION)}; | |
font-family: #{map-deep-get($SCRIPT_TYPE_METRICS,BBC_ARABIC,FONT_FAMILY)}; | |
#content * { | |
visibility: visible; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.use(express.static(path.join(__dirname, 'client', 'build'))); | |
app.get('*', (req, res) => { | |
res.sendFile(path.join(__dirname, 'client', 'build', 'index.html')); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render() { | |
const {name, email, message} = this.state.fields; | |
return ( | |
<form ref={this.formElement} | |
onSubmit={() => this.submitForm()}> | |
<input type="text" | |
value={name} | |
onChange={event => this.onInputChange(event, 'name')} | |
name="name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
submitForm() { | |
const {name, email, message} = this.formElement.current.elements; | |
const payload = { | |
url: 'api/contact', | |
name: name, | |
email: email, | |
message: message, | |
}; | |
post(payload) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const post = async (data) => { | |
const { url } = data; | |
delete data.url; | |
const params = { | |
method: 'POST', | |
body: JSON.stringify(data), | |
headers: { | |
'Content-Type': 'application/json', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Our end-point for handling the enquiry request | |
app.post('/api/contact', (req, res, next) => { | |
return mailer.sendMail('[email protected]', ['[email protected]'], req.body) | |
.then(() => res.send(req.body)) | |
.catch(next); | |
}); | |
app.listen(port, () => console.log(`Listening on port ${port}`)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const app = express(); | |
const port = process.env.PORT || 5000; | |
AWS.config.update({region: 'eu-west-1'}); // Set the region that you configured in AWS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AWS = require('aws-sdk'); // Load the SDK for JavaScript | |
const mailer = require("./mailer"); | |
const express = require('express'); |
NewerOlder