Skip to content

Commit

Permalink
fix: add link router dom
Browse files Browse the repository at this point in the history
  • Loading branch information
ialexanderbrito committed Apr 12, 2022
1 parent d7c2d66 commit 7e636d0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/DropdownItem/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useEffect } from 'react';
import { Link } from 'react-router-dom';

import { DropdownItemProps } from 'types/IComponents';

Expand All @@ -16,14 +17,14 @@ export function DropdownItem(props: DropdownItemProps) {
}, []);

return (
<a
href={props.link}
<Link
to={props.link || ''}
className={styles.menuItem}
onClick={() => (props.logout ? handleLogout() : props.goToMenu && setActiveMenu(props.goToMenu))}
>
<span className={styles.iconButton}>{props.leftIcon}</span>
{props.children}
<span className={styles.iconRight}>{props.rightIcon}</span>
</a>
</Link>
);
}

0 comments on commit 7e636d0

Please sign in to comment.