-
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?
Conversation
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.
Pull Request Overview
This PR adds support for opening navbar links in a new tab by introducing a new_tab
prop to the NavbarItem component. The change enables navbar items to open in new browser tabs when the option is enabled.
- Added optional
new_tab
boolean prop to NavbarItemProps type - Implemented conditional target attribute on Link component based on
new_tab
prop value - Applied the new tab functionality to the restaurant (sulten) navbar item
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
NavbarItem.tsx | Added new_tab prop to type definition and component, implemented conditional target attribute |
Navbar.tsx | Applied new_tab=true to the restaurant navbar item |
Navbar.module.scss | Increased box-shadow opacity for navbar styling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
<div className={itemClasses} ref={clickOutsideRef}> | ||
<Link to={route} className={isDesktop ? styles.navbar_link : styles.popup_link_mobile} onClick={handleClick}> | ||
<Link | ||
target={new_tab ? '_blank' : ''} |
Copilot
AI
Sep 11, 2025
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.
When using target=\"_blank\"
, you should also add rel=\"noopener noreferrer\"
to prevent security vulnerabilities. The new page can access the original page's window object and potentially redirect it to a malicious site.
target={new_tab ? '_blank' : ''} | |
target={new_tab ? '_blank' : ''} | |
rel={new_tab ? 'noopener noreferrer' : undefined} |
Copilot uses AI. Check for mistakes.
route: string; | ||
label: string; | ||
icon?: string; | ||
new_tab?: boolean; |
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.
We prefer using camelCase for js variables
z-index: 12; | ||
white-space: nowrap; | ||
box-shadow: 0 0 25px 5px rgba(0, 0, 0, 0.06); | ||
box-shadow: 0 0 25px 5px rgba(0, 0, 0, 0.1); |
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?
No description provided.