Skip to content

Commit

Permalink
Lien vers le site des rencontres
Browse files Browse the repository at this point in the history
  • Loading branch information
mariheck committed May 28, 2024
1 parent 9e2a7b0 commit 729072c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/site/app/MenuPrincipal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@ import {MenuProps} from './AppHeader';
type MenuItemProps = {
children: ReactNode;
href: string;
external?: boolean;
} & MenuProps;

function MenuItem(props: MenuItemProps) {
const {href, children, setMenuOpened} = props;
const {href, children, external, setMenuOpened} = props;
const pathName = usePathname();
const pathNameBase = pathName?.split('/').splice(0, 2).join('/');

return (
<li className="fr-nav__item">
<Link
href={href}
target="_self"
target={external ? '_blank' : '_self'}
rel={external ? 'noreferrer noopener' : ''}
aria-controls="modal-header__menu"
className="fr-nav__link"
aria-current={href === pathNameBase ? 'page' : undefined}
Expand Down Expand Up @@ -59,6 +61,13 @@ export function MenuPrincipal(props: MenuProps) {
<MenuItem href="/contact" {...props}>
Contact
</MenuItem>
<MenuItem
href="https://rencontres.territoiresentransitions.fr/"
external
{...props}
>
Rencontres
</MenuItem>
</ul>
);
}

0 comments on commit 729072c

Please sign in to comment.