refactor(breadcrumbs): map step-back route branches into renderer group
This commit is contained in:
+11
-40
@@ -215,6 +215,7 @@ const Breadcrumbs = (props) => {
|
||||
simpleMyPortalRouteRenderersByPath,
|
||||
newAppealRouteRenderersByPath,
|
||||
callbackRouteRenderersByPath,
|
||||
stepBackRouteRenderersByPath,
|
||||
caseDetailRouteRenderersByPath,
|
||||
detailAndAccountRouteRenderersByPath
|
||||
} = createMappedRouteRendererGroups({
|
||||
@@ -234,13 +235,21 @@ const Breadcrumbs = (props) => {
|
||||
onBack: () => {
|
||||
router.back();
|
||||
},
|
||||
currentSection: appealType.currentSection,
|
||||
onStepBack: () => {
|
||||
setCurrentSection(appealType.currentSection - 1);
|
||||
},
|
||||
onStepBackWithInlineClass: () => {
|
||||
setCurrentSection(appealType.currentSection - 1);
|
||||
},
|
||||
renderAnchorCrumb,
|
||||
renderLinkCrumb,
|
||||
renderTextCrumb,
|
||||
renderCaseReferenceCrumb,
|
||||
renderMyPortalCrumb,
|
||||
renderMyPortalSectionCrumbs,
|
||||
renderDnsCaseReferenceCrumbs
|
||||
renderDnsCaseReferenceCrumbs,
|
||||
renderBackCrumb
|
||||
});
|
||||
|
||||
const mappedRouteRendererMaps = buildBreadcrumbRendererMaps({
|
||||
@@ -249,6 +258,7 @@ const Breadcrumbs = (props) => {
|
||||
simpleMyPortalRouteRenderersByPath,
|
||||
newAppealRouteRenderersByPath,
|
||||
callbackRouteRenderersByPath,
|
||||
stepBackRouteRenderersByPath,
|
||||
caseDetailRouteRenderersByPath,
|
||||
detailAndAccountRouteRenderersByPath
|
||||
});
|
||||
@@ -274,45 +284,6 @@ const Breadcrumbs = (props) => {
|
||||
|
||||
{isPath("/newappeal") && <></>}
|
||||
|
||||
{isPath("/newappeal/[appealtypes]") && (
|
||||
<>
|
||||
{appealType.currentSection > 1 &&
|
||||
(appealType.currentSection === 9999
|
||||
? renderLinkCrumb(
|
||||
"/",
|
||||
t(
|
||||
"common:service-name-breadcrumb"
|
||||
)
|
||||
)
|
||||
: renderBackCrumb(
|
||||
() =>
|
||||
setCurrentSection(
|
||||
appealType.currentSection -
|
||||
1
|
||||
),
|
||||
"govuk-breadcrumbs__link-item"
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
|
||||
{isPath("/myportal/[appealtypes]") && (
|
||||
<>
|
||||
{appealType.currentSection > 1 &&
|
||||
(appealType.currentSection === 9999
|
||||
? renderLinkCrumb(
|
||||
"/",
|
||||
t(
|
||||
"common:service-name-breadcrumb"
|
||||
)
|
||||
)
|
||||
: renderBackCrumb(() =>
|
||||
setCurrentSection(
|
||||
appealType.currentSection - 1
|
||||
)
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
|
||||
{isPath("/myportal/representation") && (
|
||||
<>
|
||||
{currentView.representationSubmit === true &&
|
||||
|
||||
Reference in New Issue
Block a user