Skip to content

Commit

Permalink
Added selected project in Breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
vivek-harness committed Dec 20, 2024
1 parent 1104380 commit 40317ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/gitness/src/AppMFE.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default function AppMFE({
onRouteChange={onRouteChange}
locationPathname={locationPathname}
/>
<BreadcrumbsNew />
<BreadcrumbsNew selectedProject={scope.projectIdentifier || '...'} />
<Outlet />
</>
),
Expand Down
5 changes: 3 additions & 2 deletions apps/gitness/src/components/breadcrumbs/breadcrumbs-new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Topbar
} from '@harnessio/ui/components'

function BreadcrumbsNew() {
function BreadcrumbsNew({ selectedProject }: { selectedProject: string }) {
const matches = useMatches()

return (
Expand All @@ -19,7 +19,8 @@ function BreadcrumbsNew() {
<Breadcrumb className="select-none">
<BreadcrumbList>
<nav className="flex items-start gap-1">
<span className="ml-1">Selected Project</span>
<span className="ml-1">{selectedProject}</span>

{matches.map((match, index) => {
/** @ts-expect-error should be of type "CustomHandle". @TODO fix this properly */
const { breadcrumb } = match.handle || {}
Expand Down

0 comments on commit 40317ff

Please sign in to comment.