-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature ticket 34 prototype navigation bar (#157)
Navbar design done. --------- Co-authored-by: ravikth <[email protected]>
- Loading branch information
1 parent
9b87543
commit 9864202
Showing
5 changed files
with
103 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,47 @@ | ||
import React from 'react' | ||
import { Link, Outlet } from 'react-router-dom'; | ||
import React, { useMemo } from 'react' | ||
import { Link, Outlet, useLocation } from 'react-router-dom'; | ||
import '../Styles/custom/navBar.css' | ||
import sproutlyLogo from '../Images/sproutly-logo.svg'; | ||
import sproutlyText from '../Images/sproutly-text.svg'; | ||
|
||
function NavBar() { | ||
return ( | ||
<div> | ||
<div> | ||
<Link to="/">Home</Link> | ||
<Link to="/about">About</Link> | ||
<Link to="/faq">FAQ</Link> | ||
</div> | ||
<Outlet /> | ||
</div> | ||
) | ||
|
||
const location = useLocation(); | ||
|
||
const pageArray = useMemo(() => { | ||
return [ | ||
{ | ||
name: 'Home', | ||
path: '/', | ||
}, | ||
{ | ||
name: 'About', | ||
path: '/about', | ||
}, | ||
{ | ||
name: 'FAQ', | ||
path: '/faq', | ||
} | ||
] | ||
}, []) | ||
|
||
return ( | ||
<> | ||
<div className='navbar'> | ||
<div> | ||
<img className='sproutly-logo' src={sproutlyLogo} alt='error img'/> | ||
<img className='sproutly-text' src={sproutlyText} alt='error img'/> | ||
</div> | ||
<div className='navbar-link-container'> | ||
{pageArray.map((page, index)=>{ | ||
return <Link key={index} className={`navbar-link${location.pathname===page.path? ' text-white': ''}`} to={page.path}>{page.name}</Link> | ||
})} | ||
</div> | ||
<button className='navbar-login-logout-button'>Log In</button> | ||
</div> | ||
<Outlet /> | ||
</> | ||
) | ||
}; | ||
|
||
export default NavBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* NavBar CSS */ | ||
|
||
.navbar { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
height: 72px; | ||
align-items: center; | ||
padding-left: 50px; | ||
padding-right: 50px; | ||
background-color: #AFD582; | ||
} | ||
|
||
.navbar > *{ | ||
font-family: "Poppins", serif; | ||
font-weight: 1000; | ||
text-decoration: none; | ||
color: #4C5740; | ||
} | ||
|
||
.navbar-link-container{ | ||
width: 30%; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
} | ||
|
||
.navbar-link{ | ||
text-decoration: none; | ||
color: #4C5740; | ||
} | ||
|
||
.navbar-login-logout-button{ | ||
height: 41.5px; | ||
background-color: #E6F2D7; | ||
display: flex; | ||
line-height: 41.5px; | ||
padding-left: 26px; | ||
padding-right: 26px; | ||
border-radius: 15px; | ||
border-color: #E6F2D7; | ||
} | ||
|
||
.sproutly-text{ | ||
padding-left: 11px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
/* Global CSS */ | ||
|
||
html, body, #root, .App { | ||
height: 100%; | ||
width: 100%; | ||
margin: 0px; | ||
} | ||
|
||
.text-white{ | ||
color: #FFFFFF; | ||
} |