Skip to content

Commit

Permalink
change: from div to react link component (#12813)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Fresco <[email protected]>
  • Loading branch information
michaelfresco committed Nov 5, 2024
1 parent a54dddd commit a3b2209
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/nav-bar/nav-bar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {default as classNames} from 'classnames';
import * as PropTypes from 'prop-types';
import * as React from 'react';
import {Link} from 'react-router-dom'; // Import Link component

import { AppContext } from '../../context';
import {Tooltip} from '../tooltip/tooltip';
Expand Down Expand Up @@ -35,10 +36,9 @@ export const NavBar: React.FunctionComponent<NavBarProps> = (props: NavBarProps,
<div className='nav-bar__version'>{props.version && props.version()}</div>
{(props.items || []).map((item) => (
<Tooltip content={item.title} placement='right' arrow={true} key={item.path + item.title}>
<div className={classNames('nav-bar__item', { active: isActiveRoute(locationPath, item.path) })}
onClick={() => context.router.history.push(item.path)} role="checkbox">
<i className={item.iconClassName}/>
</div>
<Link to={item.path} className={classNames('nav-bar__item', { active: isActiveRoute(locationPath, item.path) })}>
<i className={item.iconClassName} />
</Link>
</Tooltip>
))}
</div>
Expand Down

0 comments on commit a3b2209

Please sign in to comment.