Whitespace in header.js

This commit is contained in:
Tom Russell 2019-05-27 16:12:01 +01:00
parent ec1a682b8a
commit 942349f5c1

View File

@ -8,22 +8,18 @@ import './header.css';
* Render the main header using a responsive design
*/
class Header extends React.Component {
constructor(props) {
super(props);
this.state = {collapseMenu: true};
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
this.setState(state => ({
collapseMenu: !state.collapseMenu
}));
}
render() {
return (
<header className="main-header">
@ -31,10 +27,11 @@ class Header extends React.Component {
<span className="navbar-brand">
<Logo/>
</span>
<button className="navbar-toggler navbar-toggler-right" type="button" onClick={this.handleClick} data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<button className="navbar-toggler navbar-toggler-right" type="button"
onClick={this.handleClick} aria-expanded="false" aria-label="Toggle navigation">
<span className="navbar-toggler-icon"></span>
</button>
<div className={this.state.collapseMenu ? 'collapse navbar-collapse' : 'navbar-collapse'} id="navbarSupportedContent">
<div className={this.state.collapseMenu ? 'collapse navbar-collapse' : 'navbar-collapse'}>
<ul className="navbar-nav ml-auto">
<li className="nav-item">
<a className="nav-link" href="https://pages.colouring.london">Hello</a>
@ -61,7 +58,9 @@ class Header extends React.Component {
this.props.user?
(
<li className="nav-item">
<NavLink to="/my-account.html" className="nav-link">My account (Logged in as {this.props.user.username})</NavLink>
<NavLink to="/my-account.html" className="nav-link">
My account (Logged in as {this.props.user.username})
</NavLink>
</li>
):
(
@ -81,8 +80,6 @@ class Header extends React.Component {
</header>
);
}
}
export default Header;