1
- import React , { Component } from ' react' ;
2
- import { Button , ButtonToolbar } from ' react-bootstrap' ;
3
- import HeaderBackNavigation from ' ../../components/Navigation/HeaderBackNavigation' ;
4
- import VoterStore from ' ../../stores/VoterStore' ;
1
+ import React , { Component } from " react" ;
2
+ import { Button , ButtonToolbar } from " react-bootstrap" ;
3
+ import HeaderBackNavigation from " ../../components/Navigation/HeaderBackNavigation" ;
4
+ import VoterStore from " ../../stores/VoterStore" ;
5
5
6
6
export default class Location extends Component {
7
- constructor ( props ) {
7
+ constructor ( props ) {
8
8
super ( props ) ;
9
- this . state = { }
9
+ this . state = { } ;
10
10
}
11
11
12
- componentDidMount ( ) {
13
- VoterStore . getLocation ( location => {
12
+ componentDidMount ( ) {
13
+ VoterStore . getLocation ( ( err , location ) => {
14
14
this . setState ( { location } ) ;
15
- } )
15
+ } ) ;
16
16
}
17
17
18
18
updateLocation ( e ) {
@@ -21,49 +21,47 @@ export default class Location extends Component {
21
21
} ) ;
22
22
}
23
23
24
- saveLocation ( e ) {
24
+ saveLocation ( ) {
25
25
var { location } = this . state ;
26
- VoterStore . saveLocation ( location , ( err , location ) => {
26
+ VoterStore . saveLocation ( location , ( err ) => {
27
27
if ( err ) return console . error ( err ) ;
28
28
29
- window . location . href = "/ballot"
29
+ window . location . href = "/ballot" ;
30
30
31
31
} ) ;
32
32
}
33
33
34
- render ( ) {
34
+ render ( ) {
35
35
var { location } = this . state ;
36
36
37
- return (
38
- < div >
39
- < div className = "container-fluid well well-90" >
40
- < h2 className = "text-center" >
41
- Change Location
42
- </ h2 >
43
- < div >
44
- < span className = "small" >
45
- Please enter the address (or just the city) where you registered to
46
- vote. The more location information you can provide, the more ballot information will
47
- be visible.
48
- </ span >
37
+ return < div >
38
+ < div className = "container-fluid well well-90" >
39
+ < h2 className = "text-center" >
40
+ Change Location
41
+ </ h2 >
42
+ < div >
43
+ < span className = "small" >
44
+ Please enter the address (or just the city) where you registered to
45
+ vote. The more location information you can provide, the more ballot information will
46
+ be visible.
47
+ </ span >
49
48
50
- < input
51
- type = "text"
52
- onChange = { this . updateLocation . bind ( this ) }
53
- name = "address"
54
- value = { location }
55
- className = "form-control"
56
- defaultValue = "Oakland, CA" />
49
+ < input
50
+ type = "text"
51
+ onChange = { this . updateLocation . bind ( this ) }
52
+ name = "address"
53
+ value = { location }
54
+ className = "form-control"
55
+ defaultValue = "Oakland, CA" />
57
56
58
- < ButtonToolbar >
59
- < Button
60
- onClick = { this . saveLocation . bind ( this ) }
61
- bsStyle = "primary" > Save Location</ Button >
57
+ < ButtonToolbar >
58
+ < Button
59
+ onClick = { this . saveLocation . bind ( this ) }
60
+ bsStyle = "primary" > Save Location</ Button >
62
61
63
- </ ButtonToolbar >
64
- </ div >
65
- </ div >
62
+ </ ButtonToolbar >
63
+ </ div >
66
64
</ div >
67
- ) ;
65
+ </ div > ;
68
66
}
69
67
}
0 commit comments