Skip to content

Commit

Permalink
⚡️ Improve code in manage layout page (ajnart#1681)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Camlong <[email protected]>
  • Loading branch information
SeDemal and ajnart authored Dec 7, 2023
1 parent 2170201 commit 976634a
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/components/layout/Templates/ManageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,20 +201,14 @@ export const ManageLayout = ({ children }: ManageLayoutProps) => {

const matchesActive = router.pathname.endsWith(item.href);

if (item.href.startsWith('http')) {
return (
<NavLink
{...commonItemProps}
active={matchesActive}
target={item.target}
key={index}
component="a"
/>
);
}

return (
<NavLink {...commonItemProps} active={matchesActive} component={Link} key={index} />
<NavLink
{...commonItemProps}
target={item.target}
active={matchesActive}
component={Link}
key={index}
/>
);
})}
</NavLink>
Expand Down

0 comments on commit 976634a

Please sign in to comment.