diff --git a/src/components/domain/ActiveOperationMap/i18n.json b/src/components/domain/ActiveOperationMap/i18n.json index 2cda5c846..2b910dfc4 100644 --- a/src/components/domain/ActiveOperationMap/i18n.json +++ b/src/components/domain/ActiveOperationMap/i18n.json @@ -5,6 +5,7 @@ "presentationModeButton":"Presentation Mode", "operationMapViewAll":"View all Operations", "operationMapViewAllInRegion":"View all Operations in this Region", + "operationMapViewAllInCountry": "View all Operations in this Country", "operationPopoverPeopleAffected":"People Targeted", "operationPopoverAmountRequested":"Amount Requested (CHF)", "operationPopoverAmountFunded":"Amount Funded (CHF)", diff --git a/src/components/domain/ActiveOperationMap/index.tsx b/src/components/domain/ActiveOperationMap/index.tsx index 952d031a6..0dfcb1e39 100644 --- a/src/components/domain/ActiveOperationMap/index.tsx +++ b/src/components/domain/ActiveOperationMap/index.tsx @@ -316,6 +316,31 @@ function ActiveOperationMap(props: Props) { [countryResponse, countryGroupedAppeal], ); + const allAppealsType = useMemo(() => { + if (isDefined(countryId)) { + return { + searchParam: `country=${countryId}`, + title: strings.operationMapViewAllInCountry, + }; + } + if (isDefined(regionId)) { + return { + searchParam: `region=${regionId}`, + title: strings.operationMapViewAllInRegion, + }; + } + return { + searchParam: undefined, + title: strings.operationMapViewAll, + }; + }, [ + countryId, + regionId, + strings.operationMapViewAllInCountry, + strings.operationMapViewAllInRegion, + strings.operationMapViewAll, + ]); + const heading = resolveToComponent( strings.activeOperationsTitle, { numAppeals: appealResponse?.count ?? '--' }, @@ -412,13 +437,11 @@ function ActiveOperationMap(props: Props) { actions={!presentationMode && ( - {variant === 'region' - ? strings.operationMapViewAllInRegion - : strings.operationMapViewAll} + {allAppealsType.title} )} >