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,81 +8,78 @@ import './header.css';
* Render the main header using a responsive design * Render the main header using a responsive design
*/ */
class Header extends React.Component { class Header extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = {collapseMenu: true}; this.state = {collapseMenu: true};
this.handleClick = this.handleClick.bind(this); this.handleClick = this.handleClick.bind(this);
} }
handleClick() { handleClick() {
this.setState(state => ({ this.setState(state => ({
collapseMenu: !state.collapseMenu collapseMenu: !state.collapseMenu
})); }));
} }
render() { render() {
return ( return (
<header className="main-header"> <header className="main-header">
<nav className="navbar navbar-light navbar-expand-md"> <nav className="navbar navbar-light navbar-expand-md">
<span className="navbar-brand"> <span className="navbar-brand">
<Logo/> <Logo/>
</span> </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"
<span className="navbar-toggler-icon"></span> onClick={this.handleClick} aria-expanded="false" aria-label="Toggle navigation">
</button> <span className="navbar-toggler-icon"></span>
<div className={this.state.collapseMenu ? 'collapse navbar-collapse' : 'navbar-collapse'} id="navbarSupportedContent"> </button>
<ul className="navbar-nav ml-auto"> <div className={this.state.collapseMenu ? 'collapse navbar-collapse' : 'navbar-collapse'}>
<li className="nav-item"> <ul className="navbar-nav ml-auto">
<a className="nav-link" href="https://pages.colouring.london">Hello</a> <li className="nav-item">
</li> <a className="nav-link" href="https://pages.colouring.london">Hello</a>
<li className="nav-item"> </li>
<a className="nav-link" href="https://pages.colouring.london/buildingcategories">Data Categories</a> <li className="nav-item">
</li> <a className="nav-link" href="https://pages.colouring.london/buildingcategories">Data Categories</a>
<li className="nav-item"> </li>
<NavLink to="/view/age.html" className="nav-link">View Maps</NavLink> <li className="nav-item">
</li> <NavLink to="/view/age.html" className="nav-link">View Maps</NavLink>
<li className="nav-item"> </li>
<NavLink to="/edit/age.html" className="nav-link">Add/Edit Data</NavLink> <li className="nav-item">
</li> <NavLink to="/edit/age.html" className="nav-link">Add/Edit Data</NavLink>
<li className="nav-item"> </li>
<a className="nav-link" href="https://pages.colouring.london/about">More about</a> <li className="nav-item">
</li> <a className="nav-link" href="https://pages.colouring.london/about">More about</a>
<li className="nav-item"> </li>
<a className="nav-link" href="https://pages.colouring.london/whoisinvolved">Who's Involved?</a> <li className="nav-item">
</li> <a className="nav-link" href="https://pages.colouring.london/whoisinvolved">Who's Involved?</a>
<li className="nav-item"> </li>
<a className="nav-link" href="https://discuss.colouring.london">Discuss</a> <li className="nav-item">
</li> <a className="nav-link" href="https://discuss.colouring.london">Discuss</a>
{ </li>
this.props.user? {
( 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> <li className="nav-item">
</li> <NavLink to="/my-account.html" className="nav-link">
): My account (Logged in as {this.props.user.username})
( </NavLink>
<Fragment> </li>
<li className="nav-item"> ):
<NavLink to="/login.html" className="nav-link">Log in</NavLink> (
</li> <Fragment>
<li className="nav-item"> <li className="nav-item">
<NavLink to="/sign-up.html" className="nav-link">Sign up</NavLink> <NavLink to="/login.html" className="nav-link">Log in</NavLink>
</li> </li>
</Fragment> <li className="nav-item">
) <NavLink to="/sign-up.html" className="nav-link">Sign up</NavLink>
} </li>
</ul> </Fragment>
</div> )
</nav> }
</header> </ul>
</div>
</nav>
</header>
); );
} }
} }
export default Header; export default Header;