summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/forms/subscription.form.js
blob: 3d863cbb34d1f1d285f67567202d02e69587c16a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import React, { Component } from 'react'

import { Arrow } from '../nav/viewer.icons'

export default class SubscriptionForm extends Component {
  state = {
    email: "",
  }
  constructor(props) {
    super(props)
    this.handleChange = this.handleChange.bind(this)
    this.handleKeyDown = this.handleKeyDown.bind(this)
    this.handleSubmit = this.handleSubmit.bind(this)
  }
  handleChange(e) {
    this.setState({ email: e.target.value })
  }
  handleKeyDown(e) {
    // disable tab
    if (e.keyCode === 9) {
      e.preventDefault()
    }
  }
  handleSubmit(e) {
    e.preventDefault()
  }
  render() {
    return (
      <form className="subscription-form" onSubmit={this.handleSubmit}>
        <div className="subscription-callout">
          Stay up to date and get notified when the next episode is available
        </div>
        <input
          required
          type="email"
          name="email"
          value={this.state.email}
          placeholder="Email address here"
          autoCorrect="off"
          autoCapitalize="off"
          spellCheck="false"
          onKeyDown={this.handleKeyDown}
          onChange={this.handleChange}
        />
        <Arrow type='right' />
      </form>
    )
  }
}