-
Notifications
You must be signed in to change notification settings - Fork 25
Feature:-Header Redesign #366 #402
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
Draft
vernfongchao
wants to merge
12
commits into
main
Choose a base branch
from
vernfongchao/feature/header/redesign
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d0ea6ac
Add Icons for Header
vernfongchao 3bc5112
commented out font change for now
vernfongchao 4fd9823
add montserrat font
vernfongchao ed2c1d0
remove extra montserrat font but regular
vernfongchao 6457cea
remove useStates on hover effect
vernfongchao 41e5f81
fix BEM styling
vernfongchao c796c36
Merge branch 'main' into vernfongchao/feature/header/redesign
vernfongchao e28fbea
merge with main
vernfongchao b65db70
remove unused imports
vernfongchao d0beadd
remove font license text and add to license page
vernfongchao e8e24c6
remove font license file
vernfongchao 4bdbc82
fix type and naming convention on license page
vernfongchao 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
Binary file not shown.
This file contains hidden or 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 hidden or 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 hidden or 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,5 +1,5 @@ | ||
| export { Loading } from './Loading'; | ||
| export { AuthButton } from './AuthButton'; | ||
| export { AuthButton, ProfileAuthButton } from './AuthButton'; | ||
| export { RedirectWithHash } from './RedirectWithHash'; | ||
| export { RequireAuth } from './RequireAuth'; | ||
| export { Auth0ProviderWithRedirect } from './Auth0ProviderWithRedirect'; |
This file contains hidden or 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,92 +1,64 @@ | ||
| import React from 'react'; | ||
| import { Link } from 'react-router-dom'; | ||
| import { Menu, MenuItem } from '@mui/material'; | ||
| import { TreeLogo } from '@/components/Icons'; | ||
| import HeaderLogo from '@/assets/images/logos/header-logo.svg'; | ||
| import { useAuth0 } from '@auth0/auth0-react'; | ||
| import { AuthButton } from '@/components/Auth'; | ||
| import HeaderLogo from '@/assets/images/logos/header-logo.svg'; | ||
| import Menu from './Menu'; | ||
|
|
||
| import './Header.scss'; | ||
|
|
||
| const Header = () => { | ||
| const [anchorEl, setAnchorEl] = React.useState(null); | ||
|
|
||
| const handleClick = (event) => { | ||
| setAnchorEl(event.currentTarget); | ||
| }; | ||
|
|
||
| const handleClose = () => { | ||
| setAnchorEl(null); | ||
| }; | ||
| const { isAuthenticated } = useAuth0(); | ||
|
|
||
| return ( | ||
| <div id="header" className="header"> | ||
| <div className="header-content"> | ||
| <Link to="/"> | ||
| <img className="header--logo" src={HeaderLogo} alt="Header Logo" /> | ||
| </Link> | ||
|
|
||
| <button | ||
| type="button" | ||
| className="header-btn-menu" | ||
| aria-controls="wtt-menu" | ||
| aria-haspopup="true" | ||
| onClick={handleClick} | ||
| > | ||
| ☰ | ||
| </button> | ||
|
|
||
| <Menu | ||
| id="wtt-menu" | ||
| anchorEl={anchorEl} | ||
| keepMounted | ||
| open={Boolean(anchorEl)} | ||
| onClose={handleClose} | ||
| > | ||
| {isAuthenticated && ( | ||
| <MenuItem onClick={handleClose}> | ||
| <Link to="/userprofile" className="header-link"> | ||
| <HeaderButton menuItem="User Profile" /> | ||
| </Link> | ||
| </MenuItem> | ||
| )} | ||
|
|
||
| <MenuItem onClick={handleClose}> | ||
| <Link to="/" className="header-link"> | ||
| <HeaderButton menuItem="Map" /> | ||
| <div className="header"> | ||
| <div className="header__navigation"> | ||
| <div className="header__navigation__logocontainer"> | ||
| <Link to="/"> | ||
| <TreeLogo /> | ||
| </Link> | ||
| <Link to="/"> | ||
| <img | ||
| className="header__navigation__logocontainer__logo" | ||
| src={HeaderLogo} | ||
| alt="Header Logo" | ||
| ></img> | ||
| </Link> | ||
| </div> | ||
| <div className="header__navigation__navcontainer"> | ||
| <button className="header__navigation__navcontainer__buttons"> | ||
| <Link to="/" title="Map"> | ||
| Map | ||
| </Link> | ||
| </MenuItem> | ||
|
|
||
| <MenuItem onClick={handleClose}> | ||
| <Link to="/about" className="header-link"> | ||
| <HeaderButton menuItem="About" /> | ||
| </button> | ||
| <button className="header__navigation__navcontainer__buttons"> | ||
| <Link to="/about" title="About"> | ||
| About | ||
| </Link> | ||
| </MenuItem> | ||
|
|
||
| <MenuItem onClick={handleClose}> | ||
| <Link to="/contact" className="header-link"> | ||
| <HeaderButton menuItem="Contact" /> | ||
| </button> | ||
| <button className="header__navigation__navcontainer__buttons"> | ||
| <Link to="/contact" title="Contact"> | ||
| Contact | ||
| </Link> | ||
| </MenuItem> | ||
|
|
||
| <MenuItem onClick={handleClose}> | ||
| <Link to="/data" className="header-link"> | ||
| <HeaderButton menuItem="Data" /> | ||
| </button> | ||
| <button className="header__navigation__navcontainer__buttons"> | ||
| <Link to="/data" title="Data"> | ||
| Data | ||
| </Link> | ||
| </MenuItem> | ||
|
|
||
| <MenuItem onClick={handleClose}> | ||
| <AuthButton /> | ||
| </MenuItem> | ||
| </Menu> | ||
| </button> | ||
| </div> | ||
| <div className="header__navigation__authcontainer"> | ||
| {isAuthenticated ? null : ( | ||
| <div className="header__navigation__authcontainer__button"> | ||
| <AuthButton /> | ||
| </div> | ||
| )} | ||
| <Menu /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| const HeaderButton = ({ menuItem }) => ( | ||
| <button type="button" className="btn btn-success btn-block"> | ||
| {menuItem} | ||
| </button> | ||
| ); | ||
|
|
||
| export default Header; | ||
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.
Uh oh!
There was an error while loading. Please reload this page.