Skip to content

Commit

Permalink
Dont redirect home page
Browse files Browse the repository at this point in the history
  • Loading branch information
wweitzel committed Aug 21, 2024
1 parent dacd4b2 commit 7fd139e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const router = createBrowserRouter([
children: [
{
path: '/',
element: <Navigate to="/goals" />,
element: <Goals />,
errorElement: <Error />,
},
{
Expand Down
6 changes: 3 additions & 3 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ function Header() {
setLogo(logoToDisplay);
}, [theme]);

const homeActive = Boolean(useMatch('/goals'));
const fixturesActive = Boolean(useMatch('/fixtures'));
const settingsActive = Boolean(useMatch('/settings'));
const goalsDrilldownActive = Boolean(useMatch('/goals/:goalId'));
const homeActive = Boolean(useMatch('/goals')) || (!fixturesActive && !settingsActive && !goalsDrilldownActive);

return (
<div className="container d-flex justify-content-center">
Expand All @@ -40,8 +40,8 @@ function Header() {
<li className="nav-item">
<NavLink
to="/goals"
className={({isActive}) => {
return `nav-link ${isActive ? 'active' : ''}`;
className={() => {
return `nav-link ${homeActive ? 'active' : ''}`;
}}
id="home-tab"
type="button"
Expand Down

0 comments on commit 7fd139e

Please sign in to comment.