2018-01-31 09:35:27 +00:00
|
|
|
import React, { Component } from 'react'
|
2018-03-29 15:03:28 +00:00
|
|
|
import Page from '../components/Page'
|
|
|
|
|
|
|
|
import * as gtag from '../lib/gtag'
|
2018-01-31 09:35:27 +00:00
|
|
|
|
|
|
|
export default class extends Component {
|
|
|
|
state = { message: '' }
|
|
|
|
|
2018-03-29 15:03:28 +00:00
|
|
|
handleInput = e => {
|
|
|
|
this.setState({ message: e.target.value })
|
|
|
|
}
|
|
|
|
|
|
|
|
handleSubmit = e => {
|
|
|
|
e.preventDefault()
|
|
|
|
|
|
|
|
gtag.event({
|
|
|
|
action: 'submit_form',
|
|
|
|
category: 'Contact',
|
|
|
|
label: this.state.message
|
|
|
|
})
|
|
|
|
|
|
|
|
this.setState({ message: '' })
|
|
|
|
}
|
|
|
|
|
2018-01-31 09:35:27 +00:00
|
|
|
render () {
|
|
|
|
return (
|
2018-03-29 15:03:28 +00:00
|
|
|
<Page>
|
2018-01-31 09:35:27 +00:00
|
|
|
<h1>This is the Contact page</h1>
|
|
|
|
<form onSubmit={this.handleSubmit}>
|
|
|
|
<label>
|
|
|
|
<span>Message:</span>
|
|
|
|
<textarea onInput={this.handleInput} value={this.state.message} />
|
|
|
|
</label>
|
|
|
|
<button type='submit'>submit</button>
|
|
|
|
</form>
|
2018-03-29 15:03:28 +00:00
|
|
|
</Page>
|
2018-01-31 09:35:27 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|