From 19624660eed45e6f67bb2b690344aec6b8d6b65e Mon Sep 17 00:00:00 2001 From: Shri Prakash Bajpai Date: Tue, 22 Apr 2025 17:42:15 +0530 Subject: [PATCH] NTP-58010 Customer outreach Open Map option (#1144) --- .../addresses/common/AddressItemAddressString.tsx | 6 ++---- src/screens/addresses/common/AddressItemHeader.tsx | 7 ++----- src/screens/addresses/utils.ts | 10 +++++++++- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/screens/addresses/common/AddressItemAddressString.tsx b/src/screens/addresses/common/AddressItemAddressString.tsx index 5befc7c0..497cce29 100644 --- a/src/screens/addresses/common/AddressItemAddressString.tsx +++ b/src/screens/addresses/common/AddressItemAddressString.tsx @@ -8,6 +8,7 @@ import { copyAddressToClipboard } from '@screens/addressGeolocation/utils/copyAd import CopyOutlineIcon from '@assets/icons/CopyOutlineIcon'; import { addClickstreamEvent } from '@services/clickstreamEventService'; import { CLICKSTREAM_EVENT_NAMES } from '@common/Constants'; +import { isGeolocation } from '../utils'; const AddressItemAddressString = (props: ITopAddressItemAddressString) => { const { locationDetails, caseId } = props; @@ -21,9 +22,6 @@ const AddressItemAddressString = (props: ITopAddressItemAddressString) => { copyAddressToClipboard(addressText); }; - const isGeoLocation = - locationSubType === LocationType.GEO_LOCATION || - locationSubType === LocationType.SKIP_TRACE_ADDRESS; return ( @@ -33,7 +31,7 @@ const AddressItemAddressString = (props: ITopAddressItemAddressString) => { {addressText} - {!isGeoLocation && ( + {!isGeolocation(locationSubType) && ( {' '} { const { locationDetails, isOtherAddressView, containerStyle, isCoachMarkVisible } = props; @@ -29,10 +30,6 @@ const AddressItemHeader = (props: ITopAddressItemHeader) => { return `${relativeDistanceFormatter(distance)} km`; }, [deviceGeolocationCoordinate]); - const isGeoLocation = - locationSubType === LocationType.GEO_LOCATION || - locationSubType === LocationType.SKIP_TRACE_ADDRESS; - const addressString = useMemo(() => { return [pinCode, city].filter(Boolean).join(', '); }, [pinCode, city]); @@ -70,7 +67,7 @@ const AddressItemHeader = (props: ITopAddressItemHeader) => { ) : ( )} - {!isGeoLocation ? ( + {!isGeolocation(locationSubType) ? ( {relativeDistanceBwLatLong} diff --git a/src/screens/addresses/utils.ts b/src/screens/addresses/utils.ts index d581c82d..2440113c 100644 --- a/src/screens/addresses/utils.ts +++ b/src/screens/addresses/utils.ts @@ -2,7 +2,7 @@ import { CLICKSTREAM_EVENT_NAMES } from '@common/Constants'; import { getTemplateRoute, navigateToScreen } from '@components/utlis/navigationUtlis'; import { CaseDetailStackEnum } from '@screens/caseDetails/CaseDetailStack'; import { addClickstreamEvent } from '@services/clickstreamEventService'; -import { INavigateToAddFeedbackScreen, IOpenOldFeedbacks } from './interfaces'; +import { INavigateToAddFeedbackScreen, IOpenOldFeedbacks, LocationType } from './interfaces'; import { CaseAllocationType, TaskTitleUIMapping } from '@screens/allCases/interface'; import { getCollectionFeedbackOnAddressPreDefinedJourney } from '@components/utlis/addressGeolocationUtils'; import { updatePreDefinedCaseFormJourney } from '@reducers/caseReducer'; @@ -75,3 +75,11 @@ export const getFeedbackColors = ( : COLORS.BACKGROUND.LIGHT_RED_1, }; }; + +export const isGeolocation = (locationSubType: string) => { + return ( + locationSubType === LocationType.GEO_LOCATION || + locationSubType === LocationType.SKIP_TRACE_ADDRESS || + locationSubType === LocationType.CUSTOMER_OUTREACH_ADDRESS + ); +}