Basic react state
This commit is contained in:
parent
7ace77d7df
commit
91c1e88a4c
1 changed files with 20 additions and 1 deletions
|
@ -1,7 +1,17 @@
|
|||
import React, { Component } from 'react';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
class NavBar extends Component {
|
||||
constructor (props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
logged_in: false,
|
||||
auth_menu_visible: false
|
||||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div className="ui four item secondary menu">
|
||||
|
@ -20,4 +30,13 @@ class NavBar extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
export default NavBar;
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
logged_in: state.logged_in,
|
||||
auth_menu_collapsed: state.auth_menu_collapsed
|
||||
};
|
||||
}
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
)(NavBar);
|
||||
|
|
Reference in a new issue