NTP-39327| adding address source for skip tracing

This commit is contained in:
aishwarya.srivastava
2025-02-19 16:54:40 +05:30
parent 93c89f919b
commit fe86897877
2 changed files with 47 additions and 5 deletions

View File

@@ -14,7 +14,10 @@ import { useAppDispatch, useAppSelector } from '../../hooks';
import Tag, { TagVariant } from '../../../RN-UI-LIB/src/components/Tag';
import { CaseAllocationType, TaskTitleUIMapping } from '../allCases/interface';
import { updatePreDefinedCaseFormJourney } from '../../reducer/caseReducer';
import { getCollectionFeedbackOnAddressPreDefinedJourney, getCollectionFeedbackOnSkipTracingPreDefinedJourney } from '../../components/utlis/addressGeolocationUtils';
import {
getCollectionFeedbackOnAddressPreDefinedJourney,
getCollectionFeedbackOnSkipTracingPreDefinedJourney,
} from '../../components/utlis/addressGeolocationUtils';
import { _map } from '../../../RN-UI-LIB/src/utlis/common';
import { getTemplateRoute, navigateToScreen } from '../../components/utlis/navigationUtlis';
import { type GenericFunctionArgs } from '../../common/GenericTypes';
@@ -42,6 +45,7 @@ interface IAddressItem {
showOpenMap?: boolean;
showCopy?: boolean;
isSkipTracing?: boolean;
showAddressSource?: boolean;
}
function AddressItem({
@@ -60,6 +64,7 @@ function AddressItem({
showOpenMap = false,
showCopy = true,
isSkipTracing = false,
showAddressSource= false,
}: IAddressItem) {
const { currentGeolocationCoordinates, prefilledAddressScreenTemplate } = useAppSelector(
(state) => ({
@@ -243,7 +248,33 @@ function AddressItem({
<Text style={[styles.textContainer, styles.cardLightTitle, { color: COLORS.TEXT.BLACK }]}>
{sanitizeString(addressItem?.addressText)}
</Text>
{showAddressSource ? (
<View
style={[
GenericStyles.mv16,
GenericStyles.mb2,
GenericStyles.row,
GenericStyles.wrap,
styles.addressSourceContainer,
]}
>
<Text numberOfLines={1} style={{ fontSize: 12 }}>
{dayjs(addressItem?.createdAt).format('DD MMM, YYYY')}
</Text>
<View
style={[
GenericStyles.mv8,
GenericStyles.row,
GenericStyles.wrap,
styles.dot,
{ marginHorizontal: 8 },
]}
/>
<Text dark numberOfLines={1} style={{ fontSize: 12, fontWeight: 'bold' }}>
{addressItem?.secondarySource}
</Text>
</View>
) : null}
{showActionButtons ? (
<View style={[styles.container, GenericStyles.row, GenericStyles.pt12]}>
{showOpenMap ? (
@@ -257,8 +288,7 @@ function AddressItem({
Open map
</Text>
</TouchableOpacity>
) : null
}
) : null}
{showCopy ? (
<TouchableOpacity
activeOpacity={0.7}
@@ -271,7 +301,7 @@ function AddressItem({
<Text style={styles.actionBtn}>Copy</Text>
</View>
</TouchableOpacity>
): null}
) : null}
<TouchableOpacity
activeOpacity={0.7}
@@ -345,6 +375,16 @@ const styles = StyleSheet.create({
color: COLORS.TEXT.BLUE,
opacity: 0.5,
},
addressSourceContainer: {
alignItems: 'center',
},
dot: {
height: 4,
width: 4,
borderRadius: 2,
marginHorizontal: 8,
backgroundColor: COLORS.TEXT.LIGHT,
},
});
export default AddressItem;

View File

@@ -55,6 +55,7 @@ const SkipTracingAddressItem = (props: ISkipTracingAddressItem) => {
});
}
};
const showAddressSource = !!(skipTracingAddress?.secondarySource && skipTracingAddress?.createdAt);
return (
<View key={skipTracingAddress?.id}>
<Accordion
@@ -79,6 +80,7 @@ const SkipTracingAddressItem = (props: ISkipTracingAddressItem) => {
showOpenMap={true}
showCopy={false}
isSkipTracing={true}
showAddressSource={showAddressSource}
/>
}
onExpanded={(isExpanded) => {