Skip to content

Commit

Permalink
attempting to make the sidenav links better
Browse files Browse the repository at this point in the history
  • Loading branch information
monoxane committed Apr 12, 2023
1 parent 0fb637f commit 337bfb7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions frontend/src/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ const App = function App() {
}
<Content className="connect-content">
<Routes>
<Route path="/login" element={<Login />} />
<Route path="/unauthorized" element={<Unauthorized />} />
<Route path="/" element={<PersistLogin />}>
<Route exact path="/login" element={<Login />} />
<Route exact path="/unauthorized" element={<Unauthorized />} />
<Route exact path="/" element={<PersistLogin />}>
<Route element={<RequireAuth allowedRoles={["ADMIN", "ZONE_ADMIN", "OPERATOR"]} />}>
<Route path="/" element={<Dashboard />} />
<Route exact path="/" element={<Dashboard />} />
</Route>
<Route element={<RequireAuth allowedRoles={["ADMIN", "ZONE_ADMIN"]} />}>
<Route path="/dns/zones" element={<Zones />} />
<Route exact path="/dns/zones" element={<Zones />} />
</Route>
<Route element={<RequireAuth allowedRoles={["ADMIN", "ZONE_ADMIN"]} />}>
<Route path="/dns/zones/:zoneId" element={<Zones />} />
<Route exact path="/dns/zones/:zoneId/records" element={<Zones />} />
</Route>
<Route element={<RequireAuth allowedRoles={["NOONEHASTHIS"]} />}>
<Route path="/test" element={<Dashboard />} />
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/SideNavLink.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import { SideNavLink } from '@carbon/react'

function CustomSideNavLink ({ label, to, renderIcon }) {
const match = useMatch(to, { exact: false});
const match = useMatch({path: to, end: true});
const navigate = useNavigate();

if (match) {
Expand Down

0 comments on commit 337bfb7

Please sign in to comment.