-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nav bar codes #26
Merged
gnimnix
merged 13 commits into
epic/DEV-4-shared-components-and-layouts
from
feature/TAS-12-nav-bar
May 19, 2024
Merged
nav bar codes #26
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7d0f665
nav bar codes
rachelsitoh 0cc8c0e
add react-router-dom to yarn packages list
gnimnix 6a1076e
import navbars to show on index page
gnimnix 4d5a05a
fixed and added navbar onto app.tsx
rachelsitoh 3b2121f
changed to css modules
rachelsitoh 86683ae
handle changing window size for desktop and mobile
rachelsitoh 59f95ee
used clickaway hook to handle profile clickaway
rachelsitoh 814bddc
Merge branch 'epic/DEV-4-shared-components-and-layouts' into feature/…
gnimnix b7b9e7b
added namespace for files
gnimnix 7363050
refactored code
gnimnix 81512ac
updated imports
gnimnix a357435
changed to hover and resized profile logo
rachelsitoh e22e5ea
update yarn packages and fixed syntax
gnimnix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,75 @@ | ||
.overallHeader { | ||
display: flex; | ||
justify-content: space-between; | ||
background-color: #0C1747; | ||
align-items: center; | ||
overflow: hidden; | ||
width: 100%; | ||
position: fixed; | ||
top: 0; | ||
font-family: 'DM Sans', sans-serif; | ||
height: 98px; | ||
} | ||
|
||
|
||
.overallHeader div a { | ||
display: block; | ||
color: white; | ||
text-align: center; | ||
text-decoration: none; | ||
font-size: 20px; | ||
padding: 30px; | ||
font-weight: 400; | ||
} | ||
.overallHeader div a:hover { | ||
color:#F9A72B; | ||
} | ||
|
||
.personLogo { | ||
max-width: 54.95px; | ||
height: auto; | ||
padding-right: 44px; | ||
} | ||
|
||
.fintechLogo{ | ||
max-width: 146px; | ||
height: auto; | ||
} | ||
.profileOptions { | ||
position: fixed; | ||
top: 98px; | ||
right: 12px; | ||
font-size: 16px; | ||
background-color: rgb(255, 255, 255); | ||
box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.1); | ||
z-index: 1000; | ||
width: 158px; | ||
height: 116px; | ||
display: flex; | ||
text-align: center; | ||
flex-direction: column; | ||
font-family: 'DM Sans', sans-serif; | ||
} | ||
|
||
.profileOption, | ||
.signOutOption { | ||
cursor: pointer; | ||
text-align: center; | ||
} | ||
|
||
.profileOption:hover, | ||
.signOutOption:hover { | ||
background-color: rgba(202, 202, 202, 0.2); | ||
} | ||
|
||
|
||
/* @media (max-width: 767px) { | ||
header { | ||
display: none; | ||
} | ||
} */ | ||
|
||
|
||
|
||
|
||
|
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,78 @@ | ||
/* @media (min-width: 768px) { | ||
header { | ||
display: none; | ||
} | ||
} */ | ||
|
||
.overallHeader { | ||
display: flex; | ||
justify-content: space-between; | ||
background-color: #0C1747; | ||
align-items: center; | ||
overflow: hidden; | ||
width: 100%; | ||
position: fixed; | ||
top: 0; | ||
font-family: 'DM Sans', sans-serif; | ||
height: 100px; | ||
} | ||
|
||
|
||
.overallHeader div a { | ||
display: block; | ||
color: white; | ||
text-align: center; | ||
text-decoration: none; | ||
font-size: 20px; | ||
padding: 30px; | ||
} | ||
|
||
|
||
.personLogo { | ||
max-width: 54.95px; | ||
height: auto; | ||
padding-right: 44px; | ||
} | ||
|
||
.fintechLogo{ | ||
max-width: 146px; | ||
height: auto; | ||
padding-left: 20px; | ||
} | ||
|
||
.closeLogo{ | ||
padding-right: 26px; | ||
max-width: 44px; | ||
} | ||
.sidebar { | ||
position: fixed; | ||
top: 100px; | ||
background-color: #0C1747; | ||
display: block; | ||
z-index: 1000; | ||
width: 100%; | ||
height: 100%; | ||
flex-direction: column; | ||
font-family: 'DM Sans', sans-serif; | ||
} | ||
|
||
.sidebar div a { | ||
display: block; | ||
color: white; | ||
text-align: left; | ||
text-decoration: none; | ||
align-items: center; | ||
font-size: 30px; | ||
padding: 10px; | ||
padding-left: 44px; | ||
font-weight: 500; | ||
} | ||
|
||
.sidebar .Link:hover { | ||
color: #F9A72B; | ||
} | ||
|
||
|
||
|
||
|
||
|
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,12 @@ | ||
import React from "react"; | ||
|
||
const Announcements: React.FC = () => { | ||
return ( | ||
<div> | ||
<h1>Announcements</h1> | ||
{/* Add your announcements content here */} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Announcements; |
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,11 @@ | ||
import React from "react"; | ||
|
||
const Events: React.FC = () => { | ||
return ( | ||
<div> | ||
<h1>Events</h1> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Events; |
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,14 @@ | ||
import React from "react"; | ||
import Navbar from "./NavBar.tsx"; | ||
import NavbarMobile from "./NavBarMobile.tsx"; | ||
|
||
const Home: React.FC = () => { | ||
return ( | ||
<div> | ||
<Navbar /> | ||
<h1>Home</h1> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Home; |
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,11 @@ | ||
import React from "react"; | ||
|
||
const Members: React.FC = () => { | ||
return ( | ||
<div> | ||
<h1>members</h1> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Members; |
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,95 @@ | ||
import { useState } from "react"; | ||
import { Link } from "react-router-dom"; | ||
import styles from "css/shared/NavBar.module.css"; | ||
import personLogo from "/person_logo.png"; | ||
import fintechLogo from "/fintech_logo.png"; | ||
import { useWindowSize } from "@uidotdev/usehooks"; | ||
import { useClickAway } from "@uidotdev/usehooks"; | ||
import NavBarMobile from "./NavBarMobile.tsx"; | ||
|
||
function Navbar() { | ||
const [showProfileOptions, setShowProfileOptions] = useState(false); | ||
const size = useWindowSize(); // Get window size | ||
|
||
const profileOptionsRef = useClickAway(() => { | ||
setShowProfileOptions(false); | ||
}); | ||
|
||
const handleProfile = () => { | ||
if (!showProfileOptions) { | ||
setShowProfileOptions(true); | ||
} | ||
}; | ||
|
||
return ( | ||
<> | ||
{size.width && size.width < 767 ? ( // Check window width | ||
<NavBarMobile /> | ||
) : ( | ||
<header> | ||
<div className={styles.overallHeader}> | ||
<div> | ||
<a href="/public"> | ||
<img | ||
src={fintechLogo} | ||
alt="fintech Logo" | ||
className={styles.fintechLogo} | ||
/> | ||
</a> | ||
</div> | ||
<div> | ||
<Link to="/announcements" className={styles.Link}> | ||
Announcements | ||
</Link> | ||
</div> | ||
<div> | ||
<Link to="/members" className={styles.Link}> | ||
Members | ||
</Link> | ||
</div> | ||
<div> | ||
<Link to="/events" className={styles.Link}> | ||
Events | ||
</Link> | ||
</div> | ||
<div> | ||
<Link to="/tasks" className={styles.Link}> | ||
Tasks | ||
</Link> | ||
</div> | ||
<div> | ||
<Link to="/" className={styles.Link}> | ||
Attendance | ||
</Link> | ||
</div> | ||
<div> | ||
<Link to="/recruitment" className={styles.Link}> | ||
Recruitment | ||
</Link> | ||
</div> | ||
<div ref={profileOptionsRef}> | ||
<img | ||
src={personLogo} | ||
alt="Person Logo" | ||
className={styles.personLogo} | ||
onClick={handleProfile} | ||
/> | ||
{showProfileOptions && ( | ||
<div ref={profileOptionsRef} className={styles.profileOptions}> | ||
<div className={styles.profileOption}> | ||
<p>Profile</p> | ||
</div> | ||
<div className={styles.signOutOption}> | ||
<p>Sign Out</p> | ||
</div> | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
</header> | ||
)} | ||
</> | ||
); | ||
} | ||
|
||
export default Navbar; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rachelsitoh , I think the click behaviour feels kinda weird, could u change to dropdown on hover? so remove this clickaway hook and make it display on hover, should only need css, thx!