diff options
| author | jc0b <j@jc0b.computer> | 2020-07-07 16:55:22 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:47:51 +0200 |
| commit | 223e916997eb641a1662110b6de630a4cdfdf479 (patch) | |
| tree | 90ca4364461f676db45f25e03d8f22fc32f9fdd8 /frontend/src/components/navigation | |
| parent | 9ff1e3c6bae253372a468dbdc9b8369ab8dd2c6f (diff) | |
| parent | b810c4413079bf5aeb5374f1cd20e151a83530d0 (diff) | |
Merge branch 'feature/mongodb-migration' of github.com:atlarge-research/opendc-dev into feature/mongodb-migration
Diffstat (limited to 'frontend/src/components/navigation')
| -rw-r--r-- | frontend/src/components/navigation/AppNavbar.js | 54 | ||||
| -rw-r--r-- | frontend/src/components/navigation/AppNavbarComponent.js | 27 | ||||
| -rw-r--r-- | frontend/src/components/navigation/HomeNavbar.js | 2 | ||||
| -rw-r--r-- | frontend/src/components/navigation/Navbar.js | 6 |
4 files changed, 31 insertions, 58 deletions
diff --git a/frontend/src/components/navigation/AppNavbar.js b/frontend/src/components/navigation/AppNavbar.js deleted file mode 100644 index 15f08b5f..00000000 --- a/frontend/src/components/navigation/AppNavbar.js +++ /dev/null @@ -1,54 +0,0 @@ -import React from 'react' -import FontAwesome from 'react-fontawesome' -import { Link } from 'react-router-dom' -import Navbar, { NavItem } from './Navbar' -import './Navbar.css' - -const AppNavbar = ({ simulationId, inSimulation, fullWidth, onViewTopologies }) => ( - <Navbar fullWidth={fullWidth}> - <NavItem route="/simulations"> - <Link className="nav-link" title="My Simulations" to="/simulations"> - <FontAwesome name="list" className="mr-2"/> - My Simulations - </Link> - </NavItem> - {inSimulation ? ( - <> - <NavItem route={'/simulations/' + simulationId}> - <Link - className="nav-link" - title="Construction" - to={'/simulations/' + simulationId} - > - <FontAwesome name="industry" className="mr-2"/> - Construction - </Link> - </NavItem> - <NavItem route="topologies"> - <span - className="nav-link" - title="Topologies" - onClick={onViewTopologies} - > - <FontAwesome name="server" className="mr-2"/> - Topologies - </span> - </NavItem> - <NavItem route={'/simulations/' + simulationId + '/experiments'}> - <Link - className="nav-link" - title="Experiments" - to={'/simulations/' + simulationId + '/experiments'} - > - <FontAwesome name="play" className="mr-2"/> - Experiments - </Link> - </NavItem> - </> - ) : ( - undefined - )} - </Navbar> -) - -export default AppNavbar diff --git a/frontend/src/components/navigation/AppNavbarComponent.js b/frontend/src/components/navigation/AppNavbarComponent.js new file mode 100644 index 00000000..10a2b92c --- /dev/null +++ b/frontend/src/components/navigation/AppNavbarComponent.js @@ -0,0 +1,27 @@ +import React from 'react' +import FontAwesome from 'react-fontawesome' +import { Link } from 'react-router-dom' +import Navbar, { NavItem } from './Navbar' +import './Navbar.css' + +const AppNavbarComponent = ({ project, fullWidth }) => ( + <Navbar fullWidth={fullWidth}> + <NavItem route="/projects"> + <Link className="nav-link" title="My Projects" to="/projects"> + <FontAwesome name="list" className="mr-2"/> + My Projects + </Link> + </NavItem> + {project ? ( + <NavItem> + <Link className="nav-link" title="Current Project" to={`/projects/${project._id}`}> + <span>{project.name}</span> + </Link> + </NavItem> + ) : ( + undefined + )} + </Navbar> +) + +export default AppNavbarComponent diff --git a/frontend/src/components/navigation/HomeNavbar.js b/frontend/src/components/navigation/HomeNavbar.js index 5bb6721d..4e3f3869 100644 --- a/frontend/src/components/navigation/HomeNavbar.js +++ b/frontend/src/components/navigation/HomeNavbar.js @@ -14,7 +14,7 @@ const HomeNavbar = () => ( <Navbar fullWidth={false}> <ScrollNavItem id="#stakeholders" name="Stakeholders"/> <ScrollNavItem id="#modeling" name="Modeling"/> - <ScrollNavItem id="#simulation" name="Simulation"/> + <ScrollNavItem id="#project" name="Project"/> <ScrollNavItem id="#technologies" name="Technologies"/> <ScrollNavItem id="#team" name="Team"/> <ScrollNavItem id="#contact" name="Contact"/> diff --git a/frontend/src/components/navigation/Navbar.js b/frontend/src/components/navigation/Navbar.js index b47f1f94..0ef19ecb 100644 --- a/frontend/src/components/navigation/Navbar.js +++ b/frontend/src/components/navigation/Navbar.js @@ -40,9 +40,9 @@ const LoggedInSectionWithoutRoute = ({ location }) => ( {userIsLoggedIn() ? ( [ location.pathname === '/' ? ( - <NavItem route="/simulations" key="simulations"> - <Link className="nav-link" title="My Simulations" to="/simulations"> - My Simulations + <NavItem route="/projects" key="projects"> + <Link className="nav-link" title="My Projects" to="/projects"> + My Projects </Link> </NavItem> ) : ( |
