1 import React, { Component } from 'react'; |
1 import React, { Component } from 'react'; |
2 import { connect } from 'react-redux'; |
2 import { connect } from 'react-redux'; |
3 import { bindActionCreators } from 'redux'; |
3 import { bindActionCreators } from 'redux'; |
4 import { Grid, Row, Col, Button, FormGroup, ControlLabel, FormControl } from 'react-bootstrap'; |
|
5 import '../App.css'; |
4 import '../App.css'; |
6 import Navbar from './Navbar'; |
5 import Navbar from './Navbar'; |
7 import * as userActions from '../actions/userActions'; |
6 import * as userActions from '../actions/userActions'; |
8 |
7 |
9 class Settings extends Component { |
8 class Settings extends Component { |
22 const lastname = this.props.currentUser ? this.props.currentUser.last_name : ''; |
21 const lastname = this.props.currentUser ? this.props.currentUser.last_name : ''; |
23 |
22 |
24 return ( |
23 return ( |
25 <div> |
24 <div> |
26 <Navbar history={this.props.history} /> |
25 <Navbar history={this.props.history} /> |
27 <Grid fluid> |
26 <div className="container-fluid"> |
28 <Row> |
27 <div className="row"> |
29 <Col md={6} mdOffset={3}> |
28 <div className="col-md-6 col-md-offset-3"> |
30 <form> |
29 <form> |
31 <FormGroup> |
30 <div className="form-group"> |
32 <ControlLabel>First name</ControlLabel> |
31 <label className="control-label">Prénom</label> |
33 <FormControl |
32 <input className="form-control" |
34 name="firstname" |
33 name="firstname" |
35 defaultValue={ firstname } |
34 defaultValue={ firstname } |
36 placeholder="First Name" |
35 placeholder="Entrez un prénom" |
37 inputRef={ ref => { this.firstname = ref; } } |
36 ref={(firstname) => { this.firstname = firstname; }} |
38 /> |
37 /> |
39 </FormGroup> |
38 </div> |
40 <FormGroup> |
39 <div className="form-group"> |
41 <ControlLabel>Last name</ControlLabel> |
40 <label className="control-label">Nom</label> |
42 <FormControl |
41 <input className="form-control" |
43 name="lastname" |
42 name="lastname" |
44 defaultValue={ lastname } |
43 defaultValue={ lastname } |
45 placeholder="Last Name" |
44 placeholder="Entrez un nom" |
46 inputRef={ ref => { this.lastname = ref; } } |
45 ref={(lastname) => { this.lastname = lastname; }} |
47 /> |
46 /> |
48 </FormGroup> |
47 </div> |
49 </form> |
48 </form> |
50 <Button block bsStyle="success" onClick={this.updateSettings}>Save settings</Button> |
49 <button type="submit" className="btn btn-primary btn-lg" onClick={this.updateSettings}>Enregistrer</button> |
51 </Col> |
50 </div> |
52 </Row> |
51 </div> |
53 </Grid> |
52 </div> |
54 </div> |
53 </div> |
55 ); |
54 ); |
56 } |
55 } |
57 } |
56 } |
58 |
57 |