File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,11 +14,10 @@ export const Breadcrumbs = (props: Props) => {
1414 const router = useRouter ( )
1515 const pathWithLocale = `/${ router . locale } ${ router . asPath } `
1616 const { breadcrumbs } = useMainContext ( )
17- const items = Object . entries ( breadcrumbs || { } )
1817
1918 return (
2019 < nav className = "breadcrumbs f5" aria-label = "Breadcrumb" >
21- { items . map ( ( [ _ , breadcrumb ] ) => {
20+ { Object . values ( breadcrumbs ) . map ( ( breadcrumb ) => {
2221 const title = `${ breadcrumb . documentType } : ${ breadcrumb . title } `
2322 return ! breadcrumb . href ? (
2423 < span key = { title } title = { title } >
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ type EnterpriseServerReleases = {
2626 nextDeprecationDate : string
2727}
2828export type MainContextT = {
29- breadcrumbs ? : Record < string , BreadcrumbT >
29+ breadcrumbs : Record < string , BreadcrumbT >
3030 builtAssets : { main : { css : string ; js : string } }
3131 expose : string
3232 activeProducts : Array < ProductT >
@@ -43,7 +43,7 @@ export const getMainContextFromRequest = (req: any): MainContextT => {
4343 return {
4444 builtAssets : req . context . builtAssets ,
4545 expose : req . context . expose ,
46- breadcrumbs : req . context . breadcrumbs ,
46+ breadcrumbs : req . context . breadcrumbs || { } ,
4747 activeProducts : req . context . activeProducts ,
4848 currentProduct : req . context . productMap [ req . context . currentProduct ] ,
4949 currentLayoutName : req . context . currentLayoutName ,
You can’t perform that action at this time.
0 commit comments