fix(breadcrumbs): restore static and viewall label crumb resolution
This commit is contained in:
@@ -94,7 +94,10 @@ const Breadcrumbs = (props) => {
|
||||
mySubmittedReps: "Submitted representations"
|
||||
};
|
||||
|
||||
return labelsByKey[viewKey] || null;
|
||||
const viewAllLabelResolver = labelsByKey[viewKey];
|
||||
return typeof viewAllLabelResolver === "function"
|
||||
? viewAllLabelResolver()
|
||||
: viewAllLabelResolver || null;
|
||||
};
|
||||
|
||||
const getStaticTextCrumbLabel = (path) => {
|
||||
@@ -116,7 +119,8 @@ const Breadcrumbs = (props) => {
|
||||
"/auth/error": () => t("auth:auth-error-signin-error-title")
|
||||
};
|
||||
|
||||
return staticTextCrumbByPath[path] || null;
|
||||
const staticTextCrumbResolver = staticTextCrumbByPath[path];
|
||||
return staticTextCrumbResolver ? staticTextCrumbResolver() : null;
|
||||
};
|
||||
|
||||
const renderMyPortalCrumb = () => (
|
||||
@@ -175,7 +179,7 @@ const Breadcrumbs = (props) => {
|
||||
|
||||
const renderBackCrumb = (
|
||||
onClick,
|
||||
listItemClass = "govuk-breadcrumbs__link-item backChevron"
|
||||
listItemClass = "govuk-breadcrumbs__list-item backChevron"
|
||||
) => renderAnchorCrumb("#", t("common:back-link"), onClick, listItemClass);
|
||||
|
||||
const renderDnsCaseReferenceCrumbs = (referenceValue) => (
|
||||
|
||||
Reference in New Issue
Block a user