22541 expand breadcrumb route-state helpers for label and dns path reuse
This commit is contained in:
@@ -13,8 +13,8 @@ import {
|
||||
setRepresentationSubmit
|
||||
} from "../store/currentView/action";
|
||||
import {
|
||||
normalizeRouteStateQuery,
|
||||
resolveSearchResultsHref
|
||||
resolveSearchResultsHref,
|
||||
resolveSearchBreadcrumbLabel
|
||||
} from "../lib/routing/routeState";
|
||||
const Breadcrumbs = (props) => {
|
||||
const {
|
||||
@@ -73,9 +73,6 @@ const Breadcrumbs = (props) => {
|
||||
? 9
|
||||
: "";
|
||||
|
||||
const routeState = normalizeRouteStateQuery(router.query);
|
||||
const { viewAll, advanced, address, key } = routeState;
|
||||
|
||||
const hideServiceNamePaths = [
|
||||
"/myportal/[appealtypes]",
|
||||
"/newappeal",
|
||||
@@ -112,24 +109,13 @@ const Breadcrumbs = (props) => {
|
||||
fallbackToMyPortalWhenNoFlags: false
|
||||
});
|
||||
|
||||
const breadcrumbLabel = (() => {
|
||||
if (viewAll) {
|
||||
return getViewAllLabel(key);
|
||||
}
|
||||
|
||||
const keyedLabel = getViewAllLabel(key);
|
||||
if (keyedLabel) return keyedLabel;
|
||||
|
||||
if (advanced) {
|
||||
return t("common:breadcrumb-advanced-search-results");
|
||||
}
|
||||
|
||||
if (address) {
|
||||
return t("common:breadcrumb-address-search-results");
|
||||
}
|
||||
|
||||
return t("common:breadcrumb-search-results");
|
||||
})();
|
||||
const breadcrumbLabel = resolveSearchBreadcrumbLabel({
|
||||
query: router.query,
|
||||
getViewAllLabel,
|
||||
advancedLabel: t("common:breadcrumb-advanced-search-results"),
|
||||
addressLabel: t("common:breadcrumb-address-search-results"),
|
||||
defaultLabel: t("common:breadcrumb-search-results")
|
||||
});
|
||||
return (
|
||||
<>
|
||||
<nav
|
||||
|
||||
Reference in New Issue
Block a user