summaryrefslogtreecommitdiff
path: root/frontend/src/components/navigation
diff options
context:
space:
mode:
authorjc0b <j@jc0b.computer>2020-07-22 16:28:47 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-24 19:48:21 +0200
commitd7469b9ebb01cf36a78cc98aab31fa8f307c4f65 (patch)
treed0535fa0cfe95001302fbd2b0d046d51caab6ffd /frontend/src/components/navigation
parent67b6ec800df8e023efadb60ae5f7919030b19789 (diff)
parent9e7cb3bd367607b32e102c3a87b68b33c53dec46 (diff)
Merge branch 'master' onto working copy
Diffstat (limited to 'frontend/src/components/navigation')
-rw-r--r--frontend/src/components/navigation/AppNavbarComponent.js6
-rw-r--r--frontend/src/components/navigation/HomeNavbar.js12
-rw-r--r--frontend/src/components/navigation/LogoutButton.js2
-rw-r--r--frontend/src/components/navigation/Navbar.js43
4 files changed, 22 insertions, 41 deletions
diff --git a/frontend/src/components/navigation/AppNavbarComponent.js b/frontend/src/components/navigation/AppNavbarComponent.js
index 10a2b92c..293049e1 100644
--- a/frontend/src/components/navigation/AppNavbarComponent.js
+++ b/frontend/src/components/navigation/AppNavbarComponent.js
@@ -8,7 +8,7 @@ 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"/>
+ <FontAwesome name="list" className="mr-2" />
My Projects
</Link>
</NavItem>
@@ -18,9 +18,7 @@ const AppNavbarComponent = ({ project, fullWidth }) => (
<span>{project.name}</span>
</Link>
</NavItem>
- ) : (
- undefined
- )}
+ ) : undefined}
</Navbar>
)
diff --git a/frontend/src/components/navigation/HomeNavbar.js b/frontend/src/components/navigation/HomeNavbar.js
index 4e3f3869..798d1b97 100644
--- a/frontend/src/components/navigation/HomeNavbar.js
+++ b/frontend/src/components/navigation/HomeNavbar.js
@@ -12,12 +12,12 @@ const ScrollNavItem = ({ id, name }) => (
const HomeNavbar = () => (
<Navbar fullWidth={false}>
- <ScrollNavItem id="#stakeholders" name="Stakeholders"/>
- <ScrollNavItem id="#modeling" name="Modeling"/>
- <ScrollNavItem id="#project" name="Project"/>
- <ScrollNavItem id="#technologies" name="Technologies"/>
- <ScrollNavItem id="#team" name="Team"/>
- <ScrollNavItem id="#contact" name="Contact"/>
+ <ScrollNavItem id="#stakeholders" name="Stakeholders" />
+ <ScrollNavItem id="#modeling" name="Modeling" />
+ <ScrollNavItem id="#project" name="Project" />
+ <ScrollNavItem id="#technologies" name="Technologies" />
+ <ScrollNavItem id="#team" name="Team" />
+ <ScrollNavItem id="#contact" name="Contact" />
</Navbar>
)
diff --git a/frontend/src/components/navigation/LogoutButton.js b/frontend/src/components/navigation/LogoutButton.js
index 905e1ae9..e3de2ec7 100644
--- a/frontend/src/components/navigation/LogoutButton.js
+++ b/frontend/src/components/navigation/LogoutButton.js
@@ -5,7 +5,7 @@ import { Link } from 'react-router-dom'
const LogoutButton = ({ onLogout }) => (
<Link className="logout nav-link" title="Sign out" to="#" onClick={onLogout}>
- <FontAwesome name="power-off" size="lg"/>
+ <FontAwesome name="power-off" size="lg" />
</Link>
)
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>