Skip to content

Commit

Permalink
Don't need to force reload Home anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccaalpert committed Oct 25, 2024
1 parent 65b1b18 commit 3fde782
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/app/SidebarWithFlyout/SidebarWithFlyout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import logoDark from '@app/bgimages/Logo-Red_Hat-Composer_AI_Studio-A-Reverse.sv
import { FlyoutHeader } from '@app/FlyoutHeader.tsx/FlyoutHeader';
import { FlyoutStartScreen } from '@app/FlyoutStartScreen.tsx/FlyoutStartScreen';
import { FlyoutMenu } from './FlyoutMenu';
import { NavLink } from 'react-router-dom';

export const SidebarWithFlyout: React.FunctionComponent = () => {
const [visibleFlyout, setVisibleFlyout] = useState(null);
Expand Down Expand Up @@ -66,7 +67,18 @@ export const SidebarWithFlyout: React.FunctionComponent = () => {

<Nav id="nav-primary-simple" className="pf-c-nav" aria-label="Global">
<NavList>
<NavItem to="/">Home</NavItem>
<NavItem onClick={() => setVisibleFlyout(null)}>
<NavLink
to="/"
className={({ isActive, isPending, isTransitioning }) =>
[isPending ? 'pending' : '', isActive ? 'active' : '', isTransitioning ? 'transitioning' : ''].join(
' ',
)
}
>
Home
</NavLink>
</NavItem>
<NavItem
component="button"
onClick={toggleFlyout}
Expand Down

0 comments on commit 3fde782

Please sign in to comment.