diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-07-22 14:07:39 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:48:18 +0200 |
| commit | 92ce9387f5c3ce54b4077ef6a5f604fc2cfe6ade (patch) | |
| tree | 90432dbd06a13d300f8307dea342f4639c9c57e7 /frontend/src/components/navigation/Navbar.js | |
| parent | ae8f03d514ba0982a34b96f1e29e262ca6048a19 (diff) | |
| parent | 8739a156b75ba96e15d1bb19b08ca829c1eb01e8 (diff) | |
Merge pull request #12 from atlarge-research/feature/scenario-plots
Plotting of portfolio results
Diffstat (limited to 'frontend/src/components/navigation/Navbar.js')
| -rw-r--r-- | frontend/src/components/navigation/Navbar.js | 43 |
1 files changed, 13 insertions, 30 deletions
diff --git a/frontend/src/components/navigation/Navbar.js b/frontend/src/components/navigation/Navbar.js index 0ef19ecb..b1f1f7ae 100644 --- a/frontend/src/components/navigation/Navbar.js +++ b/frontend/src/components/navigation/Navbar.js @@ -9,10 +9,8 @@ import './Navbar.css' export const NAVBAR_HEIGHT = 60 -export const NavItem = withRouter(props => <NavItemWithoutRoute {...props} />) -export const LoggedInSection = withRouter(props => ( - <LoggedInSectionWithoutRoute {...props} /> -)) +export const NavItem = withRouter((props) => <NavItemWithoutRoute {...props} />) +export const LoggedInSection = withRouter((props) => <LoggedInSectionWithoutRoute {...props} />) const GitHubLink = () => ( <a @@ -20,19 +18,12 @@ const GitHubLink = () => ( className="ml-2 mr-3 text-dark" style={{ position: 'relative', top: 7 }} > - <span className="fa fa-github fa-2x"/> + <span className="fa fa-github fa-2x" /> </a> ) const NavItemWithoutRoute = ({ route, location, children }) => ( - <li - className={classNames( - 'nav-item clickable', - location.pathname === route ? 'active' : undefined, - )} - > - {children} - </li> + <li className={classNames('nav-item clickable', location.pathname === route ? 'active' : undefined)}>{children}</li> ) const LoggedInSectionWithoutRoute = ({ location }) => ( @@ -48,28 +39,25 @@ const LoggedInSectionWithoutRoute = ({ location }) => ( ) : ( <NavItem route="/profile" key="profile"> <Link className="nav-link" title="My Profile" to="/profile"> - <ProfileName/> + <ProfileName /> </Link> </NavItem> ), <NavItem route="logout" key="logout"> - <Logout/> + <Logout /> </NavItem>, ] ) : ( <NavItem route="login"> - <GitHubLink/> - <Login visible={true}/> + <GitHubLink /> + <Login visible={true} /> </NavItem> )} </ul> ) const Navbar = ({ fullWidth, children }) => ( - <nav - className="navbar fixed-top navbar-expand-lg navbar-light bg-faded" - id="navbar" - > + <nav className="navbar fixed-top navbar-expand-lg navbar-light bg-faded" id="navbar"> <div className={fullWidth ? 'container-fluid' : 'container'}> <button className="navbar-toggler navbar-toggler-right" @@ -80,20 +68,15 @@ const Navbar = ({ fullWidth, children }) => ( aria-expanded="false" aria-label="Toggle navigation" > - <span className="navbar-toggler-icon"/> + <span className="navbar-toggler-icon" /> </button> - <Link - className="navbar-brand opendc-brand" - to="/" - title="OpenDC" - onClick={() => window.scrollTo(0, 0)} - > - <img src="/img/logo.png" alt="OpenDC"/> + <Link className="navbar-brand opendc-brand" to="/" title="OpenDC" onClick={() => window.scrollTo(0, 0)}> + <img src="/img/logo.png" alt="OpenDC" /> </Link> <div className="collapse navbar-collapse" id="navbarSupportedContent"> <ul className="navbar-nav mr-auto">{children}</ul> - <LoggedInSection/> + <LoggedInSection /> </div> </div> </nav> |
