Skip to content

Commit

Permalink
Completing TCES-9 Finished Navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Grant Hamblin authored and Grant Hamblin committed Oct 30, 2023
1 parent 11dc5f9 commit 8cf2f20
Show file tree
Hide file tree
Showing 19 changed files with 304 additions and 27 deletions.
2 changes: 1 addition & 1 deletion client/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"rules": {
"react/react-in-jsx-scope": "off",
"react/jsx-uses-react": "off",
"prettier/prettier": "error"
"prettier/prettier": 0
}
}
4 changes: 3 additions & 1 deletion client/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ node_modules
README.md
.eslintrc.json
package-lock.json
package.json
package.json
Navbar.jsx
App.jsx
69 changes: 69 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"styled-components": "^6.1.0",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
26 changes: 2 additions & 24 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
import logo from "./logo.svg";
import "./App.css";
import Navbar from "./Navbar/Navbar";

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit
<code>src/App.js</code>
and save to reload.
{}
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
return <Navbar />
}

export default App;
64 changes: 64 additions & 0 deletions client/src/Navbar/Dropdown.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

.dropdown-container {
margin-top: 10px;
border-radius: 8px;
background: var(--light-background-paper, #FFF);
box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.12), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.20);
width: 600px;
position: fixed;
top: 56px;
left: 812px;
}

.dropdown-title {
color: var(--light-text-primary, rgba(0, 0, 0, 0.87));
font-feature-settings: 'clig' off, 'liga' off;
font-size: 24px;
font-style: normal;
font-weight: 400;
line-height: 133.4%; /* 32.016px */
height: 32px;
padding: 16px;
display: flex;
align-items: center;
align-self: stretch;
border-bottom: 1px solid #0000008A;
}

.dropdown-item-container {
display: flex;
padding: 8px 16px;
align-items: center;
align-self: stretch;
justify-content: space-between;
height: 48px;
background: none;
border: none;
}

.dropdown-item-container:not(:last-child) {
border-bottom: 1px solid #0000008A;
}

.dropdown-items {
display: flex;
padding: 16px;
flex-direction: column;
align-items: flex-start;
align-self: stretch;
}

.dropdown-item-text {
color: var(--light-text-primary, rgba(0, 0, 0, 0.87));
font-feature-settings: 'clig' off, 'liga' off;
font-size: 16px;
font-style: normal;
font-weight: 400;
line-height: 150%;
letter-spacing: 0.15px;
}

.dropdown-item-left-content {
display: flex;
gap: 22px;
}
21 changes: 21 additions & 0 deletions client/src/Navbar/Dropdown.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import './Dropdown.css'
import DropdownItem from './DropdownItem'

import SettingsLogo from '../images/SettingsFilled.svg'
import LogoutLogo from '../images/LogoutFilled.svg'
import PeopleLogo from '../images/PeopleFilled.svg'

function Dropdown({ isAdmin }) {
return (
<div className='dropdown-container'>
<div className='dropdown-title'>Profile</div>
<div className='dropdown-items'>
{isAdmin && <DropdownItem label='Admin Dashboard' imageUrl={PeopleLogo} />}
<DropdownItem label='Settings' imageUrl={SettingsLogo} />
<DropdownItem label='Log Out' imageUrl={LogoutLogo} />
</div>
</div>
)
}

export default Dropdown
17 changes: 17 additions & 0 deletions client/src/Navbar/DropdownItem.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import './Navbar.css'
import ArrowLogo from '../images/ArrowForwardFilled.svg'

function DropdownItem({ label, imageUrl }) {
return (
<div className='dropdown-item-container'>
<div className='dropdown-item-left-content'>
<img src={imageUrl} alt='logo' width='24' height='24' />
<div className='dropdown-item-text'>{label}</div>
</div>
<img src={ArrowLogo} alt='logo' width='24' height='24' />
</div>
)
}


export default DropdownItem
47 changes: 47 additions & 0 deletions client/src/Navbar/Navbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

.nav-container {
display: flex;
justify-content: space-between;
flex: 1;
padding: 8px 16px;
border-bottom: 1px solid #0000008A;
background: var(--light-primary-contrast, #FFF);
box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.12), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.20);
}

.left-content {
display: flex;
align-items: center;
justify-content: space-between;
}

.right-content {
display: flex;
align-items: center;
}

.right-content-image {
padding: 12px;
background: none;
border: none;
}
.left-content-buttons {
display: flex;
justify-content: space-between;
width: 342px;
margin-left: 50px;
}

.nav-left-button {
color: rgba(0, 0, 0, 0.6);
background: none;
border: none;
font-size: 15px;
font-weight: 500;
line-height: 26px;
letter-spacing: 0.46000000834465027px;
text-align: left;
}



36 changes: 36 additions & 0 deletions client/src/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { useState } from 'react'
import logo from '../images/tces-logo.png'
import Profile from '../images/ProfileFilled.svg'
import Dropdown from './Dropdown'
import NavbarProfile from './NavbarProfile'
import NavbarButton from './NavbarButton'

function Navbar() {

const [isDropdownVisible, setIsDropdownVisible] = useState(false);

const toggleDropdown = () => {
setIsDropdownVisible(!isDropdownVisible);
};

return (
<div className='nav-container'>
<div className='left-content'>
<div className='image'>
<img src={logo} alt='logo' width='46' height='50' />
</div>
<div className='left-content-buttons'>
<NavbarButton title='CLIENTS' />
<NavbarButton title='JOB LEADS' />
<NavbarButton title='EMPLOYERS' />
</div>
</div>
<div className='right-content'>
<NavbarProfile imageUrl={Profile} toggleDropdown={toggleDropdown} />
</div>
{isDropdownVisible && <Dropdown isAdmin={true} />}
</div>
)
}

export default Navbar
9 changes: 9 additions & 0 deletions client/src/Navbar/NavbarButton.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import './Navbar.css'

function NavbarButton({ title }) {
return (
<button className='nav-left-button'>{title}</button>
)
}

export default NavbarButton
11 changes: 11 additions & 0 deletions client/src/Navbar/NavbarProfile.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import './Navbar.css'

function NavbarProfile({ imageUrl, toggleDropdown}) {
return (
<button className="right-content-image" onClick={toggleDropdown}>
<img src={imageUrl} alt='NavButton'/>
</button>
)
}

export default NavbarProfile
Loading

0 comments on commit 8cf2f20

Please sign in to comment.