summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/forms/subscription.form.js
blob: 9353e3e3074bad2daea6a17409e1073a0290ca00 (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
50
51
52
53
54
55
56
57
58
59
60
61
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}
        />
        <label className="subscription-privacy">
          <span>
            {"I have read e-flux’s privacy policy "}
            {"and agree that e-flux may send me emails to the email address "}
            {"entered above and that my data will be processed for this "}
            {"purpose in accordance with e-flux’s "}
            <a href="/privacy">privacy policy.</a>
          </span>
        </label>
        <button onClick={this.handleSubmit}>
          {'Submit '}
          <Arrow type='right' />
        </button>
      </form>
    )
  }
}