Skip to content

Commit

Permalink
fix: Do not embed an a element in a element
Browse files Browse the repository at this point in the history
Let's forward the "href" and "_target" props to NavLink to avoid the
need of an a element before the NavLink.
  • Loading branch information
zatteo committed Nov 5, 2024
1 parent 9f63b4f commit 8657887
Showing 1 changed file with 17 additions and 27 deletions.
44 changes: 17 additions & 27 deletions src/components/AppLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,9 @@ const ExampleRouterNavLink = ({
className,
active,
activeClassName,
onClick
...rest
}) => (
<a
onClick={onClick}
className={cx(className, active ? activeClassName : null)}
>
<a className={cx(className, active ? activeClassName : null)} {...rest}>
{children}
</a>
)
Expand Down Expand Up @@ -112,28 +109,21 @@ const AppLayout = () => {
</NavLink>
</NavItem>
{currentAccountFolderLink && (
<a
href={currentAccountFolderLink}
target="_blank"
rel="noreferrer"
style={{ textDecoration: 'none' }}
>
<NavItem>
<NavLink>
<NavIcon icon={FolderIcon} />
<NavText>{t('Sidebar.documents')}</NavText>
{!isMobile && (
<Icon
icon={OpenappIcon}
style={{
marginLeft: 'auto',
marginRight: 8
}}
/>
)}
</NavLink>
</NavItem>
</a>
<NavItem>
<NavLink href={currentAccountFolderLink} target="_blank">
<NavIcon icon={FolderIcon} />
<NavText>{t('Sidebar.documents')}</NavText>
{!isMobile && (
<Icon
icon={OpenappIcon}
style={{
marginLeft: 'auto',
marginRight: 8
}}
/>
)}
</NavLink>
</NavItem>
)}
</Nav>
</Sidebar>
Expand Down

0 comments on commit 8657887

Please sign in to comment.