equal
deleted
inserted
replaced
|
1 |
1 import PropTypes from 'prop-types'; |
2 import PropTypes from 'prop-types'; |
2 import React, { Component } from 'react'; |
3 import React, { Component } from 'react'; |
3 import { connect } from 'react-redux'; |
4 import { connect } from 'react-redux'; |
4 import { bindActionCreators } from 'redux'; |
5 import { bindActionCreators } from 'redux'; |
5 // import logo from './logo.svg'; |
6 // import logo from './logo.svg'; |
21 onClickLogin = (e) => { |
22 onClickLogin = (e) => { |
22 e.preventDefault(); |
23 e.preventDefault(); |
23 this.props.history.push('/login'); |
24 this.props.history.push('/login'); |
24 } |
25 } |
25 |
26 |
|
27 onClickSettings = (e) => { |
|
28 e.preventDefault(); |
|
29 this.props.history.push('/settings'); |
|
30 } |
|
31 |
26 onClickLogout = (e) => { |
32 onClickLogout = (e) => { |
27 e.preventDefault(); |
33 e.preventDefault(); |
28 this.props.authActions.logout(); |
34 this.props.authActions.logout(); |
29 } |
35 } |
30 |
36 |
31 renderLogin() { |
37 renderLogin() { |
32 |
38 |
33 if (this.props.currentUser) { |
39 if (this.props.currentUser) { |
34 return ( |
40 return ( |
35 <NavDropdown title={ this.props.currentUser.username } id="user-dropdown"> |
41 <NavDropdown title={ this.props.currentUser.username } id="user-dropdown"> |
36 <MenuItem>Settings</MenuItem> |
42 <MenuItem onClick={this.onClickSettings}>Settings</MenuItem> |
37 <MenuItem onClick={this.onClickLogout}>Logout</MenuItem> |
43 <MenuItem onClick={this.onClickLogout}>Logout</MenuItem> |
38 </NavDropdown> |
44 </NavDropdown> |
39 ); |
45 ); |
40 } |
46 } |
41 |
47 |