equal
deleted
inserted
replaced
1 |
|
2 import PropTypes from 'prop-types'; |
1 import PropTypes from 'prop-types'; |
3 import React, { Component } from 'react'; |
2 import React, { Component } from 'react'; |
4 import { connect } from 'react-redux'; |
3 import { connect } from 'react-redux'; |
5 import { bindActionCreators } from 'redux'; |
4 import { bindActionCreators } from 'redux'; |
6 // import logo from './logo.svg'; |
5 // import logo from './logo.svg'; |
34 this.props.authActions.logout(); |
33 this.props.authActions.logout(); |
35 } |
34 } |
36 |
35 |
37 renderLogin() { |
36 renderLogin() { |
38 |
37 |
39 if (this.props.currentUser) { |
38 if (this.props.isAuthenticated) { |
40 return ( |
39 return ( |
41 <NavDropdown title={ this.props.currentUser.username } id="user-dropdown"> |
40 <NavDropdown title={ this.props.currentUser.get('username') } id="user-dropdown"> |
42 <MenuItem onClick={this.onClickSettings}>Settings</MenuItem> |
41 <MenuItem onClick={this.onClickSettings}>Settings</MenuItem> |
43 <MenuItem onClick={this.onClickLogout}>Logout</MenuItem> |
42 <MenuItem onClick={this.onClickLogout}>Logout</MenuItem> |
44 </NavDropdown> |
43 </NavDropdown> |
45 ); |
44 ); |
46 } |
45 } |
76 isAuthenticated: PropTypes.bool.isRequired |
75 isAuthenticated: PropTypes.bool.isRequired |
77 }; |
76 }; |
78 |
77 |
79 function mapStateToProps(state, props) { |
78 function mapStateToProps(state, props) { |
80 return { |
79 return { |
81 isAuthenticated: state.get('isAuthenticated'), |
80 isAuthenticated: state['isAuthenticated'], |
82 currentUser: state.get('currentUser'), |
81 currentUser: state['currentUser'], |
83 }; |
82 }; |
84 } |
83 } |
85 |
84 |
86 function mapDispatchToProps(dispatch) { |
85 function mapDispatchToProps(dispatch) { |
87 return { |
86 return { |