-
Notifications
You must be signed in to change notification settings - Fork 1
added new tab option too navbaritem #1960
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -10,6 +10,7 @@ type NavbarItemProps = { | |||||||
route: string; | ||||||||
label: string; | ||||||||
icon?: string; | ||||||||
new_tab?: boolean; | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We prefer using camelCase for js variables |
||||||||
labelClassName?: string; | ||||||||
dropdownLinks?: Children; | ||||||||
expandedDropdown?: string; | ||||||||
|
@@ -26,6 +27,7 @@ export function NavbarItem({ | |||||||
setExpandedDropdown, | ||||||||
dropdownLinks, | ||||||||
labelClassName, | ||||||||
new_tab, | ||||||||
}: NavbarItemProps) { | ||||||||
const { setIsMobileNavigation } = useGlobalContext(); | ||||||||
const isDesktop = useDesktop(); | ||||||||
|
@@ -64,7 +66,12 @@ export function NavbarItem({ | |||||||
} | ||||||||
return ( | ||||||||
<div className={itemClasses} ref={clickOutsideRef}> | ||||||||
<Link to={route} className={isDesktop ? styles.navbar_link : styles.popup_link_mobile} onClick={handleClick}> | ||||||||
<Link | ||||||||
target={new_tab ? '_blank' : ''} | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When using
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||
to={route} | ||||||||
className={isDesktop ? styles.navbar_link : styles.popup_link_mobile} | ||||||||
onClick={handleClick} | ||||||||
> | ||||||||
{icon && <Icon icon={icon} className={styles.navbar_item_icon} />} | ||||||||
<span className={labelClassName}>{label}</span> | ||||||||
{dropdownLinks && ( | ||||||||
|
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 this change be left out of this PR?