Skip to content

Commit

Permalink
fix: add workspace paths to the <ConsoleLink /> component (#1767)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-jonas authored Jun 20, 2024
1 parent 843df81 commit 8867eae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/ConsoleLink/console-link.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { PropsWithChildren } from "react"
import { routes } from "./console-routes"
import { projectPaths } from "./console-nav-data"
import { projectPaths, workspacesPaths } from "./console-nav-data"

type ConsoleLinkProps = {
route: string
}

const flatProjectPaths = projectPaths.flatMap((p) => {
const flatConsolePaths = [...projectPaths, ...workspacesPaths].flatMap((p) => {
return p.paths.map((sectionPath) => ({
href: sectionPath.href,
title: sectionPath.title,
Expand Down Expand Up @@ -52,7 +52,7 @@ export default function ConsoleLink({ route }: ConsoleLinkProps) {
JSON.stringify(routeObj),
)
}
const navDataObj = flatProjectPaths.find((p) => p.href === resolvedRoute)
const navDataObj = flatConsolePaths.find((p) => p.href === resolvedRoute)
if (!navDataObj) {
throw new Error(
"Route object does not have a corresponding nav entry: " + route,
Expand Down

0 comments on commit 8867eae

Please sign in to comment.