@eka-care/abha-stg 0.1.36 → 0.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/{index.html → dist/index.html} +2 -1
- package/dist/sdk/abha/css/abha.css +1 -0
- package/dist/sdk/abha/js/abha.js +63 -0
- package/package.json +1 -1
- package/.turbo/daemon/7f0c6427972069cb-turbo.log.2025-11-12 +0 -0
- package/package/styles/pds2/border.ts +0 -69
- package/package/styles/pds2/colors.ts +0 -70
- package/package/styles/pds2/spacing.ts +0 -1007
- package/package/tailwind/tailwind.config.ts +0 -124
- package/postcss.config.js +0 -6
- package/scripts/build-purged-css.cjs +0 -70
- package/src/App.css +0 -0
- package/src/App.tsx +0 -43
- package/src/api-queries/aorta-go/v3/get-profile-patient.ts +0 -32
- package/src/api-queries/aorta-go/v3/get-profiles-phr-user.ts +0 -26
- package/src/api-queries/aorta-go/v3/post-auth-init-v2.ts +0 -34
- package/src/api-queries/aorta-go/v3/post-auth-logout-v2.ts +0 -32
- package/src/api-queries/aorta-go/v3/post-auth-verify-v2.ts +0 -38
- package/src/api-queries/aorta-go/v3/post-profile-switch.ts +0 -39
- package/src/api-queries/ndhm/get-abdm-register-suggest.ts +0 -37
- package/src/api-queries/ndhm/get-pincode-details.ts +0 -28
- package/src/api-queries/ndhm/post-abdm-login-init.ts +0 -37
- package/src/api-queries/ndhm/post-abdm-login-phr.ts +0 -37
- package/src/api-queries/ndhm/post-abdm-login-verify.ts +0 -37
- package/src/api-queries/ndhm/post-abdm-profile-eka-link-phr.ts +0 -40
- package/src/api-queries/ndhm/post-abdm-profile-eka.ts +0 -66
- package/src/api-queries/ndhm/post-abdm-register-abha-number-create-phr.ts +0 -37
- package/src/api-queries/ndhm/post-abdm-register-mobile-create-phr.ts +0 -66
- package/src/api-queries/ndhm/post-abdm-register-mobile-resend-otp.ts +0 -32
- package/src/api-queries/ndhm/post-abdm-register-mobile-verify.ts +0 -38
- package/src/api-queries/ndhm/post-abdm-register-phr-check.ts +0 -34
- package/src/api-queries/ndhm/post-register-aadhaar-create-phr.ts +0 -37
- package/src/api-queries/ndhm/post-register-aadhaar-init.ts +0 -34
- package/src/api-queries/ndhm/post-register-aadhaar-mobile-resend-otp.ts +0 -34
- package/src/api-queries/ndhm/post-register-aadhaar-mobile-verify.ts +0 -37
- package/src/api-queries/ndhm/post-register-aadhaar-resend-otp.ts +0 -34
- package/src/api-queries/ndhm/post-register-aadhaar-verify.ts +0 -40
- package/src/api-queries/ndhm/post-register-mobile-init.ts +0 -34
- package/src/api-queries/use-get-profiles-patient.ts +0 -12
- package/src/api-queries/use-get-profiles-phr-user.ts +0 -28
- package/src/api-queries/use-post-abdm-login-verify-v1.ts +0 -26
- package/src/api-queries/use-post-auth-verify-v2.ts +0 -50
- package/src/api-queries/use-post-profile-switch.ts +0 -58
- package/src/api-queries/use-post-register-mobile-create-phr.ts +0 -39
- package/src/api-queries/user-post-abdm-profile-login-phr.ts +0 -26
- package/src/assets/Success.json +0 -1
- package/src/assets/react.svg +0 -1
- package/src/atoms/button/custom-button.tsx +0 -32
- package/src/atoms/button/index.tsx +0 -40
- package/src/atoms/button/types.d.ts +0 -31
- package/src/atoms/header.tsx +0 -25
- package/src/atoms/input-field/index.tsx +0 -63
- package/src/atoms/input-field/patient-input-field.tsx +0 -16
- package/src/atoms/input-field/types.ts +0 -24
- package/src/atoms/pds2-otp-input/index.tsx +0 -35
- package/src/atoms/pds2-otp-input/types.d.ts +0 -3
- package/src/atoms/single-input-chip/index.tsx +0 -32
- package/src/atoms/single-input-chip/types.ts +0 -6
- package/src/atoms/spinner.tsx +0 -33
- package/src/atoms/text-separator.tsx +0 -11
- package/src/atoms/ui/spinner.tsx +0 -75
- package/src/constants/constants.ts +0 -376
- package/src/fetch-client/index.ts +0 -164
- package/src/index.css +0 -152
- package/src/main.tsx +0 -374
- package/src/molecules/abha/bottom-sheet/bottom-sheet-wrapper.tsx +0 -40
- package/src/molecules/abha/bottom-sheet/index.tsx +0 -66
- package/src/molecules/abha/spaced-input-component.tsx +0 -168
- package/src/molecules/copyright-year.tsx +0 -16
- package/src/molecules/exit-popup/index.tsx +0 -101
- package/src/molecules/pds2-otp-component/index.tsx +0 -147
- package/src/organisms/abha/abha-header.tsx +0 -25
- package/src/organisms/abha/abha-stepper.tsx +0 -83
- package/src/organisms/abha/error-bottom-sheet.tsx +0 -27
- package/src/organisms/abha/otp-card.tsx +0 -99
- package/src/organisms/abha/verification-status.tsx +0 -30
- package/src/organisms/choose-language/choose-language.tsx +0 -53
- package/src/organisms/choose-language/types.ts +0 -10
- package/src/organisms/screen-switcher/screen-switcher.tsx +0 -80
- package/src/routes/abha-aadhaar-verification-status-screen.tsx +0 -246
- package/src/routes/abha-created-screen.tsx +0 -45
- package/src/routes/abha-login-otp-verify-screen.tsx +0 -519
- package/src/routes/abha-mobile-linking-status-screen.tsx +0 -267
- package/src/routes/abha-otp-and-mobile-screen.tsx +0 -435
- package/src/routes/abha-phone-number-verification-screen.tsx +0 -388
- package/src/routes/create-abha-address-screen.tsx +0 -928
- package/src/routes/create-abha-with-aadhaar-screen.tsx +0 -986
- package/src/routes/create-eka-profile-screen.tsx +0 -831
- package/src/routes/get-all-profiles-screen.tsx +0 -161
- package/src/routes/login-or-create-abha-address-screen.tsx +0 -1056
- package/src/routes/login-with-abha-screen.tsx +0 -454
- package/src/routes/select-abha-from-list-screen.tsx +0 -792
- package/src/routes/select-eka-profile-screen.tsx +0 -446
- package/src/routes/utils/trackAbhaEvent.ts +0 -41
- package/src/stores/auth-abha-store/index.ts +0 -152
- package/src/stores/auth-abha-store/types.ts +0 -217
- package/src/utils/mock-auth-response.ts +0 -29
- package/src/utils/send-event-utils.ts +0 -76
- package/src/utils/validations.ts +0 -89
- package/src/vite-env.d.ts +0 -1
- package/tailwind.config.ts +0 -9
- package/tsconfig.json +0 -25
- package/tsconfig.node.json +0 -10
- package/tsconfig.node.tsbuildinfo +0 -1
- package/tsconfig.tsbuildinfo +0 -1
- package/vite.config.d.ts +0 -2
- package/vite.config.js +0 -30
- package/vite.config.ts +0 -35
- /package/{public → dist}/images/adhaar.webp +0 -0
- /package/{public → dist}/images/at-the-rate.webp +0 -0
- /package/{public → dist}/images/avatar.webp +0 -0
- /package/{public → dist}/images/ayushman-bharat.webp +0 -0
- /package/{public → dist}/images/circle-checkmark.webp +0 -0
- /package/{public → dist}/images/link-abha.webp +0 -0
- /package/{public → dist}/images/national-authority.webp +0 -0
- /package/{public → dist}/images/three-dots.webp +0 -0
|
@@ -1,792 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ArrowLeftRegularIcon,
|
|
3
|
-
// ChevronDownRegularIcon,
|
|
4
|
-
CircleCheckSolidIcon,
|
|
5
|
-
// EkaIcon,
|
|
6
|
-
PlusRegularIcon,
|
|
7
|
-
// ProfileIcon,
|
|
8
|
-
// XMarkRegularIcon,
|
|
9
|
-
CircleInfoRegularIcon,
|
|
10
|
-
CircleExclamationSolidIcon
|
|
11
|
-
} from '@eka-care/icons';
|
|
12
|
-
import {
|
|
13
|
-
ABHA_AUTH_FLOW_METHOD,
|
|
14
|
-
GET_EXTRA_HEADERS,
|
|
15
|
-
LOADING_STATE,
|
|
16
|
-
REGISTRATION_TYPE,
|
|
17
|
-
setIndividualEnv,
|
|
18
|
-
TProfileRecord,
|
|
19
|
-
} from '../constants/constants';
|
|
20
|
-
import React, { useState } from 'react';
|
|
21
|
-
import Pds2Button from '../atoms/button';
|
|
22
|
-
import Pds2CustomButton from '../atoms/button/custom-button';
|
|
23
|
-
import Pds2Header from '../atoms/header';
|
|
24
|
-
import TextSeparator from '../atoms/text-separator';
|
|
25
|
-
import AbhaErrorBottomSheet from '../organisms/abha/error-bottom-sheet';
|
|
26
|
-
import useAuthAbhaStore from '../stores/auth-abha-store';
|
|
27
|
-
import { SCREEN_NAMES, TAbhaAddress } from '../stores/auth-abha-store/types';
|
|
28
|
-
import usePostAuthVerifyV2 from '../api-queries/use-post-auth-verify-v2';
|
|
29
|
-
import ExitPopup from '../molecules/exit-popup';
|
|
30
|
-
import usePostAbdmProfileLoginPhr from '../api-queries/user-post-abdm-profile-login-phr';
|
|
31
|
-
import { onAbhaSuccess, unMount } from '../main';
|
|
32
|
-
import { getMockAuthVerifyResponse } from '../utils/mock-auth-response';
|
|
33
|
-
import AbhaStepper from '../organisms/abha/abha-stepper';
|
|
34
|
-
import handleSendEvent from '../utils/send-event-utils';
|
|
35
|
-
import postAbdmLoginInit from '../api-queries/ndhm/post-abdm-login-init';
|
|
36
|
-
import postRegisterMobileInit from '../api-queries/ndhm/post-register-mobile-init';
|
|
37
|
-
import postAuthLogoutV2 from '../api-queries/aorta-go/v3/post-auth-logout-v2';
|
|
38
|
-
|
|
39
|
-
type InitMethod = 'aadhaar' | 'mobile';
|
|
40
|
-
|
|
41
|
-
const SelectAbhaFromListScreen = () => {
|
|
42
|
-
const [selectedAbha, setSelectedAbha] = useState<TAbhaAddress | null>(null);
|
|
43
|
-
const setScreen = useAuthAbhaStore((state) => state.setScreen);
|
|
44
|
-
const goBackLoginScreen = useAuthAbhaStore((state) => state.goBackLoginScreen);
|
|
45
|
-
const txnId = useAuthAbhaStore((state) => state.txnId);
|
|
46
|
-
const authTxnId = useAuthAbhaStore((state) => state.authTxnId);
|
|
47
|
-
const abhaAddressList = useAuthAbhaStore((state) => state.abhaAddressList);
|
|
48
|
-
const setBottomsheetErrorInfo = useAuthAbhaStore((state) => state.setBottomsheetErrorInfo);
|
|
49
|
-
const clearAbhaAuthStore = useAuthAbhaStore((state) => state.clearAbhaAuthStore);
|
|
50
|
-
const setSelectedAbhaAddress = useAuthAbhaStore((state) => state.setSelectedAbhaAddress);
|
|
51
|
-
const abhaAuthFlowMethod = useAuthAbhaStore((state) => state.abhaAuthFlowMethod);
|
|
52
|
-
const loginIdentifierValue = useAuthAbhaStore((state) => state.loginIdentifierValue);
|
|
53
|
-
const [error, setError] = useState<string | null>('');
|
|
54
|
-
const [isExitPopupOpen, setIsExitPopupOpen] = useState<boolean>(false);
|
|
55
|
-
const setEkaProfileInfo = useAuthAbhaStore((state) => state.setEkaProfileInfo);
|
|
56
|
-
const setAbhaAuthFlowMethod = useAuthAbhaStore((state) => state.setAbhaAuthFlowMethod);
|
|
57
|
-
const setAadhaarVerificationSkipStateStatus = useAuthAbhaStore(
|
|
58
|
-
(state) => state.setAadhaarVerificationSkipStateStatus
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
const [abdmLoginVerifyApiStatus, setAbdmLoginVerifyApiStatus] = useState<LOADING_STATE>(
|
|
62
|
-
LOADING_STATE.IDLE
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
const validGenders = ['M', 'F', 'O', 'U'] as const;
|
|
66
|
-
|
|
67
|
-
// const [isBottomSheetOpen, setIsBottomSheetOpen] = useState<boolean>(false);
|
|
68
|
-
const { mutateAsync: postAuthVerifyV2Mutate } = usePostAuthVerifyV2();
|
|
69
|
-
const { mutateAsync: postAbdmProfileLoginPhr } = usePostAbdmProfileLoginPhr();
|
|
70
|
-
const ekaProfileInfo = useAuthAbhaStore((state) => state.ekaProfileInfo);
|
|
71
|
-
|
|
72
|
-
const registrationType = useAuthAbhaStore((state) => state.registrationType);
|
|
73
|
-
const clientId = useAuthAbhaStore((state) => state.clientId);
|
|
74
|
-
const isEkaAppLogin = useAuthAbhaStore((state) => state.isEkaAppLogin);
|
|
75
|
-
const setRegistrationType = useAuthAbhaStore((state) => state.setRegistrationType);
|
|
76
|
-
const selectedMethod = useAuthAbhaStore((state) => state.abhaAuthFlowMethod);
|
|
77
|
-
const identityValue = useAuthAbhaStore((state) => state.identityValue);
|
|
78
|
-
const setMobileInitResponse = useAuthAbhaStore((state) => state.setMobileInitResponse);
|
|
79
|
-
const [initApiStatus, setInitApiStatus] = useState<Record<InitMethod, LOADING_STATE>>({
|
|
80
|
-
aadhaar: LOADING_STATE.IDLE,
|
|
81
|
-
mobile: LOADING_STATE.IDLE,
|
|
82
|
-
});
|
|
83
|
-
const setAadhaarInitResponse = useAuthAbhaStore((state) => state.setAadhaarInitResponse);
|
|
84
|
-
const setSelectedAbhaFlow = useAuthAbhaStore((state) => state.setSelectedAbhaFlow);
|
|
85
|
-
const isNewLoginOrCreateFlow = useAuthAbhaStore((state) => state.isNewLoginOrCreateFlow);
|
|
86
|
-
const extra_headers = GET_EXTRA_HEADERS();
|
|
87
|
-
const setLoginIdentifierValue = useAuthAbhaStore((state) => state.setLoginIdentifierValue);
|
|
88
|
-
const [kycTooltipShow,setKycTooltipShow] = useState(false);
|
|
89
|
-
|
|
90
|
-
// Analytics event tracker
|
|
91
|
-
const trackAbhaEvent = ({ name, data = {} }: { name: string; data?: Record<string, any> }) => {
|
|
92
|
-
const baseProps = {
|
|
93
|
-
login_platform: clientId,
|
|
94
|
-
is_eka_app_login: isEkaAppLogin ? 'true' : 'false',
|
|
95
|
-
is_new_login_or_create_flow: isNewLoginOrCreateFlow ? 'true' : 'false',
|
|
96
|
-
txn_id: txnId || 'missing txnId',
|
|
97
|
-
oid: extra_headers?.['X-User-ID'] ? 'true' : 'false',
|
|
98
|
-
access_token: extra_headers?.['auth'] ? 'true' : 'false',
|
|
99
|
-
flow: selectedMethod ?? ""
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const eventData = {
|
|
103
|
-
...baseProps,
|
|
104
|
-
...data,
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
handleSendEvent({
|
|
108
|
-
eventName: name,
|
|
109
|
-
eventData,
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
window.curio?.pushToMixpanel?.(name, eventData);
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
const handleCreateABHAClick = async () => {
|
|
116
|
-
trackAbhaEvent({
|
|
117
|
-
name: 'abha_login_select_abha_init_started',
|
|
118
|
-
data: {
|
|
119
|
-
method: selectedMethod,
|
|
120
|
-
platform: clientId,
|
|
121
|
-
},
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
// Create a helper function to update status
|
|
125
|
-
const updateInitStatus = (method: InitMethod, status: LOADING_STATE) => {
|
|
126
|
-
setInitApiStatus((prev) => ({
|
|
127
|
-
...prev,
|
|
128
|
-
[method]: status,
|
|
129
|
-
}));
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
// set the registration type as create
|
|
133
|
-
setRegistrationType(REGISTRATION_TYPE.CREATE);
|
|
134
|
-
|
|
135
|
-
// call the registration verify api for corresponding abha app method
|
|
136
|
-
if (selectedMethod === ABHA_AUTH_FLOW_METHOD.MOBILE) {
|
|
137
|
-
const {
|
|
138
|
-
txn_id,
|
|
139
|
-
hint,
|
|
140
|
-
error: mobileError,
|
|
141
|
-
action: errorAction,
|
|
142
|
-
} = await postRegisterMobileInit({
|
|
143
|
-
mobile_number: identityValue,
|
|
144
|
-
});
|
|
145
|
-
if (txn_id && hint) {
|
|
146
|
-
trackAbhaEvent({
|
|
147
|
-
name: 'abha_login_select_abha_mobile_init_success',
|
|
148
|
-
data: {
|
|
149
|
-
method: selectedMethod,
|
|
150
|
-
platform: clientId,
|
|
151
|
-
txn_id,
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
setMobileInitResponse({
|
|
155
|
-
authTxnId,
|
|
156
|
-
txnId: txn_id,
|
|
157
|
-
mobileOtpSentToHint: hint,
|
|
158
|
-
});
|
|
159
|
-
setSelectedAbhaFlow('mobile');
|
|
160
|
-
updateInitStatus('mobile', LOADING_STATE.RESOLVED);
|
|
161
|
-
setRegistrationType(REGISTRATION_TYPE.CREATE);
|
|
162
|
-
setScreen(SCREEN_NAMES.ABHA_PHONE_NUMBER_VERIFICATION);
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
trackAbhaEvent({
|
|
167
|
-
name: 'abha_login_select_abha_init_failed',
|
|
168
|
-
data: {
|
|
169
|
-
method: selectedMethod,
|
|
170
|
-
platform: clientId,
|
|
171
|
-
reason: mobileError || 'unknown',
|
|
172
|
-
reason_exists: !!mobileError,
|
|
173
|
-
},
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
updateInitStatus('mobile', LOADING_STATE.REJECTED);
|
|
177
|
-
if (errorAction) {
|
|
178
|
-
setBottomsheetErrorInfo(errorAction);
|
|
179
|
-
} else {
|
|
180
|
-
setError(mobileError || 'Something went wrong');
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
else if (selectedMethod === ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER) {
|
|
185
|
-
// setScreen(SCREEN_NAMES.CREATE_EKA_PROFILE);
|
|
186
|
-
trackAbhaEvent({
|
|
187
|
-
name: 'abha_fetching_profiles',
|
|
188
|
-
data: {
|
|
189
|
-
method: selectedMethod,
|
|
190
|
-
platform: clientId,
|
|
191
|
-
},
|
|
192
|
-
});
|
|
193
|
-
setScreen(SCREEN_NAMES.GET_ALL_PROFILES);
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
return;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
const handleContinueClick = async () => {
|
|
200
|
-
if (abhaAuthFlowMethod === ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER && selectedAbha) {
|
|
201
|
-
setAbdmLoginVerifyApiStatus(LOADING_STATE.LOADING);
|
|
202
|
-
setIndividualEnv({
|
|
203
|
-
extraHeaders: { auth: '' },
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
if(!isEkaAppLogin){
|
|
207
|
-
const logout_status = await postAuthLogoutV2();
|
|
208
|
-
|
|
209
|
-
if (!logout_status) {
|
|
210
|
-
trackAbhaEvent({
|
|
211
|
-
name: 'logout_api_failed_before_init_on_continue_click',
|
|
212
|
-
data: {
|
|
213
|
-
method: selectedMethod,
|
|
214
|
-
platform: clientId,
|
|
215
|
-
reason: 'logout_api_response_false',
|
|
216
|
-
},
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
const {
|
|
221
|
-
txn_id: abdmTxnId,
|
|
222
|
-
error: abdmLoginError,
|
|
223
|
-
action: abdmLoginErrorAction,
|
|
224
|
-
hint,
|
|
225
|
-
} = await postAbdmLoginInit({
|
|
226
|
-
method: ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS,
|
|
227
|
-
identifier: selectedAbha.abha_address,
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
// Track login init call
|
|
231
|
-
trackAbhaEvent({
|
|
232
|
-
name: 'abha_abdm_login_init_triggered',
|
|
233
|
-
data: {
|
|
234
|
-
flow_step_type: 'init',
|
|
235
|
-
authTxnId: authTxnId,
|
|
236
|
-
ndhmTxnId: abdmTxnId,
|
|
237
|
-
method: selectedMethod,
|
|
238
|
-
},
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
console.log('after postAbdmLoginInit', abdmLoginErrorAction);
|
|
242
|
-
console.log('after postAbdmLoginInit', abdmLoginErrorAction);
|
|
243
|
-
|
|
244
|
-
if (abdmLoginErrorAction) {
|
|
245
|
-
trackAbhaEvent({
|
|
246
|
-
name: 'abha_abdm_login_init_abha_error_action',
|
|
247
|
-
data: {
|
|
248
|
-
method: selectedMethod,
|
|
249
|
-
platform: clientId,
|
|
250
|
-
action: abdmLoginErrorAction?.cta?.title || 'unknown',
|
|
251
|
-
action_exists: !!abdmLoginErrorAction?.cta?.title,
|
|
252
|
-
},
|
|
253
|
-
});
|
|
254
|
-
setBottomsheetErrorInfo(abdmLoginErrorAction);
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
if (abdmLoginError) {
|
|
258
|
-
trackAbhaEvent({
|
|
259
|
-
name: 'abha_abdm_login_init_failed',
|
|
260
|
-
data: {
|
|
261
|
-
method: selectedMethod,
|
|
262
|
-
platform: clientId,
|
|
263
|
-
reason: abdmLoginError || 'unknown',
|
|
264
|
-
reason_exists: !!abdmLoginError,
|
|
265
|
-
},
|
|
266
|
-
});
|
|
267
|
-
setAbdmLoginVerifyApiStatus(LOADING_STATE.REJECTED);
|
|
268
|
-
setError(abdmLoginError || 'Something went wrong. Please try again.');
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
if (!abdmTxnId) {
|
|
272
|
-
setError('Something went wrong. Please try again.');
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
// Login init success
|
|
277
|
-
trackAbhaEvent({
|
|
278
|
-
name: 'abha_login_init_success',
|
|
279
|
-
data: {
|
|
280
|
-
flow_step_type: 'init',
|
|
281
|
-
authTxnId: authTxnId,
|
|
282
|
-
ndhmTxnId: abdmTxnId,
|
|
283
|
-
hint: hint,
|
|
284
|
-
},
|
|
285
|
-
});
|
|
286
|
-
|
|
287
|
-
setAadhaarInitResponse({
|
|
288
|
-
authTxnId,
|
|
289
|
-
txnId: abdmTxnId,
|
|
290
|
-
aadhaarOtpSentToHint: hint || null,
|
|
291
|
-
});
|
|
292
|
-
setAbdmLoginVerifyApiStatus(LOADING_STATE.RESOLVED);
|
|
293
|
-
setLoginIdentifierValue(selectedAbha.abha_address);
|
|
294
|
-
setAbhaAuthFlowMethod(ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS);
|
|
295
|
-
setScreen(SCREEN_NAMES.VERIFY_OTP_LOGIN_WITH_ABHA);
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
if (!selectedAbha) return;
|
|
300
|
-
setSelectedAbhaAddress(selectedAbha.abha_address);
|
|
301
|
-
|
|
302
|
-
console.log(abdmLoginVerifyApiStatus, "from abha" )
|
|
303
|
-
if (!txnId) {
|
|
304
|
-
trackAbhaEvent({
|
|
305
|
-
name: 'abha_login_select_abha_txnId_not_found',
|
|
306
|
-
data: {
|
|
307
|
-
platform: clientId,
|
|
308
|
-
reason: 'txnId missing',
|
|
309
|
-
reason_exists: true,
|
|
310
|
-
},
|
|
311
|
-
});
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
setAbdmLoginVerifyApiStatus(LOADING_STATE.LOADING);
|
|
316
|
-
|
|
317
|
-
trackAbhaEvent({
|
|
318
|
-
name: 'abha_login_select_abha_verify_start',
|
|
319
|
-
data: {
|
|
320
|
-
platform: clientId,
|
|
321
|
-
txn_id: txnId,
|
|
322
|
-
},
|
|
323
|
-
});
|
|
324
|
-
|
|
325
|
-
const {
|
|
326
|
-
error: abdmError,
|
|
327
|
-
eka,
|
|
328
|
-
profile,
|
|
329
|
-
action: errorAction,
|
|
330
|
-
skip_state,
|
|
331
|
-
} = await postAbdmProfileLoginPhr({
|
|
332
|
-
txn_id: txnId,
|
|
333
|
-
phr_address: selectedAbha.abha_address,
|
|
334
|
-
});
|
|
335
|
-
|
|
336
|
-
if (errorAction) {
|
|
337
|
-
trackAbhaEvent({
|
|
338
|
-
name: 'abha_login_select_abha_error_action',
|
|
339
|
-
data: {
|
|
340
|
-
platform: clientId,
|
|
341
|
-
txn_id: txnId,
|
|
342
|
-
action: errorAction?.cta?.title || 'unknown',
|
|
343
|
-
action_exists: !!errorAction?.cta?.title,
|
|
344
|
-
},
|
|
345
|
-
});
|
|
346
|
-
setBottomsheetErrorInfo(errorAction);
|
|
347
|
-
return;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
if (abdmError || !eka) {
|
|
351
|
-
trackAbhaEvent({
|
|
352
|
-
name: 'abha_login_select_abha_abdm_error',
|
|
353
|
-
data: {
|
|
354
|
-
platform: clientId,
|
|
355
|
-
txn_id: txnId,
|
|
356
|
-
error_message: abdmError || 'eka object missing',
|
|
357
|
-
error_exists: !!abdmError,
|
|
358
|
-
},
|
|
359
|
-
});
|
|
360
|
-
setAbdmLoginVerifyApiStatus(LOADING_STATE.REJECTED);
|
|
361
|
-
setError(abdmError);
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
if (!skip_state) {
|
|
366
|
-
setError('skip State is missing');
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
trackAbhaEvent({
|
|
371
|
-
name: 'abha_login_select_abha_verify_success',
|
|
372
|
-
data: {
|
|
373
|
-
platform: clientId,
|
|
374
|
-
txn_id: txnId,
|
|
375
|
-
skip_state: skip_state,
|
|
376
|
-
},
|
|
377
|
-
});
|
|
378
|
-
|
|
379
|
-
setAadhaarVerificationSkipStateStatus(skip_state);
|
|
380
|
-
|
|
381
|
-
if (profile) {
|
|
382
|
-
trackAbhaEvent({
|
|
383
|
-
name: 'abha_login_select_abha_profile_received',
|
|
384
|
-
data: {
|
|
385
|
-
platform: clientId,
|
|
386
|
-
},
|
|
387
|
-
});
|
|
388
|
-
|
|
389
|
-
setEkaProfileInfo({
|
|
390
|
-
date_of_birth: `${profile.year_of_birth}-${String(profile.month_of_birth).padStart(2, '0')}-${String(profile.day_of_birth).padStart(2, '0')}`,
|
|
391
|
-
firstname: profile.first_name as string,
|
|
392
|
-
lastname: profile.last_name as string,
|
|
393
|
-
pincode: profile.pincode as string,
|
|
394
|
-
gender: profile.gender as string,
|
|
395
|
-
name: (profile.first_name + ' ' + profile.last_name) as string,
|
|
396
|
-
mobile: profile.mobile,
|
|
397
|
-
oid: eka?.oid,
|
|
398
|
-
middlename: profile.middle_name as string,
|
|
399
|
-
abha_address: profile.abha_address,
|
|
400
|
-
abha_number: profile.abha_number,
|
|
401
|
-
});
|
|
402
|
-
setSelectedAbhaAddress(profile.abha_address);
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
// if the trigger is from inside the app(phr case)
|
|
406
|
-
// or if the trigger from the eka doc app, then return here
|
|
407
|
-
if (isEkaAppLogin) {
|
|
408
|
-
if (!eka.oid) {
|
|
409
|
-
trackAbhaEvent({
|
|
410
|
-
name: 'abha_login_select_abha_oid_null',
|
|
411
|
-
data: {
|
|
412
|
-
platform: clientId,
|
|
413
|
-
oid: eka?.oid ?? 'null_or_undefined',
|
|
414
|
-
},
|
|
415
|
-
});
|
|
416
|
-
setAbdmLoginVerifyApiStatus(LOADING_STATE.REJECTED);
|
|
417
|
-
return;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
const gender = validGenders.includes(profile?.gender as any)
|
|
421
|
-
? (profile?.gender as 'M' | 'F' | 'O' | 'U')
|
|
422
|
-
: undefined;
|
|
423
|
-
|
|
424
|
-
const authProfile: TProfileRecord = {
|
|
425
|
-
oid: eka?.oid || '',
|
|
426
|
-
fln: (profile?.first_name + ' ' + profile?.last_name) as string,
|
|
427
|
-
dob: `${profile?.year_of_birth}-${String(profile?.month_of_birth).padStart(2, '0')}-${String(profile?.day_of_birth).padStart(2, '0')}`,
|
|
428
|
-
gen: gender,
|
|
429
|
-
mobile: profile?.mobile,
|
|
430
|
-
at: '',
|
|
431
|
-
fn: profile?.first_name || '',
|
|
432
|
-
mn: profile?.middle_name || '',
|
|
433
|
-
ln: profile?.last_name || '',
|
|
434
|
-
'health-ids': profile?.abha_address ? [profile.abha_address] : undefined,
|
|
435
|
-
abha_number: profile?.abha_number || '',
|
|
436
|
-
};
|
|
437
|
-
const authResponse = getMockAuthVerifyResponse(authProfile);
|
|
438
|
-
setAbdmLoginVerifyApiStatus(LOADING_STATE.RESOLVED);
|
|
439
|
-
|
|
440
|
-
trackAbhaEvent({
|
|
441
|
-
name: 'abha_login_select_abha_inside_app_success',
|
|
442
|
-
data: {
|
|
443
|
-
platform: clientId,
|
|
444
|
-
oid: eka.oid,
|
|
445
|
-
},
|
|
446
|
-
});
|
|
447
|
-
|
|
448
|
-
// @ts-ignore
|
|
449
|
-
if (window.EkaAbha && window.EkaAbha.onAbhaSuccess) {
|
|
450
|
-
// @ts-ignore
|
|
451
|
-
window.EkaAbha?.onAbhaSuccess(JSON.stringify({ response: authResponse }));
|
|
452
|
-
return;
|
|
453
|
-
}
|
|
454
|
-
// @ts-ignore
|
|
455
|
-
onAbhaSuccess({ response: authResponse });
|
|
456
|
-
unMount();
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
if (!eka.min_token || !authTxnId) {
|
|
461
|
-
trackAbhaEvent({
|
|
462
|
-
name: 'abha_login_select_abha_min_token_missing',
|
|
463
|
-
data: {
|
|
464
|
-
platform: clientId,
|
|
465
|
-
oid: eka?.oid ?? 'missing_oid',
|
|
466
|
-
min_token: eka?.min_token ?? 'missing_min_token',
|
|
467
|
-
auth_txnId: authTxnId ?? 'missing_authTxnId',
|
|
468
|
-
},
|
|
469
|
-
});
|
|
470
|
-
setAbdmLoginVerifyApiStatus(LOADING_STATE.REJECTED);
|
|
471
|
-
setError(abdmError || 'Something went wrong. Please try again.');
|
|
472
|
-
return;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
const authVerifyResponse = await postAuthVerifyV2Mutate({
|
|
476
|
-
txn_id: authTxnId,
|
|
477
|
-
token: eka.min_token,
|
|
478
|
-
...(eka.oid ? { oid: eka.oid } : null),
|
|
479
|
-
});
|
|
480
|
-
|
|
481
|
-
if (!authVerifyResponse.data) {
|
|
482
|
-
trackAbhaEvent({
|
|
483
|
-
name: 'abha_login_select_abha_auth_verify_failed',
|
|
484
|
-
data: {
|
|
485
|
-
platform: clientId,
|
|
486
|
-
oid: eka?.oid ?? 'missing_oid',
|
|
487
|
-
min_token: eka?.min_token ?? 'missing_min_token',
|
|
488
|
-
auth_txnId: authTxnId ?? 'missing_authTxnId',
|
|
489
|
-
},
|
|
490
|
-
});
|
|
491
|
-
setAbdmLoginVerifyApiStatus(LOADING_STATE.REJECTED);
|
|
492
|
-
setError(authVerifyResponse.error?.message || 'Something went wrong, please try again');
|
|
493
|
-
return;
|
|
494
|
-
}
|
|
495
|
-
setAbdmLoginVerifyApiStatus(LOADING_STATE.RESOLVED);
|
|
496
|
-
|
|
497
|
-
trackAbhaEvent({
|
|
498
|
-
name: 'abha_login_select_abha_auth_verify_success',
|
|
499
|
-
data: {
|
|
500
|
-
platform: clientId,
|
|
501
|
-
oid: eka.oid,
|
|
502
|
-
min_token: eka?.min_token,
|
|
503
|
-
auth_txnId: authTxnId,
|
|
504
|
-
},
|
|
505
|
-
});
|
|
506
|
-
return;
|
|
507
|
-
};
|
|
508
|
-
|
|
509
|
-
const handleErrorBottomsheetButtonClick = () => {
|
|
510
|
-
const mobileNumber = useAuthAbhaStore.getState().initAbhaAppMobileNumber;
|
|
511
|
-
const isAppLogin = useAuthAbhaStore.getState().isEkaAppLogin;
|
|
512
|
-
goBackLoginScreen();
|
|
513
|
-
clearAbhaAuthStore();
|
|
514
|
-
useAuthAbhaStore.setState({ initAbhaAppMobileNumber: mobileNumber });
|
|
515
|
-
useAuthAbhaStore.setState({ isEkaAppLogin: isAppLogin });
|
|
516
|
-
};
|
|
517
|
-
|
|
518
|
-
return (
|
|
519
|
-
<div className="pds2-w-full pds2-flex pds2-flex-col pds2-h-full pds2-bg-bg-01">
|
|
520
|
-
<Pds2Header
|
|
521
|
-
title="Select ABHA to continue"
|
|
522
|
-
prefixIcon={
|
|
523
|
-
<button
|
|
524
|
-
className="pds2-w-24 pds2-h-24 pds2-rounded-full pds2-flex pds2-items-center pds2-justify-center ripple"
|
|
525
|
-
onClick={() => setIsExitPopupOpen(true)}
|
|
526
|
-
>
|
|
527
|
-
<ArrowLeftRegularIcon />
|
|
528
|
-
</button>
|
|
529
|
-
}
|
|
530
|
-
suffixIcon={
|
|
531
|
-
abhaAddressList?.[0]?.kyc_verified && <CircleInfoRegularIcon onClick={()=>setKycTooltipShow((prev)=>!prev)} className="pds2-w-20 pds2-h-20 pds2-text-icon-03 pds2-text-[2rem] hover:pds2-cursor-pointer" />
|
|
532
|
-
}
|
|
533
|
-
className="pds2-border-b pds2-border-bg-seperator-dark pds2-bg-bg-white"
|
|
534
|
-
/>
|
|
535
|
-
<AbhaStepper/>
|
|
536
|
-
{kycTooltipShow &&
|
|
537
|
-
<div
|
|
538
|
-
onMouseLeave={()=>setKycTooltipShow(false)}
|
|
539
|
-
className="pds2-absolute pds2-right-10 pds2-top-45 pds2-mt-2 pds2-z-50 pds2-animate-fade-in">
|
|
540
|
-
<TooltipContent />
|
|
541
|
-
</div>}
|
|
542
|
-
|
|
543
|
-
{/* Scrollable area: list + optional text */}
|
|
544
|
-
<div className="pds2-flex-1 pds2-overflow-y-auto pds2-flex pds2-flex-col pds2-p-16 pds2-space-y-16">
|
|
545
|
-
<div className="pds2-text-text-03 Body1Regular pds2-text-center">
|
|
546
|
-
We found {abhaAddressList?.length} ABHA addresses <br /> select one you want to log in
|
|
547
|
-
with
|
|
548
|
-
</div>
|
|
549
|
-
<AbhaList
|
|
550
|
-
list={abhaAddressList}
|
|
551
|
-
selectedAbha={selectedAbha}
|
|
552
|
-
setSelectedAbha={setSelectedAbha}
|
|
553
|
-
handleContinueClick={handleContinueClick}
|
|
554
|
-
/>
|
|
555
|
-
{(abhaAddressList?.length ?? 0) < 6 &&
|
|
556
|
-
(abhaAuthFlowMethod === ABHA_AUTH_FLOW_METHOD.MOBILE ||
|
|
557
|
-
abhaAuthFlowMethod === ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER) && (
|
|
558
|
-
<div className='pds2-flex pds2-flex-col pds2-gap-16'>
|
|
559
|
-
<TextSeparator title="or" />
|
|
560
|
-
<Pds2CustomButton
|
|
561
|
-
title="Create new ABHA Address"
|
|
562
|
-
prefixIcon={<PlusRegularIcon />}
|
|
563
|
-
className="pds2-justify-center pds2-text-text-brand pds2-bg-border-brand-02 pds2-border-border-03 Body1Semibold"
|
|
564
|
-
onClick={handleCreateABHAClick}
|
|
565
|
-
/>
|
|
566
|
-
</div>
|
|
567
|
-
)}
|
|
568
|
-
</div>
|
|
569
|
-
|
|
570
|
-
{/* ABHA number */}
|
|
571
|
-
{abhaAuthFlowMethod === ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER && <div className="pds2-text-center pds2-bg-bg-02 pds2-py-8">
|
|
572
|
-
<span className="pds2-text-text-03 Body2Regular">Your ABHA No: </span>
|
|
573
|
-
<span className="pds2-text-text-01 Body2Semibold">{ekaProfileInfo?.abha_number}</span>
|
|
574
|
-
</div>}
|
|
575
|
-
{/* Footer fixed at bottom */}
|
|
576
|
-
<div className="pds2-bg-bg-white pds2-shadow-lg pds2-w-full pds2-sticky pds2-bottom-0 pds2-border-border-brand-02 pds2-p-16 z-10">
|
|
577
|
-
{error && <div className="pds2-text-text-error pds2-text-center pds2-mb-4">{error}</div>}
|
|
578
|
-
<Pds2Button
|
|
579
|
-
title="Continue"
|
|
580
|
-
state={selectedAbha === null || abdmLoginVerifyApiStatus === LOADING_STATE.LOADING ? 'disabled' : 'enabled'}
|
|
581
|
-
isLoading={abdmLoginVerifyApiStatus === LOADING_STATE.LOADING}
|
|
582
|
-
className="pds2-w-full"
|
|
583
|
-
onClick={handleContinueClick}
|
|
584
|
-
/>
|
|
585
|
-
</div>
|
|
586
|
-
|
|
587
|
-
<AbhaErrorBottomSheet onSubmitClick={handleErrorBottomsheetButtonClick} />
|
|
588
|
-
<ExitPopup open={isExitPopupOpen} setOpen={setIsExitPopupOpen} />
|
|
589
|
-
</div>
|
|
590
|
-
);
|
|
591
|
-
};
|
|
592
|
-
|
|
593
|
-
export default SelectAbhaFromListScreen;
|
|
594
|
-
|
|
595
|
-
const AbhaList = ({
|
|
596
|
-
list,
|
|
597
|
-
selectedAbha,
|
|
598
|
-
setSelectedAbha,
|
|
599
|
-
handleContinueClick,
|
|
600
|
-
}: {
|
|
601
|
-
list: TAbhaAddress[] | null;
|
|
602
|
-
selectedAbha: TAbhaAddress | null;
|
|
603
|
-
setSelectedAbha: (abha: TAbhaAddress) => void;
|
|
604
|
-
handleContinueClick: () => Promise<void>;
|
|
605
|
-
}) => {
|
|
606
|
-
// const [tooltipAbhaId, setTooltipAbhaId] = useState<string | null>(null);
|
|
607
|
-
|
|
608
|
-
return (
|
|
609
|
-
<div className="pds2-bg-bg-white pds2-rounded-16 pds2-border pds2-border-border-brand-02 pds2-w-full pds2-relative">
|
|
610
|
-
{list?.map((abha, index) => (
|
|
611
|
-
<React.Fragment key={abha.abha_address}>
|
|
612
|
-
<label className="pds2-p-16 pds2-flex pds2-space-x-8">
|
|
613
|
-
<input
|
|
614
|
-
className="pds2-self-start pds2-mt-4 pds2-w-14 pds2-h-14 pds2-p-2 checked:pds2-accent-text-brand"
|
|
615
|
-
type="radio"
|
|
616
|
-
value={abha.abha_address}
|
|
617
|
-
checked={selectedAbha?.abha_address === abha.abha_address}
|
|
618
|
-
onChange={() => {
|
|
619
|
-
setSelectedAbha(abha);
|
|
620
|
-
}}
|
|
621
|
-
onKeyDown={(e)=>e.key==="Enter" && handleContinueClick()}
|
|
622
|
-
/>
|
|
623
|
-
<div className="pds2-flex pds2-flex-col pds2-space-y-4 pds2-flex-1">
|
|
624
|
-
<div className="TitlesSubheadline pds2-text-text-primary pds2-flex pds2-flex-row pds2-items-center pds2-justify-between">
|
|
625
|
-
<div>{abha?.abha_address}</div>
|
|
626
|
-
{/* {abha?.name && <div className="Body3Regular pds2-text-text-03">{abha.name}</div>} */}
|
|
627
|
-
<div
|
|
628
|
-
className="pds2-flex pds2-flex-row pds2-items-center"
|
|
629
|
-
// onClick={(e) => {
|
|
630
|
-
// e.preventDefault();
|
|
631
|
-
// setTooltipAbhaId(tooltipAbhaId === abha.oid ? null : abha.oid);
|
|
632
|
-
// }}
|
|
633
|
-
>
|
|
634
|
-
{abha?.kyc_verified && (
|
|
635
|
-
abha.kyc_verified === "VERIFIED" ? (
|
|
636
|
-
<div className="Label1Bold pds2-rounded-full pds2-h-full">
|
|
637
|
-
<CircleCheckSolidIcon className="pds2-w-16 pds2-h-16 pds2-text-icon-success-02 pds2-text-[2rem]" />
|
|
638
|
-
</div>
|
|
639
|
-
)
|
|
640
|
-
:(
|
|
641
|
-
<div className="Label1Bold pds2-rounded-full pds2-h-full">
|
|
642
|
-
<CircleExclamationSolidIcon className="pds2-w-16 pds2-h-16 pds2-text-icon-orange-300 pds2-text-[2rem]" />
|
|
643
|
-
</div>
|
|
644
|
-
)
|
|
645
|
-
)}
|
|
646
|
-
|
|
647
|
-
{/* {tooltipAbhaId === abha.oid && (
|
|
648
|
-
<div className="pds2-absolute pds2-right-0 pds2-top-full pds2-mt-2 pds2-z-50 pds2-animate-fade-in">
|
|
649
|
-
<TooltipContent />
|
|
650
|
-
</div>
|
|
651
|
-
)} */}
|
|
652
|
-
</div>
|
|
653
|
-
</div>
|
|
654
|
-
|
|
655
|
-
<div className="pds2-text-text-03 Body3Regular pds2-flex pds2-flex-row pds2-items-center pds2-gap-x-4">
|
|
656
|
-
{abha?.name && <div className="Body3Regular pds2-text-text-03">{abha.name}</div>}
|
|
657
|
-
{/* {abha?.eka_username ? (
|
|
658
|
-
<>
|
|
659
|
-
<EkaIcon className="pds2-w-12 pds2-h-12" />
|
|
660
|
-
<span>
|
|
661
|
-
{abha?.eka_username} ({abha?.age} • {abha?.gender})
|
|
662
|
-
</span>
|
|
663
|
-
</>
|
|
664
|
-
) : (
|
|
665
|
-
<span>No Eka profile found</span>
|
|
666
|
-
)} */}
|
|
667
|
-
</div>
|
|
668
|
-
</div>
|
|
669
|
-
</label>
|
|
670
|
-
{index !== list.length - 1 && (
|
|
671
|
-
<div className="pds2-px-16">
|
|
672
|
-
<div className="pds2-bg-border-03 pds2-h-1 pds2-w-full"></div>
|
|
673
|
-
</div>
|
|
674
|
-
)}
|
|
675
|
-
</React.Fragment>
|
|
676
|
-
))}
|
|
677
|
-
</div>
|
|
678
|
-
);
|
|
679
|
-
};
|
|
680
|
-
|
|
681
|
-
const TooltipContent = () => {
|
|
682
|
-
return (
|
|
683
|
-
<div className="pds2-flex pds2-flex-col pds2-py-14 pds2-bg-bg-purple-800 pds2-rounded-16 pds2-w-150 pds2-animate-slide-up">
|
|
684
|
-
<div className=" pds2-px-16 pds2-flex pds2-flex-row pds2-items-center pds2-gap-x-8 pds2-py-6">
|
|
685
|
-
<div className="pds2-bg-bg-white pds2-rounded-full">
|
|
686
|
-
<CircleExclamationSolidIcon className="pds2-w-16 pds2-h-16 pds2-text-icon-orange-400" />
|
|
687
|
-
</div>
|
|
688
|
-
<div className="pds2-text-text-invert">Non KYC</div>
|
|
689
|
-
</div>
|
|
690
|
-
<div className=" pds2-px-16 pds2-flex pds2-flex-row pds2-items-center pds2-gap-x-8 pds2-py-6 pds2-border-t-1 pds2-border-[#FFFFFF4D]" >
|
|
691
|
-
<div className="pds2-bg-bg-white pds2-rounded-full">
|
|
692
|
-
<CircleCheckSolidIcon className="pds2-w-16 pds2-h-16 pds2-text-icon-success-02" />
|
|
693
|
-
</div>
|
|
694
|
-
<div className="pds2-text-text-invert">KYC</div>
|
|
695
|
-
</div>
|
|
696
|
-
</div>
|
|
697
|
-
);
|
|
698
|
-
};
|
|
699
|
-
|
|
700
|
-
// const LinkThisAbhaAddressBottomSheet = ({
|
|
701
|
-
// abha_address,
|
|
702
|
-
// isOpen,
|
|
703
|
-
// setIsOpen,
|
|
704
|
-
// }: {
|
|
705
|
-
// abha_address: string;
|
|
706
|
-
// isOpen: boolean;
|
|
707
|
-
// setIsOpen: (open: boolean) => void;
|
|
708
|
-
// }) => {
|
|
709
|
-
// // TODO: fetch these from the apis.
|
|
710
|
-
// const dummyEkaProfiles = [
|
|
711
|
-
// { id: '1', name: 'Eka Profile 1' },
|
|
712
|
-
// { id: '2', name: 'Eka Profile 2' },
|
|
713
|
-
// { id: '3', name: 'Eka Profile 3' },
|
|
714
|
-
// ];
|
|
715
|
-
// const [selectedProfile, setSelectedProfile] = useState<string | null>(null);
|
|
716
|
-
// const setScreen = useAuthAbhaStore((state) => state.setScreen);
|
|
717
|
-
|
|
718
|
-
// const handleCreateFamilyClick = () => {
|
|
719
|
-
// setScreen(SCREEN_NAMES.CREATE_EKA_PROFILE);
|
|
720
|
-
// };
|
|
721
|
-
|
|
722
|
-
// return (
|
|
723
|
-
// <BottomSheetWrapper isOpen={isOpen} setIsOpen={setIsOpen} shouldCloseOnClickOutside={true}>
|
|
724
|
-
// <div className="pds2-flex pds2-flex-col pds2-items-center pds2-p-16">
|
|
725
|
-
// <div className="pds2-flex pds2-justify-end pds2-items-center pds2-w-full">
|
|
726
|
-
// <button className="pds2-w-24 pds2-h-24 pds2-rounded-full pds2-flex pds2-items-center pds2-justify-center ripple">
|
|
727
|
-
// <XMarkRegularIcon
|
|
728
|
-
// onClick={() => setIsOpen(false)}
|
|
729
|
-
// className="pds2-w-18 pds2-h-18 pds2-text-text-03"
|
|
730
|
-
// />
|
|
731
|
-
// </button>
|
|
732
|
-
// </div>
|
|
733
|
-
// <div className="pds2-space-y-16 pds2-flex pds2-flex-col pds2-items-center pds2-text-center">
|
|
734
|
-
// <img src="/images/link-abha.webp" alt="Link ABHA" className="pds2-w-163" />
|
|
735
|
-
// <div className="pds2-space-y-4">
|
|
736
|
-
// <div className="pds2-text-text-01 Heading3Semibold">Link this ABHA Address</div>
|
|
737
|
-
// <div className="">
|
|
738
|
-
// <span className="Body1Medium pds2-text-text-01">{abha_address}</span>
|
|
739
|
-
// <span className="Body2Regular pds2-text-text-03">
|
|
740
|
-
// {' '}
|
|
741
|
-
// is not linked with any family member on Eka Care
|
|
742
|
-
// </span>
|
|
743
|
-
// </div>
|
|
744
|
-
// </div>
|
|
745
|
-
// </div>
|
|
746
|
-
// <div className="pds2-py-32 pds2-w-full pds2-flex pds2-flex-col pds2-justify-center pds2-space-y-12">
|
|
747
|
-
// <div className="pds2-text-text-03 Body2Medium pds2-text-center">Select Eka Profile</div>
|
|
748
|
-
// {dummyEkaProfiles.map((profile) => {
|
|
749
|
-
// const isSelected = selectedProfile === profile.id;
|
|
750
|
-
// return (
|
|
751
|
-
// <label
|
|
752
|
-
// key={profile.id}
|
|
753
|
-
// className={`pds2-flex pds2-items-center pds2-cursor-pointer pds2-p-16 pds2-rounded-16 pds2-bg-bg-01
|
|
754
|
-
// ${
|
|
755
|
-
// isSelected
|
|
756
|
-
// ? 'pds2-border-2 pds2-border-border-brand-01 pds2-bg-bg-brand-02'
|
|
757
|
-
// : 'pds2-border-1 pds2-border-border-03'
|
|
758
|
-
// }
|
|
759
|
-
// focus-within:pds2-ring-2 focus-within:pds2-ring-border-brand-01 focus-within:pds2-ring-offset-2
|
|
760
|
-
// active:pds2-bg-bg-brand-02 hover:pds2-bg-bg-hover-01
|
|
761
|
-
// pds2-transition-colors pds2-duration-200
|
|
762
|
-
// `}
|
|
763
|
-
// >
|
|
764
|
-
// <input
|
|
765
|
-
// type="radio"
|
|
766
|
-
// name="ekaProfile"
|
|
767
|
-
// value={profile.id}
|
|
768
|
-
// checked={isSelected}
|
|
769
|
-
// onChange={() => setSelectedProfile(profile.id)}
|
|
770
|
-
// className="focus:pds2-outline-none pds2-appearance-none"
|
|
771
|
-
// />
|
|
772
|
-
// <div className="pds2-flex pds2-flex-row pds2-items-center pds2-gap-x-8 pds2-flex-1">
|
|
773
|
-
// <ProfileIcon className="pds2-w-32 pds2-h-32" />
|
|
774
|
-
// <div className="TitlesSubheadline pds2-text-text-primary">{profile.name}</div>
|
|
775
|
-
// <ChevronDownRegularIcon className="pds2-ml-auto pds2-w-14 pds2-h-14 pds2-text-text-03 -pds2-rotate-90" />
|
|
776
|
-
// </div>
|
|
777
|
-
// </label>
|
|
778
|
-
// );
|
|
779
|
-
// })}
|
|
780
|
-
// </div>
|
|
781
|
-
// <div className="pds2-w-full pds2-pt-16 pds2-bg-bg-white pds2-sticky pds2-bottom-0">
|
|
782
|
-
// <Pds2CustomButton
|
|
783
|
-
// title="Create New Family Member"
|
|
784
|
-
// prefixIcon={<PlusRegularIcon />}
|
|
785
|
-
// className="pds2-justify-center pds2-text-text-brand Body1Semibold pds2-bg-border-brand-02 pds2-border-none"
|
|
786
|
-
// onClick={handleCreateFamilyClick}
|
|
787
|
-
// />
|
|
788
|
-
// </div>
|
|
789
|
-
// </div>
|
|
790
|
-
// </BottomSheetWrapper>
|
|
791
|
-
// );
|
|
792
|
-
// };
|