Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/Components/Navbar/Navbar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ $navbar-link-transparent-hover-gradient-bottom: transparent;
justify-content: center;
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?

}

.navbar_inner {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/Components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export function Navbar() {
setExpandedDropdown={setExpandedDropdown}
expandedDropdown={expandedDropdown}
route={ROUTES.frontend.sulten}
new_tab={true}
label={t(KEY.common_restaurant)}
/>
<NavbarItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type NavbarItemProps = {
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

labelClassName?: string;
dropdownLinks?: Children;
expandedDropdown?: string;
Expand All @@ -26,6 +27,7 @@ export function NavbarItem({
setExpandedDropdown,
dropdownLinks,
labelClassName,
new_tab,
}: NavbarItemProps) {
const { setIsMobileNavigation } = useGlobalContext();
const isDesktop = useDesktop();
Expand Down Expand Up @@ -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' : ''}
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.

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 && (
Expand Down
Loading