Skip to content

Conversation

0xSpecter
Copy link
Contributor

No description provided.

@0xSpecter 0xSpecter linked an issue Sep 9, 2025 that may be closed by this pull request
@0xSpecter 0xSpecter closed this Sep 11, 2025
@0xSpecter 0xSpecter reopened this Sep 11, 2025
@0xSpecter 0xSpecter self-assigned this Sep 11, 2025
@0xSpecter 0xSpecter requested a review from Copilot September 11, 2025 17:26
Copy link

@Copilot Copilot AI left a 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' : ''}
Copy link

Copilot AI Sep 11, 2025

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.

Suggested change
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;
Copy link
Member

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);
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add myself as a contributer

2 participants