Revert "TP-66615 | Agent Id Card V1" (#826)
This commit is contained in:
Submodule RN-UI-LIB updated: f8795144b2...15c42e0262
@@ -134,8 +134,8 @@ def reactNativeArchitectures() {
|
||||
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
||||
}
|
||||
|
||||
def VERSION_CODE = 165
|
||||
def VERSION_NAME = "2.10.11"
|
||||
def VERSION_CODE = 164
|
||||
def VERSION_NAME = "2.10.10"
|
||||
|
||||
android {
|
||||
ndkVersion rootProject.ext.ndkVersion
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "AV_APP",
|
||||
"version": "2.10.11",
|
||||
"buildNumber": "165",
|
||||
"version": "2.10.10",
|
||||
"buildNumber": "164",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"android:dev": "yarn move:dev && react-native run-android",
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import { isFunction } from '@components/utlis/commonFunctions';
|
||||
import { toast } from '../../RN-UI-LIB/src/components/toast';
|
||||
import axiosInstance, { ApiKeys, getApiUrl } from '../components/utlis/apiHelper';
|
||||
import { logError } from '../components/utlis/errorUtils';
|
||||
import {
|
||||
ImageApprovalStatus,
|
||||
setApprovalStatus,
|
||||
setImageUri,
|
||||
setIsLoading,
|
||||
setIsUploadingImage,
|
||||
setOriginalImageDetails,
|
||||
} from '../reducer/profileSlice';
|
||||
@@ -31,55 +28,42 @@ export const uploadImageId = (agentId: string, uri: string) => (dispatch: AppDis
|
||||
.then(() => {
|
||||
toast({ type: 'info', text1: ToastMessages.IMAGE_UPLOAD_SUCCESS });
|
||||
dispatch(setApprovalStatus(ImageApprovalStatus.PENDING));
|
||||
dispatch(setImageUri(''));
|
||||
})
|
||||
.finally(() => {
|
||||
dispatch(setIsUploadingImage(false));
|
||||
});
|
||||
};
|
||||
|
||||
export const getSelfieDocument =
|
||||
(setLoading = false, callbackFn?: any) =>
|
||||
(dispatch: AppDispatch) => {
|
||||
const url = getApiUrl(ApiKeys.GET_DOCUMENTS, {}, { type: 'SELFIE' });
|
||||
if (setLoading) dispatch(setIsLoading(true));
|
||||
axiosInstance
|
||||
.get(url)
|
||||
.then((res) => {
|
||||
export const getSelfieDocument = () => (dispatch: AppDispatch) => {
|
||||
const url = getApiUrl(ApiKeys.GET_DOCUMENTS, {}, { type: 'SELFIE' });
|
||||
axiosInstance
|
||||
.get(url)
|
||||
.then((res) => {
|
||||
if (res.data?.documents?.[0]) {
|
||||
const { documents, agencyName, agencyCode } = res.data;
|
||||
if (res.data?.documents?.[0]) {
|
||||
const { originalDocumentUri, optimizedDocumentUri, approvalStatus, comment } =
|
||||
documents?.[0] || {};
|
||||
dispatch(
|
||||
setOriginalImageDetails({
|
||||
originalImageUri: originalDocumentUri || '',
|
||||
approvalStatus: approvalStatus || ImageApprovalStatus.NOT_INITIATED,
|
||||
agencyName: agencyName || '',
|
||||
agencyCode: agencyCode || '',
|
||||
optimizedImageUri: optimizedDocumentUri || '',
|
||||
comment: comment || '',
|
||||
})
|
||||
);
|
||||
|
||||
if (approvalStatus === ImageApprovalStatus.APPROVED && isFunction(callbackFn)) {
|
||||
callbackFn();
|
||||
}
|
||||
} else {
|
||||
dispatch(
|
||||
setOriginalImageDetails({
|
||||
originalImageUri: '',
|
||||
agencyName: agencyName || '',
|
||||
agencyCode: agencyCode || '',
|
||||
comment: '',
|
||||
approvalStatus: ImageApprovalStatus.NOT_INITIATED,
|
||||
})
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
logError(err as Error, 'Error while fetching selfie document');
|
||||
})
|
||||
.finally(() => {
|
||||
if (setLoading) dispatch(setIsLoading(false));
|
||||
});
|
||||
};
|
||||
const { originalDocumentUri, optimizedDocumentUri, updatedAt, approvalStatus } =
|
||||
documents?.[0] || {};
|
||||
dispatch(
|
||||
setOriginalImageDetails({
|
||||
originalImageUri: originalDocumentUri || '',
|
||||
validationDate: updatedAt || '',
|
||||
approvalStatus: approvalStatus || ImageApprovalStatus.REJECTED,
|
||||
agencyName: agencyName || '',
|
||||
agencyCode: agencyCode || '',
|
||||
optimizedImageUri: optimizedDocumentUri || '',
|
||||
})
|
||||
);
|
||||
} else {
|
||||
dispatch(
|
||||
setOriginalImageDetails({
|
||||
originalImageUri: '',
|
||||
validationDate: '',
|
||||
approvalStatus: ImageApprovalStatus.REJECTED,
|
||||
})
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
logError(err as Error, 'Error while fetching selfie document');
|
||||
});
|
||||
};
|
||||
|
||||
@@ -19,9 +19,6 @@ import { addClickstreamEvent } from '@services/clickstreamEventService';
|
||||
import { setBlacklistedAppsInstalledData } from '@reducers/blacklistedAppsInstalledSlice';
|
||||
import perf from '@react-native-firebase/perf';
|
||||
import { GLOBAL } from '@constants/Global';
|
||||
import AgentIdCardFlow from '@screens/AgentIdCard';
|
||||
import { IdCardBlockStatus } from '@reducers/profileSlice';
|
||||
import FullScreenLoader from '@rn-ui-lib/components/FullScreenLoader';
|
||||
|
||||
interface IBlockerScreen {
|
||||
children?: ReactNode;
|
||||
@@ -38,8 +35,7 @@ const BlockerScreen = (props: IBlockerScreen) => {
|
||||
(state) => state.foregroundService
|
||||
);
|
||||
const { isWifiOrCellularOn, appState } = useAppSelector((state) => state.metadata);
|
||||
const approvalStatus = useAppSelector((state) => state.profile?.approvalStatus);
|
||||
const isLoading = useAppSelector((state) => state.profile?.isLoading);
|
||||
|
||||
const [shouldUpdate, setShouldUpdate] = useState<boolean>();
|
||||
|
||||
const [showActionBtnLoader, setShowActionBtnLoader] = useState(false);
|
||||
@@ -219,14 +215,6 @@ const BlockerScreen = (props: IBlockerScreen) => {
|
||||
});
|
||||
return <BlockerScreenApps blacklistedAppsInstalled={blacklistedAppsInstalled} />;
|
||||
}
|
||||
if (IdCardBlockStatus[approvalStatus as keyof typeof IdCardBlockStatus]) {
|
||||
return (
|
||||
<>
|
||||
<FullScreenLoader loading={isLoading} />
|
||||
<AgentIdCardFlow />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return <>{props.children}</>;
|
||||
};
|
||||
|
||||
@@ -1007,44 +1007,6 @@ export const CLICKSTREAM_EVENT_NAMES = {
|
||||
name: 'FA_WAIVE_HISTORY_LOADED',
|
||||
description: 'FA_WAIVE_HISTORY_LOADED',
|
||||
},
|
||||
|
||||
// Agent Id Card
|
||||
FA_ID_CARD_BLOCKER_REFRESH_STATUS_BUTTON_CLICKED: {
|
||||
name: 'FA_ID_CARD_BLOCKER_REFRESH_STATUS_BUTTON_CLICKED',
|
||||
description: 'FA_ID_CARD_BLOCKER_REFRESH_STATUS_BUTTON_CLICKED',
|
||||
},
|
||||
FA_ID_CARD_BLOCKER_RECAPTURE_IMAGE_BUTTON_CLICKED: {
|
||||
name: 'FA_ID_CARD_BLOCKER_RECAPTURE_IMAGE_BUTTON_CLICKED',
|
||||
description: 'FA_ID_CARD_BLOCKER_RECAPTURE_IMAGE_BUTTON_CLICKED',
|
||||
},
|
||||
FA_ID_CARD_BLOCKER_VIEW_ID_CARD_BUTTON_CLICKED: {
|
||||
name: 'FA_ID_CARD_BLOCKER_VIEW_ID_CARD_BUTTON_CLICKED',
|
||||
description: 'FA_ID_CARD_BLOCKER_VIEW_ID_CARD_BUTTON_CLICKED',
|
||||
},
|
||||
FA_ID_CARD_BLOCKER_SKIP_BUTTON_CLICKED: {
|
||||
name: 'FA_ID_CARD_BLOCKER_SKIP_BUTTON_CLICKED',
|
||||
description: 'FA_ID_CARD_BLOCKER_SKIP_BUTTON_CLICKED',
|
||||
},
|
||||
FA_ID_CARD_BLOCKER_CAPTURE_IMAGE_BUTTON_CLICKED: {
|
||||
name: 'FA_ID_CARD_BLOCKER_CAPTURE_IMAGE_BUTTON_CLICKED',
|
||||
description: 'FA_ID_CARD_BLOCKER_CAPTURE_IMAGE_BUTTON_CLICKED',
|
||||
},
|
||||
FA_ID_CARD_BLOCKER_SEND_FOR_APPROVAL_BUTTON_CLICKED: {
|
||||
name: 'FA_ID_CARD_BLOCKER_SEND_FOR_APPROVAL_BUTTON_CLICKED',
|
||||
description: 'FA_ID_CARD_BLOCKER_SEND_FOR_APPROVAL_BUTTON_CLICKED',
|
||||
},
|
||||
FA_ID_CARD_BLOCKER_REVIEW_ID_CARD_SCREEN_LOADED: {
|
||||
name: 'FA_ID_CARD_BLOCKER_REVIEW_ID_CARD_SCREEN_LOADED',
|
||||
description: 'FA_ID_CARD_BLOCKER_REVIEW_ID_CARD_SCREEN_LOADED',
|
||||
},
|
||||
FA_ID_CARD_BLOCKER_PENDING_ID_CARD_SCREEN_LOADED: {
|
||||
name: 'FA_ID_CARD_BLOCKER_PENDING_ID_CARD_SCREEN_LOADED',
|
||||
description: 'FA_ID_CARD_BLOCKER_PENDING_ID_CARD_SCREEN_LOADED',
|
||||
},
|
||||
FA_ID_CARD_BLOCKER_REJECTED_ID_CARD_SCREEN_LOADED: {
|
||||
name: 'FA_ID_CARD_BLOCKER_REJECTED_ID_CARD_SCREEN_LOADED',
|
||||
description: 'FA_ID_CARD_BLOCKER_REJECTED_ID_CARD_SCREEN_LOADED',
|
||||
},
|
||||
} as const;
|
||||
|
||||
export enum MimeType {
|
||||
|
||||
@@ -44,8 +44,6 @@ export enum PushNotificationTypes {
|
||||
BOT_REMINDER_CALLBACK_NOTIFICATION = 'REQUESTED_CALLBACK_GEN_AI_BOT_FIELD_SCHEDULED_NOTIFICATION_TEMPLATE',
|
||||
BOT_PROMISED_TO_PAY_NOTIFICATION = 'PROMISED_TO_PAY_GEN_AI_BOT_FIELD_SCHEDULED_NOTIFICATION_TEMPLATE',
|
||||
BOT_REVISIT_NOTIFICATION = 'REVISIT_GEN_AI_BOT_SCHEDULED_NOTIFICATION_TEMPLATE',
|
||||
ID_CARD_APPROVED = 'AGENT_ID_APPROVED_TEMPLATE',
|
||||
ID_CARD_REJECTED = 'AGENT_ID_REJECTED_TEMPLATE',
|
||||
AGENT_REVIVAL_CONTACT_PTP_REMINDER_NOTIFICATION = 'AGENT_REVIVAL_CONTACT_PTP_REMINDER_NOTIFICATION',
|
||||
AGENT_REVIVAL_VISIT_COMMITMENT_REMINDER_NOTIFICATION = 'AGENT_REVIVAL_VISIT_COMMITMENT_REMINDER_NOTIFICATION',
|
||||
AGENT_REVIVAL_CASH_COMMITMENT_REMINDER_NOTIFICATION = 'AGENT_REVIVAL_CASH_COMMITMENT_REMINDER_NOTIFICATION',
|
||||
@@ -148,36 +146,6 @@ const getPaymentFailedNotificationContent = (notification: INotification) => {
|
||||
return { title, body, actions, data, defaultPressAction };
|
||||
};
|
||||
|
||||
// ID Card approved notification content
|
||||
const getIdCardApprovedNotificationContent = (notification: INotification) => {
|
||||
const title = '<span style="color: #1C1C1C">ID card approved!</span>';
|
||||
const body = `<span style="color: #1C1C1C">Your ID card has been approved. Head over to profile to checkout your ID card</span>`;
|
||||
const defaultPressAction = actionContentMap[NotificationAction.DEFAULT].pressAction;
|
||||
const actions = [] as AndroidAction[];
|
||||
const data = {
|
||||
templateId: notification?.template?.id,
|
||||
notificationId: notification?.id,
|
||||
idCardNotification: "true",
|
||||
deepLinks: {},
|
||||
};
|
||||
return { title, body, actions, data, defaultPressAction };
|
||||
};
|
||||
|
||||
// ID Card rejected notification content
|
||||
const getIdCardRejectedNotificationContent = (notification: INotification) => {
|
||||
const title = '<span style="color: #1C1C1C">ID card rejected!</span>';
|
||||
const body = `<span style="color: #1C1C1C">Your ID card has been rejected. Please upload your selfie again for the ID card</span>`;
|
||||
const defaultPressAction = actionContentMap[NotificationAction.DEFAULT].pressAction;
|
||||
const actions = [] as AndroidAction[];
|
||||
const data = {
|
||||
templateId: notification?.template?.id,
|
||||
notificationId: notification?.id,
|
||||
idCardNotification: "true",
|
||||
deepLinks: {},
|
||||
};
|
||||
return { title, body, actions, data, defaultPressAction };
|
||||
};
|
||||
|
||||
const getBotReminderNotificationContent = (notification: INotification) => {
|
||||
const { template } = notification || {};
|
||||
const templateName = template?.templateName;
|
||||
@@ -403,8 +371,6 @@ export const notificationContentMap: Record<string, NotificationContent> = {
|
||||
[PushNotificationTypes.BOT_REMINDER_CALLBACK_NOTIFICATION]: getBotReminderNotificationContent,
|
||||
[PushNotificationTypes.BOT_PROMISED_TO_PAY_NOTIFICATION]: getBotReminderNotificationContent,
|
||||
[PushNotificationTypes.BOT_REVISIT_NOTIFICATION]: getBotReminderNotificationContent,
|
||||
[PushNotificationTypes.ID_CARD_APPROVED]: getIdCardApprovedNotificationContent,
|
||||
[PushNotificationTypes.ID_CARD_REJECTED]: getIdCardRejectedNotificationContent,
|
||||
[PushNotificationTypes.AGENT_REVIVAL_CONTACT_PTP_REMINDER_NOTIFICATION]: getAgentRevivalContactPtpReminderNotificationContent,
|
||||
[PushNotificationTypes.AGENT_REVIVAL_VISIT_COMMITMENT_REMINDER_NOTIFICATION]: getAgentRevivalVisitCommitmentReminderNotificationContent,
|
||||
[PushNotificationTypes.AGENT_REVIVAL_CASH_COMMITMENT_REMINDER_NOTIFICATION]: getAgentRevivalCashCommitmentReminderNotificationContent,
|
||||
|
||||
@@ -108,8 +108,8 @@ const useFetchDocument = (
|
||||
const signedRequestPayload: ISignedRequest = [
|
||||
{
|
||||
documentReferenceId: referenceId,
|
||||
caseId: '' + caseDetailObj?.caseId,
|
||||
caseType: caseDetailObj?.caseType,
|
||||
caseId: '' + caseDetailObj.caseId,
|
||||
caseType: caseDetailObj.caseType,
|
||||
unSignedUri: unSignedUri
|
||||
},
|
||||
];
|
||||
|
||||
@@ -2,33 +2,21 @@ import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
export enum ImageApprovalStatus {
|
||||
NOT_INITIATED = 'NOT_INITIATED',
|
||||
INVALIDATED = 'INVALIDATED',
|
||||
APPROVED = 'APPROVED',
|
||||
PENDING = 'PENDING',
|
||||
REJECTED = 'REJECTED',
|
||||
}
|
||||
|
||||
export const REVIEW_ID_CARD = 'REVIEW_ID_CARD';
|
||||
|
||||
export const IdCardBlockStatus = {
|
||||
[ImageApprovalStatus.REJECTED]: true,
|
||||
[ImageApprovalStatus.INVALIDATED]: true,
|
||||
[ImageApprovalStatus.NOT_INITIATED]: true,
|
||||
[ImageApprovalStatus.PENDING]: true,
|
||||
};
|
||||
|
||||
const initialState = {
|
||||
isUploadingImage: false,
|
||||
imageUri: '',
|
||||
comment: '',
|
||||
originalImageUri: '',
|
||||
validationDate: '',
|
||||
showReviewImageModal: false,
|
||||
approvalStatus: '',
|
||||
approvalStatus: ImageApprovalStatus.NOT_INITIATED,
|
||||
agencyName: '',
|
||||
agencyCode: '',
|
||||
optimizedImageUri: '',
|
||||
showApprovedModal: false,
|
||||
isLoading: false,
|
||||
};
|
||||
|
||||
export const profileSlice = createSlice({
|
||||
@@ -42,20 +30,24 @@ export const profileSlice = createSlice({
|
||||
const {
|
||||
originalImageUri,
|
||||
optimizedImageUri,
|
||||
validationDate,
|
||||
approvalStatus,
|
||||
agencyName,
|
||||
agencyCode,
|
||||
comment,
|
||||
} = action.payload;
|
||||
state.originalImageUri = originalImageUri;
|
||||
state.validationDate = validationDate;
|
||||
state.approvalStatus = approvalStatus;
|
||||
state.agencyName = agencyName;
|
||||
state.agencyCode = agencyCode;
|
||||
state.optimizedImageUri = optimizedImageUri;
|
||||
state.comment = comment;
|
||||
},
|
||||
setIsUploadingImage: (state, action) => {
|
||||
state.isUploadingImage = action.payload;
|
||||
if (!action.payload) {
|
||||
state.showReviewImageModal = false;
|
||||
state.imageUri = '';
|
||||
}
|
||||
},
|
||||
setShowReviewImageModal: (state, action) => {
|
||||
state.showReviewImageModal = action.payload;
|
||||
@@ -63,12 +55,6 @@ export const profileSlice = createSlice({
|
||||
setApprovalStatus: (state, action) => {
|
||||
state.approvalStatus = action.payload;
|
||||
},
|
||||
setShowApprovedModal: (state, action) => {
|
||||
state.showApprovedModal = action.payload;
|
||||
},
|
||||
setIsLoading: (state, action) => {
|
||||
state.isLoading = action.payload;
|
||||
},
|
||||
resetProfileData: () => initialState,
|
||||
},
|
||||
});
|
||||
@@ -80,8 +66,6 @@ export const {
|
||||
setOriginalImageDetails,
|
||||
setApprovalStatus,
|
||||
resetProfileData,
|
||||
setShowApprovedModal,
|
||||
setIsLoading,
|
||||
} = profileSlice.actions;
|
||||
|
||||
export default profileSlice.reducer;
|
||||
|
||||
@@ -70,11 +70,10 @@ export interface IUserSlice extends IUser {
|
||||
attendanceDate: string;
|
||||
};
|
||||
featureFlags: {
|
||||
csaCoOrdinationModuleFeatureFlag: boolean;
|
||||
csaCoOrdinationModuleFeatureFlag : boolean;
|
||||
feeWaiverFeatureFlag: boolean;
|
||||
fieldAgentPerformanceDashboardEnabled: boolean;
|
||||
};
|
||||
employeeId: string;
|
||||
}
|
||||
}
|
||||
|
||||
const initialState: IUserSlice = {
|
||||
@@ -100,8 +99,7 @@ const initialState: IUserSlice = {
|
||||
csaCoOrdinationModuleFeatureFlag: false,
|
||||
feeWaiverFeatureFlag: false,
|
||||
fieldAgentPerformanceDashboardEnabled: false,
|
||||
},
|
||||
employeeId: '',
|
||||
}
|
||||
};
|
||||
|
||||
export const userSlice = createSlice({
|
||||
@@ -139,8 +137,7 @@ export const userSlice = createSlice({
|
||||
state.agentAttendance = action.payload;
|
||||
},
|
||||
setUserAccessData: (state, action) => {
|
||||
const { roles, isExternalAgent, isFieldTeamLeadOrAgencyManager, featureFlags, employeeId } =
|
||||
action.payload || {};
|
||||
const {roles, isExternalAgent, isFieldTeamLeadOrAgencyManager, featureFlags} = action.payload || {};
|
||||
if (roles?.length) {
|
||||
state.isTeamLead = isFieldTeamLeadOrAgencyManager;
|
||||
} else {
|
||||
@@ -149,8 +146,7 @@ export const userSlice = createSlice({
|
||||
state.isExternalAgent = isExternalAgent;
|
||||
state.agentRoles = roles;
|
||||
state.featureFlags = featureFlags;
|
||||
state.employeeId = employeeId;
|
||||
},
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -161,7 +157,7 @@ export const {
|
||||
setSelectedAgent,
|
||||
setCaseSyncLock,
|
||||
setAgentAttendance,
|
||||
setUserAccessData,
|
||||
setUserAccessData
|
||||
} = userSlice.actions;
|
||||
|
||||
export default userSlice.reducer;
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
import React from 'react';
|
||||
import { COLORS } from '@rn-ui-lib/colors';
|
||||
import Avatar from '@rn-ui-lib/components/Avatar';
|
||||
import Text from '@rn-ui-lib/components/Text';
|
||||
import NaviLogoWithTextIcon from '@rn-ui-lib/icons/NaviLogoWithTextIcon';
|
||||
import { GenericStyles } from '@rn-ui-lib/styles';
|
||||
import { StyleSheet, View } from 'react-native';
|
||||
import { useAppSelector } from '@hooks';
|
||||
import { RootState } from '@store';
|
||||
import { NAVI_AGENCY_CODE } from '@common/Constants';
|
||||
|
||||
const IdCard = () => {
|
||||
const imageUri = useAppSelector((state) => state.profile.imageUri);
|
||||
const agencyName = useAppSelector((state: RootState) => state.profile.agencyName);
|
||||
const agencyCode = useAppSelector((state: RootState) => state.profile.agencyCode);
|
||||
const emailId = useAppSelector((state) => state.user.user?.emailId);
|
||||
const phoneNumber = useAppSelector((state) => state.user.user?.phoneNumber);
|
||||
const agentName = useAppSelector((state) => state.user.user?.name!!);
|
||||
const employeeId = useAppSelector((state) => state.user?.employeeId);
|
||||
const isExternalAgency = agencyName && agencyCode !== NAVI_AGENCY_CODE;
|
||||
|
||||
return (
|
||||
<View
|
||||
style={[
|
||||
GenericStyles.centerAligned,
|
||||
GenericStyles.elevation1,
|
||||
GenericStyles.whiteBackground,
|
||||
GenericStyles.br8,
|
||||
GenericStyles.p24,
|
||||
]}
|
||||
>
|
||||
<NaviLogoWithTextIcon />
|
||||
{isExternalAgency ? (
|
||||
<>
|
||||
<Text small bold style={[styles.lightColor, GenericStyles.mt8]}>
|
||||
in association with
|
||||
</Text>
|
||||
<Text dark bold style={styles.agencyName}>
|
||||
{agencyName}
|
||||
</Text>
|
||||
</>
|
||||
) : null}
|
||||
<View style={GenericStyles.pv12}>
|
||||
<Avatar loading={false} size={160} name={agentName} dataURI={imageUri} />
|
||||
</View>
|
||||
<Text style={[styles.greyColor, GenericStyles.fontSize12, GenericStyles.pb8]}>
|
||||
Debt Management Executive
|
||||
</Text>
|
||||
<Text
|
||||
bold
|
||||
style={[
|
||||
GenericStyles.fontSize16,
|
||||
GenericStyles.fw500,
|
||||
GenericStyles.centerAlignedText,
|
||||
GenericStyles.textDarkBlue,
|
||||
]}
|
||||
>
|
||||
{agentName}
|
||||
</Text>
|
||||
<Text style={[styles.agentDetails, GenericStyles.centerAlignedText]}>
|
||||
{emailId ? `${emailId} |` : null} <Text style={styles.agentDetails}>{phoneNumber}</Text>
|
||||
</Text>
|
||||
{employeeId ? (
|
||||
<Text style={[styles.greyColor, GenericStyles.fontSize12]}>
|
||||
Emp ID{' '}
|
||||
<Text bold style={styles.employeeId}>
|
||||
{employeeId}
|
||||
</Text>
|
||||
</Text>
|
||||
) : null}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
greyColor: {
|
||||
color: COLORS.TEXT.GREY,
|
||||
},
|
||||
agentDetails: {
|
||||
fontSize: 12,
|
||||
color: COLORS.BORDER.SECONDARY,
|
||||
},
|
||||
employeeId: {
|
||||
fontSize: 12,
|
||||
color: COLORS.TEXT.DARK_BLUE,
|
||||
},
|
||||
lightColor: {
|
||||
color: COLORS.TEXT.LIGHT,
|
||||
},
|
||||
agencyName: {
|
||||
lineHeight: 18,
|
||||
textAlign: 'center',
|
||||
},
|
||||
});
|
||||
|
||||
export default IdCard;
|
||||
@@ -1,99 +0,0 @@
|
||||
import React from 'react';
|
||||
import { COLORS } from '@rn-ui-lib/colors';
|
||||
import Button from '@rn-ui-lib/components/Button';
|
||||
import Text from '@rn-ui-lib/components/Text';
|
||||
import { GenericStyles } from '@rn-ui-lib/styles';
|
||||
import { StyleSheet, View } from 'react-native';
|
||||
import { useAppDispatch } from '@hooks';
|
||||
import GenerateIdCardIcon from '@rn-ui-lib/icons/GenerateIdCardIcon';
|
||||
import { handleIdCardImageCapture } from '../utils';
|
||||
import { CLICKSTREAM_EVENT_NAMES } from '@common/Constants';
|
||||
import { addClickstreamEvent } from '@services/clickstreamEventService';
|
||||
import { ImageApprovalStatus } from '@reducers/profileSlice';
|
||||
|
||||
const IdCardCreationFlow = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
const handleImageCapture = () => {
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_ID_CARD_BLOCKER_CAPTURE_IMAGE_BUTTON_CLICKED, {
|
||||
screen: ImageApprovalStatus.NOT_INITIATED,
|
||||
});
|
||||
dispatch(handleIdCardImageCapture());
|
||||
};
|
||||
return (
|
||||
<View
|
||||
style={[
|
||||
GenericStyles.centerAligned,
|
||||
GenericStyles.spaceBetween,
|
||||
GenericStyles.p24,
|
||||
GenericStyles.fill,
|
||||
]}
|
||||
>
|
||||
<View style={[GenericStyles.centerAligned, GenericStyles.flex90]}>
|
||||
<Text style={styles.headerTxt}>Setup digital ID card to access the app</Text>
|
||||
<GenerateIdCardIcon />
|
||||
<Text style={[styles.guidelineTxt]}>Guidelines for generating the ID card</Text>
|
||||
|
||||
<View style={styles.w65}>
|
||||
<View style={styles.bulletContainer}>
|
||||
<View style={styles.bullet} />
|
||||
<Text style={styles.bulletText}>Make sure the picture quality is clear</Text>
|
||||
</View>
|
||||
<View style={styles.bulletContainer}>
|
||||
<View style={styles.bullet} />
|
||||
<Text style={styles.bulletText}>Try to take the photo on a white background</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<View style={[GenericStyles.w100, GenericStyles.flex10, GenericStyles.justifyContentFlexEnd]}>
|
||||
<Button
|
||||
textStyle={styles.buttonText}
|
||||
style={[GenericStyles.w100, GenericStyles.elevation2]}
|
||||
title="Capture image for ID card"
|
||||
onPress={handleImageCapture}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
headerTxt: {
|
||||
fontSize: 16,
|
||||
color: COLORS.TEXT.DARK,
|
||||
fontWeight: '500',
|
||||
paddingBottom: 24,
|
||||
},
|
||||
guidelineTxt: {
|
||||
fontSize: 14,
|
||||
color: COLORS.TEXT.DARK,
|
||||
paddingTop: 40,
|
||||
fontWeight: '500',
|
||||
},
|
||||
buttonText: {
|
||||
fontSize: 16,
|
||||
fontWeight: '600',
|
||||
color: COLORS.TEXT.WHITE,
|
||||
},
|
||||
bulletContainer: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'flex-start',
|
||||
marginTop: 8,
|
||||
},
|
||||
bullet: {
|
||||
width: 4,
|
||||
height: 4,
|
||||
borderRadius: 4,
|
||||
backgroundColor: COLORS.BACKGROUND.LIGHT,
|
||||
marginRight: 6,
|
||||
},
|
||||
bulletText: {
|
||||
fontSize: 13,
|
||||
color: COLORS.TEXT.LIGHT,
|
||||
marginTop: -7,
|
||||
lineHeight: 18,
|
||||
},
|
||||
w65: { width: '65%' },
|
||||
});
|
||||
|
||||
export default IdCardCreationFlow;
|
||||
@@ -1,90 +0,0 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import Button from '@rn-ui-lib/components/Button';
|
||||
import NavigationHeader from '@rn-ui-lib/components/NavigationHeader';
|
||||
import { GenericStyles } from '@rn-ui-lib/styles';
|
||||
import { StyleSheet, View } from 'react-native';
|
||||
import IdCard from './IdCard';
|
||||
import { useAppDispatch, useAppSelector } from '@hooks';
|
||||
import { uploadImageId } from '@actions/profileActions';
|
||||
import { handleIdCardImageCapture } from '../utils';
|
||||
import { CLICKSTREAM_EVENT_NAMES } from '@common/Constants';
|
||||
import { addClickstreamEvent } from '@services/clickstreamEventService';
|
||||
import { REVIEW_ID_CARD } from '@reducers/profileSlice';
|
||||
|
||||
const ReviewIdCard = () => {
|
||||
const agentId = useAppSelector((state) => state.user.user?.referenceId!!);
|
||||
const imageUri = useAppSelector((state) => state.profile?.imageUri);
|
||||
const isUploadingImage = useAppSelector((state) => state.profile?.isUploadingImage);
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
useEffect(() => {
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_ID_CARD_BLOCKER_REVIEW_ID_CARD_SCREEN_LOADED, {
|
||||
screen: REVIEW_ID_CARD,
|
||||
});
|
||||
}, []);
|
||||
|
||||
const handleImageCapture = () => {
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_ID_CARD_BLOCKER_RECAPTURE_IMAGE_BUTTON_CLICKED, {
|
||||
screen: REVIEW_ID_CARD,
|
||||
});
|
||||
dispatch(handleIdCardImageCapture());
|
||||
};
|
||||
|
||||
const handleImageUpload = () => {
|
||||
addClickstreamEvent(
|
||||
CLICKSTREAM_EVENT_NAMES.FA_ID_CARD_BLOCKER_SEND_FOR_APPROVAL_BUTTON_CLICKED,
|
||||
{
|
||||
screen: REVIEW_ID_CARD,
|
||||
}
|
||||
);
|
||||
dispatch(uploadImageId(agentId, imageUri));
|
||||
};
|
||||
|
||||
return (
|
||||
<View style={[GenericStyles.fill]}>
|
||||
<NavigationHeader title="Preview Id Card" containerStyle={GenericStyles.pl16} />
|
||||
<View
|
||||
style={[
|
||||
GenericStyles.p16,
|
||||
GenericStyles.pb24,
|
||||
GenericStyles.fill,
|
||||
GenericStyles.justifyContentSpaceBetween,
|
||||
]}
|
||||
>
|
||||
<IdCard />
|
||||
<View style={[GenericStyles.row]}>
|
||||
<Button
|
||||
style={[styles.reTakePhotoBtn]}
|
||||
title="Retake photo"
|
||||
variant="secondary"
|
||||
disabled={isUploadingImage}
|
||||
onPress={handleImageCapture}
|
||||
/>
|
||||
<Button
|
||||
style={[styles.sendApprovalBtn]}
|
||||
title="Send for approval"
|
||||
showLoader={isUploadingImage}
|
||||
loaderStyle={styles.loaderStyle}
|
||||
variant="primary"
|
||||
onPress={handleImageUpload}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
export const styles = StyleSheet.create({
|
||||
reTakePhotoBtn: {
|
||||
flex: 1,
|
||||
marginRight: 6,
|
||||
elevation: 0.2,
|
||||
},
|
||||
sendApprovalBtn: {
|
||||
flex: 1,
|
||||
marginLeft: 6,
|
||||
elevation: 2,
|
||||
},
|
||||
loaderStyle: { paddingVertical: 1.5 },
|
||||
});
|
||||
export default ReviewIdCard;
|
||||
@@ -1,79 +0,0 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { COLORS } from '@rn-ui-lib/colors';
|
||||
import Text from '@rn-ui-lib/components/Text';
|
||||
import { GenericStyles } from '@rn-ui-lib/styles';
|
||||
import { StyleSheet, View } from 'react-native';
|
||||
import Button from '@rn-ui-lib/components/Button';
|
||||
import RefreshIcon from '../../../../RN-UI-LIB/src/Icons/RefreshIcon';
|
||||
import { getSelfieDocument } from '@actions/profileActions';
|
||||
import { useAppDispatch } from '@hooks';
|
||||
import { ImageApprovalStatus, setShowApprovedModal } from '@reducers/profileSlice';
|
||||
import IdCardApprovalPendingIcon from '@rn-ui-lib/icons/IdCardApprovalPendingIcon';
|
||||
import { addClickstreamEvent } from '@services/clickstreamEventService';
|
||||
import { CLICKSTREAM_EVENT_NAMES } from '@common/Constants';
|
||||
|
||||
const IdCardApprovalPending = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
useEffect(() => {
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_ID_CARD_BLOCKER_PENDING_ID_CARD_SCREEN_LOADED, {
|
||||
screen: ImageApprovalStatus.PENDING,
|
||||
});
|
||||
}, []);
|
||||
|
||||
const reFetchSelfieDocument = () => {
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_ID_CARD_BLOCKER_REFRESH_STATUS_BUTTON_CLICKED, {
|
||||
screen: ImageApprovalStatus.PENDING,
|
||||
});
|
||||
dispatch(getSelfieDocument(true, () => dispatch(setShowApprovedModal(true))));
|
||||
};
|
||||
|
||||
return (
|
||||
<View style={[GenericStyles.fill, GenericStyles.centerAligned, GenericStyles.p24]}>
|
||||
<Text style={styles.headerTxt}>ID card approval pending</Text>
|
||||
<Text style={styles.description}>
|
||||
You will get access to the app post approval on the ID card
|
||||
</Text>
|
||||
<IdCardApprovalPendingIcon />
|
||||
<Button
|
||||
onPress={reFetchSelfieDocument}
|
||||
title="Refresh status"
|
||||
variant="primaryText"
|
||||
style={[GenericStyles.pt24, GenericStyles.w100]}
|
||||
textStyle={[GenericStyles.fontSize16, GenericStyles.fw500]}
|
||||
leftIcon={
|
||||
<View style={styles.iconContainer}>
|
||||
<RefreshIcon />
|
||||
</View>
|
||||
}
|
||||
underlayColor="transparent"
|
||||
pressableWidthChange={false}
|
||||
opacityChangeOnPress={true}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
headerTxt: {
|
||||
fontSize: 16,
|
||||
color: COLORS.TEXT.DARK,
|
||||
fontWeight: '500',
|
||||
lineHeight: 20,
|
||||
paddingBottom: 4,
|
||||
},
|
||||
description: {
|
||||
fontSize: 14,
|
||||
color: COLORS.TEXT.BLACK,
|
||||
paddingBottom: 24,
|
||||
textAlign: 'center',
|
||||
fontWeight: '400',
|
||||
lineHeight: 18,
|
||||
paddingHorizontal: 16,
|
||||
},
|
||||
iconContainer: {
|
||||
marginRight: 8,
|
||||
},
|
||||
});
|
||||
|
||||
export default IdCardApprovalPending;
|
||||
@@ -1,90 +0,0 @@
|
||||
import React from 'react';
|
||||
import { StyleSheet, View } from 'react-native';
|
||||
import { GenericStyles } from '@rn-ui-lib/styles';
|
||||
import { COLORS } from '@rn-ui-lib/colors';
|
||||
import Text from '@rn-ui-lib/components/Text';
|
||||
import Button from '@rn-ui-lib/components/Button';
|
||||
import { useAppDispatch } from '@hooks';
|
||||
import { ImageApprovalStatus, setShowApprovedModal } from '@reducers/profileSlice';
|
||||
import { navigateToScreen } from '@components/utlis/navigationUtlis';
|
||||
import { BOTTOM_TAB_ROUTES } from '@screens/allCases/constants';
|
||||
import { ProfileScreenStackEnum } from '@screens/Profile/ProfileStack';
|
||||
import IdCardApprovedIcon from '@rn-ui-lib/icons/IdCardApprovedIcon';
|
||||
import { PageRouteEnum } from '@screens/auth/ProtectedRouter';
|
||||
import { addClickstreamEvent } from '@services/clickstreamEventService';
|
||||
import { CLICKSTREAM_EVENT_NAMES } from '@common/Constants';
|
||||
|
||||
const IdCardApproved = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
const skipHandler = () => {
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_ID_CARD_BLOCKER_SKIP_BUTTON_CLICKED, {
|
||||
screen: ImageApprovalStatus.APPROVED,
|
||||
});
|
||||
dispatch(setShowApprovedModal(false));
|
||||
};
|
||||
|
||||
const showIdCardHandler = () => {
|
||||
dispatch(setShowApprovedModal(false));
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_ID_CARD_BLOCKER_VIEW_ID_CARD_BUTTON_CLICKED, {
|
||||
screen: ImageApprovalStatus.APPROVED,
|
||||
});
|
||||
navigateToScreen(PageRouteEnum.HOME, {
|
||||
screen: BOTTOM_TAB_ROUTES.Profile,
|
||||
params: {
|
||||
screen: ProfileScreenStackEnum.AGENT_ID_CARD,
|
||||
initial: false,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<View
|
||||
style={[
|
||||
GenericStyles.fill,
|
||||
GenericStyles.centerAligned,
|
||||
GenericStyles.spaceBetween,
|
||||
GenericStyles.p24,
|
||||
]}
|
||||
>
|
||||
<View style={[GenericStyles.centerAligned, GenericStyles.flex90]}>
|
||||
<Text style={styles.headerTxt}>ID card approved!</Text>
|
||||
<IdCardApprovedIcon />
|
||||
</View>
|
||||
<View style={[GenericStyles.w100, GenericStyles.flex10, GenericStyles.justifyContentFlexEnd]}>
|
||||
<Button
|
||||
onPress={skipHandler}
|
||||
title="Skip"
|
||||
variant="primaryText"
|
||||
textStyle={[GenericStyles.fontSize16, GenericStyles.fw500]}
|
||||
style={[GenericStyles.w100, GenericStyles.pb16]}
|
||||
underlayColor="transparent"
|
||||
pressableWidthChange={false}
|
||||
opacityChangeOnPress={true}
|
||||
/>
|
||||
<Button
|
||||
textStyle={styles.buttonText}
|
||||
style={[GenericStyles.w100, GenericStyles.elevation2]}
|
||||
title="View ID card"
|
||||
onPress={showIdCardHandler}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
headerTxt: {
|
||||
fontSize: 16,
|
||||
color: COLORS.TEXT.DARK,
|
||||
fontWeight: '500',
|
||||
paddingBottom: 24,
|
||||
},
|
||||
buttonText: {
|
||||
fontSize: 16,
|
||||
fontWeight: '600',
|
||||
color: COLORS.TEXT.WHITE,
|
||||
},
|
||||
});
|
||||
|
||||
export default IdCardApproved;
|
||||
@@ -1,76 +0,0 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import Text from '@rn-ui-lib/components/Text';
|
||||
import { GenericStyles } from '@rn-ui-lib/styles';
|
||||
import { StyleSheet, View } from 'react-native';
|
||||
import Button from '@rn-ui-lib/components/Button';
|
||||
import { COLORS } from '@rn-ui-lib/colors';
|
||||
import { useAppDispatch, useAppSelector } from '@hooks';
|
||||
import IdCardRejectedIcon from '@rn-ui-lib/icons/IdCardRejectedIcon';
|
||||
import { handleIdCardImageCapture } from '../utils';
|
||||
import { addClickstreamEvent } from '@services/clickstreamEventService';
|
||||
import { CLICKSTREAM_EVENT_NAMES } from '@common/Constants';
|
||||
import { ImageApprovalStatus } from '@reducers/profileSlice';
|
||||
|
||||
const IdCardRejected = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
const rejectionReason = useAppSelector((state) => state.profile?.comment);
|
||||
|
||||
useEffect(() => {
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_ID_CARD_BLOCKER_REJECTED_ID_CARD_SCREEN_LOADED, {
|
||||
screen: ImageApprovalStatus.PENDING,
|
||||
});
|
||||
}, []);
|
||||
|
||||
const handleImageCapture = () => {
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_ID_CARD_BLOCKER_RECAPTURE_IMAGE_BUTTON_CLICKED, {
|
||||
screen: ImageApprovalStatus.REJECTED,
|
||||
});
|
||||
dispatch(handleIdCardImageCapture());
|
||||
};
|
||||
|
||||
return (
|
||||
<View
|
||||
style={[
|
||||
GenericStyles.centerAligned,
|
||||
GenericStyles.spaceBetween,
|
||||
GenericStyles.p24,
|
||||
GenericStyles.fill,
|
||||
]}
|
||||
>
|
||||
<View style={[GenericStyles.centerAligned, GenericStyles.flex90]}>
|
||||
<Text style={styles.headerTxt}>ID card rejected!</Text>
|
||||
<Text style={[GenericStyles.pb24, GenericStyles.fontSize14]}>Please try again</Text>
|
||||
<IdCardRejectedIcon />
|
||||
<Text style={[styles.headerTxt, styles.pt40]}>Rejection reason</Text>
|
||||
<Text style={[GenericStyles.pb24, GenericStyles.fontSize14, GenericStyles.mt4]}>
|
||||
{rejectionReason ?? '--'}
|
||||
</Text>
|
||||
</View>
|
||||
<View style={[GenericStyles.w100, GenericStyles.flex10, GenericStyles.justifyContentFlexEnd]}>
|
||||
<Button
|
||||
textStyle={styles.buttonText}
|
||||
style={[GenericStyles.w100, GenericStyles.elevation2]}
|
||||
title="Recapture image for ID card"
|
||||
onPress={handleImageCapture}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
headerTxt: {
|
||||
fontSize: 16,
|
||||
color: COLORS.TEXT.DARK,
|
||||
fontWeight: '500',
|
||||
},
|
||||
pt40: {
|
||||
paddingTop: 40,
|
||||
},
|
||||
buttonText: {
|
||||
fontSize: 16,
|
||||
fontWeight: '600',
|
||||
color: COLORS.TEXT.WHITE,
|
||||
},
|
||||
});
|
||||
export default IdCardRejected;
|
||||
@@ -1,58 +0,0 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import IdCardCreationFlow from './IdCard/IdCardCreationFlow';
|
||||
import ReviewIdCard from './IdCard/ReviewIdCard';
|
||||
import IdCardApprovalPending from './IdCardStatus/IdCardApprovalPending';
|
||||
import IdCardRejected from './IdCardStatus/IdCardRejected';
|
||||
import { getSelfieDocument } from '@actions/profileActions';
|
||||
import { useAppDispatch, useAppSelector } from '@hooks';
|
||||
import { ImageApprovalStatus, setShowApprovedModal } from '@reducers/profileSlice';
|
||||
import notifee, { EventType } from '@notifee/react-native';
|
||||
import { AppState, AppStateStatus } from 'react-native';
|
||||
import { AppStates } from '@interfaces/appStates';
|
||||
|
||||
const AgentIdCardFlow = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
useEffect(() => {
|
||||
return notifee.onForegroundEvent(({ type, detail }) => {
|
||||
switch (type) {
|
||||
case EventType.PRESS:
|
||||
if (detail?.notification?.data?.idCardNotification === 'true') {
|
||||
dispatch(getSelfieDocument(true, () => dispatch(setShowApprovedModal(true))));
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
|
||||
const handleAppStateChange = (nextAppState: AppStateStatus) => {
|
||||
if (nextAppState === AppStates.ACTIVE) {
|
||||
if (!imageUri && ImageApprovalStatus.PENDING === approvalStatus) {
|
||||
dispatch(getSelfieDocument(true, () => dispatch(setShowApprovedModal(true))));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const appStateListener = AppState.addEventListener('change', handleAppStateChange);
|
||||
return () => {
|
||||
appStateListener.remove();
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!imageUri && ImageApprovalStatus.PENDING === approvalStatus) {
|
||||
dispatch(getSelfieDocument(true, () => dispatch(setShowApprovedModal(true))));
|
||||
}
|
||||
}, []);
|
||||
|
||||
const approvalStatus = useAppSelector((state) => state.profile.approvalStatus);
|
||||
const imageUri = useAppSelector((state) => state.profile.imageUri);
|
||||
|
||||
if (!imageUri && approvalStatus === ImageApprovalStatus.PENDING) return <IdCardApprovalPending />;
|
||||
if (!imageUri && approvalStatus === ImageApprovalStatus.REJECTED) return <IdCardRejected />;
|
||||
|
||||
return imageUri ? <ReviewIdCard /> : <IdCardCreationFlow />;
|
||||
};
|
||||
|
||||
export default AgentIdCardFlow;
|
||||
@@ -1,27 +0,0 @@
|
||||
import { PERMISSIONS, RESULTS, request } from 'react-native-permissions';
|
||||
import { CameraOptions, launchCamera } from 'react-native-image-picker';
|
||||
import { setImageUri } from '@reducers/profileSlice';
|
||||
import { AppDispatch } from '@store';
|
||||
|
||||
export const handleIdCardImageCapture = () => (dispatch: AppDispatch) => {
|
||||
request(PERMISSIONS.ANDROID.CAMERA).then(async (result) => {
|
||||
if (result === RESULTS.GRANTED) {
|
||||
const config: CameraOptions = {
|
||||
mediaType: 'photo',
|
||||
cameraType: 'front',
|
||||
};
|
||||
config.includeExtra = true;
|
||||
launchCamera(config, (response) => {
|
||||
if (response?.didCancel) {
|
||||
return;
|
||||
}
|
||||
if (response?.assets?.length) {
|
||||
const { uri } = response.assets[0];
|
||||
if (uri) {
|
||||
dispatch(setImageUri(uri));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -18,7 +18,6 @@ import LineLoader from '@rn-ui-lib/components/suspense_loader/LineLoader';
|
||||
import RetryIcon from '@assets/icons/RetryIcon';
|
||||
import ScreenshotBlocker from '@components/utlis/ScreenshotBlocker';
|
||||
import { getSelfieDocument } from '@actions/profileActions';
|
||||
import { setShouldHideTabBar } from '@reducers/commonSlice';
|
||||
|
||||
|
||||
const PAGE_TITLE = 'Agent ID card';
|
||||
@@ -49,10 +48,8 @@ const AgentIdCard = () => {
|
||||
|
||||
useEffect(() => {
|
||||
ScreenshotBlocker.blockScreenshots();
|
||||
dispatch(setShouldHideTabBar(true))
|
||||
return () => {
|
||||
ScreenshotBlocker.unblockScreenshots();
|
||||
dispatch(setShouldHideTabBar(false))
|
||||
}
|
||||
}, []);
|
||||
|
||||
|
||||
@@ -6,40 +6,56 @@ import { RequestDetail, ViewRequestHistory } from '@screens/cosmosSupport';
|
||||
import React from 'react';
|
||||
import { StyleSheet } from 'react-native';
|
||||
import Profile from '.';
|
||||
import AgentIdCard from './AgentIdCard';
|
||||
|
||||
|
||||
const Stack = createNativeStackNavigator();
|
||||
|
||||
|
||||
export enum ProfileScreenStackEnum {
|
||||
PROFILE = 'profile',
|
||||
COMPLETED_CASES = 'completedCases',
|
||||
TELE_SUPPORT = 'teleSupport',
|
||||
PROFILE_TICKET_DETAIL = 'profileTicketDetail',
|
||||
AGENT_ID_CARD = 'agentIdCard'
|
||||
PROFILE = 'profile',
|
||||
COMPLETED_CASES = 'completedCases',
|
||||
TELE_SUPPORT = 'teleSupport',
|
||||
PROFILE_TICKET_DETAIL = 'profileTicketDetail',
|
||||
|
||||
}
|
||||
|
||||
|
||||
const ProfileStack = () => {
|
||||
return (
|
||||
<Stack.Navigator
|
||||
screenListeners={getScreenFocusListenerObj}
|
||||
screenOptions={DEFAULT_SCREEN_OPTIONS}
|
||||
initialRouteName={ProfileScreenStackEnum.PROFILE}
|
||||
>
|
||||
<Stack.Screen name={ProfileScreenStackEnum.PROFILE} component={Profile} />
|
||||
<Stack.Screen name={ProfileScreenStackEnum.COMPLETED_CASES} component={CompletedCase} />
|
||||
<Stack.Screen name={ProfileScreenStackEnum.AGENT_ID_CARD} component={AgentIdCard} />
|
||||
|
||||
<Stack.Group navigationKey={ProfileScreenStackEnum.TELE_SUPPORT}>
|
||||
<Stack.Screen name={ProfileScreenStackEnum.TELE_SUPPORT} component={ViewRequestHistory} />
|
||||
<Stack.Screen
|
||||
name={ProfileScreenStackEnum.PROFILE_TICKET_DETAIL}
|
||||
component={RequestDetail}
|
||||
/>
|
||||
</Stack.Group>
|
||||
</Stack.Navigator>
|
||||
);
|
||||
};
|
||||
return (
|
||||
<Stack.Navigator
|
||||
screenListeners={getScreenFocusListenerObj}
|
||||
screenOptions={
|
||||
DEFAULT_SCREEN_OPTIONS
|
||||
}
|
||||
initialRouteName={ProfileScreenStackEnum.PROFILE}
|
||||
>
|
||||
<Stack.Screen
|
||||
name={ProfileScreenStackEnum.PROFILE}
|
||||
component={Profile}
|
||||
|
||||
|
||||
const styles = StyleSheet.create({});
|
||||
/>
|
||||
<Stack.Screen
|
||||
name={ProfileScreenStackEnum.COMPLETED_CASES}
|
||||
component={CompletedCase}
|
||||
/>
|
||||
<Stack.Group
|
||||
navigationKey={ProfileScreenStackEnum.TELE_SUPPORT}
|
||||
>
|
||||
<Stack.Screen
|
||||
name={ProfileScreenStackEnum.TELE_SUPPORT}
|
||||
component={ViewRequestHistory}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name={ProfileScreenStackEnum.PROFILE_TICKET_DETAIL}
|
||||
component={RequestDetail}
|
||||
/>
|
||||
</Stack.Group>
|
||||
</Stack.Navigator>
|
||||
)
|
||||
}
|
||||
|
||||
export default ProfileStack;
|
||||
const styles = StyleSheet.create({})
|
||||
|
||||
export default ProfileStack
|
||||
@@ -5,10 +5,10 @@ import { COLORS } from '@rn-ui-lib/colors';
|
||||
import Text from '@rn-ui-lib/components/Text';
|
||||
import ArrowSolidIcon from '@rn-ui-lib/icons/ArrowSolidIcon';
|
||||
import { GenericStyles } from '@rn-ui-lib/styles';
|
||||
import { PageRouteEnum } from '@screens/auth/ProtectedRouter';
|
||||
import { addClickstreamEvent } from '@services/clickstreamEventService';
|
||||
import React from 'react';
|
||||
import { Pressable, StyleSheet, View } from 'react-native';
|
||||
import { ProfileScreenStackEnum } from './ProfileStack';
|
||||
|
||||
const ViewIdCardCta: React.FC = () => {
|
||||
const originalImageUri = useAppSelector((state) => state.profile.originalImageUri);
|
||||
@@ -19,7 +19,7 @@ const ViewIdCardCta: React.FC = () => {
|
||||
<Pressable
|
||||
onPress={() => {
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_ID_CARD_CLICKED);
|
||||
navigateToScreen(ProfileScreenStackEnum.AGENT_ID_CARD);
|
||||
navigateToScreen(PageRouteEnum.AGENT_ID_CARD);
|
||||
}}
|
||||
style={styles.bottomActionable}
|
||||
>
|
||||
@@ -40,12 +40,11 @@ export default ViewIdCardCta;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
bottomActionable: {
|
||||
paddingHorizontal: 2,
|
||||
padding: 2,
|
||||
borderRadius: 4,
|
||||
alignSelf: 'flex-start',
|
||||
},
|
||||
whiteText: {
|
||||
lineHeight: 18,
|
||||
color: COLORS.TEXT.WHITE,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -25,8 +25,6 @@ import GoogleFormModal from '@screens/allCases/GoogleFormModal';
|
||||
import ProfileButton from './ProfileButton';
|
||||
import { getNavigationLinks } from './Navigation/constants';
|
||||
import ViewIdCardCta from './ViewIdCardCta';
|
||||
import CachedImage, { GlobalImageMap } from '@common/CachedImage';
|
||||
import RNFS from 'react-native-fs';
|
||||
|
||||
const Profile: React.FC = () => {
|
||||
const [buttonPressedCount, setButtonPressedCount] = useState(0);
|
||||
@@ -41,10 +39,6 @@ const Profile: React.FC = () => {
|
||||
const showAttendanceBanner = useAppSelector(
|
||||
(state) => state.user?.agentAttendance?.showAttendanceBanner
|
||||
);
|
||||
const originalImageUri = useAppSelector((state) => state.profile?.originalImageUri);
|
||||
|
||||
const cacheDirectory = RNFS.CachesDirectoryPath;
|
||||
const cacheFilePath = `${cacheDirectory}/${phoneNumber}_${name}.jpg`;
|
||||
|
||||
useFocusEffect(
|
||||
React.useCallback(() => {
|
||||
@@ -85,10 +79,8 @@ const Profile: React.FC = () => {
|
||||
<NavigationHeader
|
||||
title={name}
|
||||
subTitle={phoneNumber}
|
||||
avatarImageUri={GlobalImageMap[cacheFilePath] ?? originalImageUri}
|
||||
bottomActionable={<ViewIdCardCta />}
|
||||
subTitleStyle={styles.mt0}
|
||||
showAvatarIcon
|
||||
bottomActionable={<ViewIdCardCta />}
|
||||
rightActionable={
|
||||
supportLink ? (
|
||||
<TouchableOpacity
|
||||
@@ -106,11 +98,6 @@ const Profile: React.FC = () => {
|
||||
)
|
||||
}
|
||||
/>
|
||||
<CachedImage
|
||||
highQualityUri={originalImageUri}
|
||||
cacheFileKey={`${phoneNumber}_${name}`}
|
||||
preCache={true}
|
||||
/>
|
||||
<ScrollView
|
||||
contentContainerStyle={[
|
||||
GenericStyles.p16,
|
||||
@@ -118,8 +105,7 @@ const Profile: React.FC = () => {
|
||||
GenericStyles.fill,
|
||||
]}
|
||||
>
|
||||
{/* Will remove this once the new flow is working fine */}
|
||||
{/* {hideUploadImageBtn ? null : <IDCardImageCapture />} */}
|
||||
{hideUploadImageBtn ? null : <IDCardImageCapture />}
|
||||
{getNavigationLinks()?.map((link, index) => {
|
||||
if (!link.isVisible) return null;
|
||||
return (
|
||||
@@ -197,7 +183,4 @@ const styles = StyleSheet.create({
|
||||
backgroundColor: COLORS.BACKGROUND.VIOLET,
|
||||
padding: 8,
|
||||
},
|
||||
mt0: {
|
||||
marginTop: 0,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -48,7 +48,7 @@ const CaseItemAvatar: React.FC<ICaseItemAvatar> = ({
|
||||
// }
|
||||
|
||||
const cacheDirectory = RNFS.CachesDirectoryPath;
|
||||
const cacheFilePath = `${cacheDirectory}/${caseDetailObj?.caseId}.jpg`;
|
||||
const cacheFilePath = `${cacheDirectory}/${caseDetailObj.caseId}.jpg`;
|
||||
|
||||
const onError = async () => {
|
||||
if (imageUri.startsWith(RELATIVE_PATH_PREFIX)) {
|
||||
@@ -75,8 +75,8 @@ const CaseItemAvatar: React.FC<ICaseItemAvatar> = ({
|
||||
const signedRequestPayload: ISignedRequest = [
|
||||
{
|
||||
documentReferenceId: referenceId,
|
||||
caseId: '' + caseDetail?.caseId,
|
||||
caseType: caseDetail?.caseType,
|
||||
caseId: '' + caseDetail.caseId,
|
||||
caseType: caseDetail.caseType,
|
||||
unSignedUri: unSignedUri
|
||||
},
|
||||
];
|
||||
|
||||
@@ -8,7 +8,7 @@ import CasesIcon from '@rn-ui-lib/icons/CasesIcon';
|
||||
import ProfileIcon from '@rn-ui-lib/icons/ProfileIcon';
|
||||
import VisitPlanIcon from '@rn-ui-lib/icons/VisitPlanIcon';
|
||||
import CasesActionButtons from './CasesActionButtons';
|
||||
import { getCurrentScreen, navigateToScreen } from '@utils/navigationUtlis';
|
||||
import { getCurrentScreen } from '@utils/navigationUtlis';
|
||||
import {
|
||||
resetSelectedTodoList,
|
||||
resetTodoList,
|
||||
@@ -30,7 +30,6 @@ import DashboardScreen from './DashboardScreen';
|
||||
import VisitPlanScreen from './VisitPlanScreen';
|
||||
import CasesListScreen from './CasesListScreen';
|
||||
import { handleTabClick } from './utils';
|
||||
import { ProfileScreenStackEnum } from '@screens/Profile/ProfileStack';
|
||||
|
||||
const AllCasesMain = () => {
|
||||
const loading = useAppSelector((state) => state.allCases.loading);
|
||||
@@ -101,12 +100,6 @@ const AllCasesMain = () => {
|
||||
|
||||
const onTabPressHandler = (e: any) => {
|
||||
const nextTab = e?.data?.routeName;
|
||||
// Ensure it resets to the Profile screen
|
||||
if (nextTab === BOTTOM_TAB_ROUTES.Profile) {
|
||||
navigateToScreen(BOTTOM_TAB_ROUTES.Profile, {
|
||||
screen: ProfileScreenStackEnum.PROFILE,
|
||||
});
|
||||
}
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_TAB_SWITCH, {
|
||||
currentTab: getCurrentScreen()?.name,
|
||||
nextTab,
|
||||
|
||||
@@ -23,18 +23,12 @@ import {
|
||||
import { getAppVersion, setAsyncStorageItem } from '../../components/utlis/commonFunctions';
|
||||
import useScreenshotTracking from '../../hooks/useScreenshotTracking';
|
||||
import { getSyncTime } from '@hooks/capturingApi';
|
||||
import getLitmusExperimentResult, {
|
||||
LitmusExperimentName,
|
||||
LitmusExperimentNameMap,
|
||||
} from '@services/litmusExperiments.service';
|
||||
import getLitmusExperimentResult, { LitmusExperimentName, LitmusExperimentNameMap } from '@services/litmusExperiments.service';
|
||||
import { LocalStorageKeys } from '@common/Constants';
|
||||
import ModalWrapperForAlfredV2 from '@common/ModalWrapperForAlfredV2';
|
||||
import IdCardApproved from '@screens/AgentIdCard/IdCardStatus/IdCardApproved';
|
||||
|
||||
function AuthRouter() {
|
||||
const dispatch = useAppDispatch();
|
||||
const user = useAppSelector((state: RootState) => state.user);
|
||||
const showApprovedModal = useAppSelector((state) => state.profile?.showApprovedModal);
|
||||
const { isLoggedIn, deviceId, sessionDetails, isTeamLead, agentAttendance } = user || {};
|
||||
useNativeButtons();
|
||||
|
||||
@@ -124,14 +118,10 @@ function AuthRouter() {
|
||||
CosmosForegroundService.stopAll();
|
||||
}
|
||||
});
|
||||
getLitmusExperimentResult(LitmusExperimentNameMap[LitmusExperimentName.COSMOS_IMAGE_SYNC], {
|
||||
'x-customer-id': GLOBAL.AGENT_ID,
|
||||
}).then((response) => {
|
||||
getLitmusExperimentResult(LitmusExperimentNameMap[LitmusExperimentName.COSMOS_IMAGE_SYNC], { 'x-customer-id': GLOBAL.AGENT_ID }).then((response) => {
|
||||
setAsyncStorageItem(LocalStorageKeys.IS_IMAGE_SYNC_ALLOWED, response);
|
||||
});
|
||||
getLitmusExperimentResult(LitmusExperimentNameMap[LitmusExperimentName.COSMOS_DATA_SYNC], {
|
||||
'x-customer-id': GLOBAL.AGENT_ID,
|
||||
}).then((response) => {
|
||||
getLitmusExperimentResult(LitmusExperimentNameMap[LitmusExperimentName.COSMOS_DATA_SYNC], { 'x-customer-id': GLOBAL.AGENT_ID }).then((response) => {
|
||||
setAsyncStorageItem(LocalStorageKeys.IS_DATA_SYNC_ALLOWED, response);
|
||||
});
|
||||
}
|
||||
@@ -145,9 +135,6 @@ function AuthRouter() {
|
||||
<TrackingComponent>
|
||||
<BlockerScreen>
|
||||
<ProtectedRouter />
|
||||
<ModalWrapperForAlfredV2 animationType="slide" visible={showApprovedModal}>
|
||||
<IdCardApproved />
|
||||
</ModalWrapperForAlfredV2>
|
||||
</BlockerScreen>
|
||||
</TrackingComponent>
|
||||
) : (
|
||||
|
||||
@@ -23,7 +23,7 @@ import usePolling from '@hooks/usePolling';
|
||||
import useResyncFirebase from '@hooks/useResyncFirebase';
|
||||
import CaseDetailStack from '@screens/caseDetails/CaseDetailStack';
|
||||
import { getFirestoreResyncIntervalInMinutes } from '@common/AgentActivityConfigurableConstants';
|
||||
import { getSelfieDocument } from '@actions/profileActions';
|
||||
import AgentIdCard from '@screens/Profile/AgentIdCard';
|
||||
|
||||
const Stack = createNativeStackNavigator();
|
||||
|
||||
@@ -63,7 +63,6 @@ const ProtectedRouter = () => {
|
||||
useEffect(() => {
|
||||
if (isOnline) {
|
||||
dispatch(getAgentDetail());
|
||||
dispatch(getSelfieDocument());
|
||||
}
|
||||
}, [isOnline]);
|
||||
|
||||
@@ -117,6 +116,7 @@ const ProtectedRouter = () => {
|
||||
<Stack.Screen name={PageRouteEnum.TODO_LIST} component={TodoList} />
|
||||
<Stack.Screen name={PageRouteEnum.NOTIFICATIONS} component={Notifications} />
|
||||
<Stack.Screen name={PageRouteEnum.IMPERSONATED_LOGIN} component={ImpersonatedUser} />
|
||||
<Stack.Screen name={PageRouteEnum.AGENT_ID_CARD} component={AgentIdCard} />
|
||||
</Stack.Navigator>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user