-
-
Notifications
You must be signed in to change notification settings - Fork 11
765-fix: Fix styles active menu item #814
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
JuliaAnt
wants to merge
21
commits into
main
Choose a base branch
from
fix/765-fix-styles-active-menu-item
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
21 commits
Select commit
Hold shift + click to select a range
6bef3a0
fix: 765 - change style of active menu item. Fix lighthouse problem
JuliaAnt c615691
fix: 765 - fix paddings and event handlers
JuliaAnt b881010
fix: 765 - fix event handling logic and styles in NavItem. Update heaβ¦
JuliaAnt d07e389
feat: 765 - add icon to donate-navItem. Change logo on mentorship page
JuliaAnt 2940fa5
fix: 765 - fix dropdown styles and add static links for rsschool page
JuliaAnt b9217b0
refactor: 765 - change mobile menu
JuliaAnt 5cc6aa8
refactor: 765 - add content to support-dropdown and links to mentorshβ¦
JuliaAnt 95ceacf
refactor: 765 - add breadcrumbs to mobile menu and fix styles
JuliaAnt 62b0a0e
fix: 765 - fix support-text color in footer
JuliaAnt 5783f35
fix: 765 - merge branch 'main'
JuliaAnt 47405ac
fix: 765 - fix links for courses and mentorship
JuliaAnt f8ee5fa
refactor: 765 - add key codes to constants
JuliaAnt ae4356a
fix: 765 - fix dropdown width and hover of menu elements
JuliaAnt 1391e68
fix: 765 - fix styles of navigation menu
JuliaAnt f9bc32a
fix: 765 - fix styles of mobile menu. Add mobile-menu-item. Remove reβ¦
JuliaAnt faa0957
fix: 765 - fix logo. Fix description to mentorship and courses. Fix hβ¦
JuliaAnt c873703
fix: 765 - merge branch 'main'
JuliaAnt cc7e7f0
fix: 765 - fix menu item underline and gap
JuliaAnt e819b19
fix: 765 - fix linter error
JuliaAnt 342aaa7
fix: 765 - fix donate options and keyboard navigation. Add variables β¦
JuliaAnt 252a8e4
fix: 765 - remove white class from header and fix margin
JuliaAnt 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
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,16 +1,23 @@ | ||
import boostyIconMenu from '@/shared/assets/svg/boosty-icon-menu.svg'; | ||
import openCollective from '@/shared/assets/svg/opencollective-icon.svg'; | ||
import { LINKS } from '@/shared/constants'; | ||
import { BoostyIcon, OpenCollectiveIcon } from '@/shared/icons'; | ||
|
||
export const donateOptions = [ | ||
{ | ||
id: 1, | ||
linkLabel: 'Donate now', | ||
icon: 'openCollective', | ||
buttonLinkLabel: 'Donate now', | ||
menuLinkLabel: 'Donate on Opencollective', | ||
buttonIcon: OpenCollectiveIcon, | ||
menuIcon: openCollective, | ||
href: LINKS.DONATE_OPEN_COLLECTIVE, | ||
}, | ||
{ | ||
id: 2, | ||
linkLabel: 'Subscribe now', | ||
icon: 'boosty', | ||
buttonLinkLabel: 'Subscribe now', | ||
menuLinkLabel: 'Subscribe on Boosty', | ||
buttonIcon: BoostyIcon, | ||
menuIcon: boostyIconMenu, | ||
href: LINKS.DONATE_BOOSTY, | ||
}, | ||
]; |
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
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.
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 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { useEffect } from 'react'; | ||
|
||
export function useOutsideClick<T extends HTMLElement>( | ||
ref: React.RefObject<T | null>, | ||
callback: () => void, | ||
isDropdownOpen: boolean, | ||
) { | ||
useEffect(() => { | ||
if (!isDropdownOpen) { | ||
return; | ||
} | ||
|
||
const handleClickOutside = (e: MouseEvent) => { | ||
if (ref.current && !ref.current.contains(e.target as Node)) { | ||
callback(); | ||
} | ||
}; | ||
|
||
document.addEventListener('mousedown', handleClickOutside); | ||
|
||
return () => { | ||
document.removeEventListener('mousedown', handleClickOutside); | ||
}; | ||
}, [ref, callback, isDropdownOpen]); | ||
} |
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
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
Oops, something went wrong.
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.
Can we not use margin and do it with an assistant property gap?