From b14ba802ade3f724edfa6b2b09b643faa583f911 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 28 Oct 2020 14:12:41 +0100 Subject: Migrate to Reactstrap for Navbar --- frontend/src/components/navigation/Navbar.js | 131 ++++++++++++++------------- 1 file changed, 69 insertions(+), 62 deletions(-) (limited to 'frontend/src/components/navigation/Navbar.js') diff --git a/frontend/src/components/navigation/Navbar.js b/frontend/src/components/navigation/Navbar.js index 164a2309..55f98900 100644 --- a/frontend/src/components/navigation/Navbar.js +++ b/frontend/src/components/navigation/Navbar.js @@ -1,6 +1,15 @@ -import classNames from 'classnames' -import React from 'react' -import { Link, withRouter } from 'react-router-dom' +import React, { useState } from 'react' +import { Link, useLocation } from 'react-router-dom' +import { + Navbar as RNavbar, + NavItem as RNavItem, + NavLink, + NavbarBrand, + NavbarToggler, + Collapse, + Nav, + Container, +} from 'reactstrap' import { userIsLoggedIn } from '../../auth/index' import Login from '../../containers/auth/Login' import Logout from '../../containers/auth/Logout' @@ -9,9 +18,6 @@ import './Navbar.sass' export const NAVBAR_HEIGHT = 60 -export const NavItem = withRouter((props) => ) -export const LoggedInSection = withRouter((props) => ) - const GitHubLink = () => ( ( ) -const NavItemWithoutRoute = ({ route, location, children }) => ( -
  • {children}
  • -) +export const NavItem = ({ route, children }) => { + const location = useLocation() + return {children} +} -const LoggedInSectionWithoutRoute = ({ location }) => ( -
      - {userIsLoggedIn() ? ( - [ - location.pathname === '/' ? ( - - - My Projects - - - ) : ( - - - - - - ), - - - , - ] - ) : ( - - - - - )} -
    -) +export const LoggedInSection = () => { + const location = useLocation() + return ( + + ) +} -const Navbar = ({ fullWidth, children }) => ( - -) + return ( + + + + + OpenDC + + + + + + + + + ) +} export default Navbar -- cgit v1.2.3