Skip to content

Commit 15e26b3

Browse files
committed
Make current page breadcrumb URL validate
1 parent f1efa57 commit 15e26b3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/breadcrumbs/use-breadcrumbs.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { useEffect } from 'react';
2+
import { useHistory } from 'react-router-dom';
23
import { setBreadcrumbs, onBreadcrumbClick } from '@navikt/nav-dekoratoren-moduler';
34
import { title } from '../routes/inngang/inngang-hovedkategorier';
4-
import { useHistory } from 'react-router-dom';
5+
import { currentPath } from '../routes/current-path';
56

67
export interface Breadcrumb {
78
url: string;
@@ -29,7 +30,7 @@ export const useBreadcrumbs = (breadcrumbs: Breadcrumb[] | null, currentTitle: s
2930
}
3031
const currentPageBreadcrumb: Breadcrumb = {
3132
title: currentTitle,
32-
url: 'current',
33+
url: currentPath(window.location),
3334
handleInApp: true
3435
};
3536
setBreadcrumbs([hovedkategorierBreadcrumb, ...breadcrumbs, currentPageBreadcrumb]);

0 commit comments

Comments
 (0)