@redneckz/wildless-cms-uni-blocks 0.14.607 → 0.14.609
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/bundle/api/RetailAPI/updateUserProfile.d.ts +2 -0
- package/bundle/bundle.umd.js +101 -29
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/bundle/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/bundle/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/bundle/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/dist/api/RetailAPI/updateUserProfile.d.ts +2 -0
- package/dist/api/RetailAPI/updateUserProfile.js +1 -1
- package/dist/api/RetailAPI/updateUserProfile.js.map +1 -1
- package/dist/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
- package/dist/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
- package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +44 -0
- package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
- package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +49 -0
- package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
- package/dist/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/dist/ui-kit/DialogManager/openDocument.js +11 -0
- package/dist/ui-kit/DialogManager/openDocument.js.map +1 -0
- package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/lib/api/RetailAPI/updateUserProfile.d.ts +2 -0
- package/lib/api/RetailAPI/updateUserProfile.js +1 -1
- package/lib/api/RetailAPI/updateUserProfile.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
- package/lib/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.fixture.d.ts +6 -0
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +42 -0
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
- package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +46 -0
- package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
- package/lib/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/lib/ui-kit/DialogManager/openDocument.js +8 -0
- package/lib/ui-kit/DialogManager/openDocument.js.map +1 -0
- package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/bundle/api/RetailAPI/updateUserProfile.d.ts +2 -0
- package/mobile/bundle/bundle.umd.js +101 -29
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/mobile/bundle/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/mobile/bundle/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/mobile/bundle/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/mobile/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/mobile/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/mobile/dist/api/RetailAPI/updateUserProfile.d.ts +2 -0
- package/mobile/dist/api/RetailAPI/updateUserProfile.js +1 -1
- package/mobile/dist/api/RetailAPI/updateUserProfile.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
- package/mobile/dist/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
- package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +44 -0
- package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
- package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +49 -0
- package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
- package/mobile/dist/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/mobile/dist/ui-kit/DialogManager/openDocument.js +11 -0
- package/mobile/dist/ui-kit/DialogManager/openDocument.js.map +1 -0
- package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/lib/api/RetailAPI/updateUserProfile.d.ts +2 -0
- package/mobile/lib/api/RetailAPI/updateUserProfile.js +1 -1
- package/mobile/lib/api/RetailAPI/updateUserProfile.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
- package/mobile/lib/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
- package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +42 -0
- package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
- package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +46 -0
- package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
- package/mobile/lib/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/mobile/lib/ui-kit/DialogManager/openDocument.js +8 -0
- package/mobile/lib/ui-kit/DialogManager/openDocument.js.map +1 -0
- package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/src/api/RetailAPI/updateUserProfile.ts +3 -1
- package/mobile/src/components/ApplicationLeadForm/GroupedConsents.tsx +1 -1
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +12 -7
- package/mobile/src/ui-kit/Checkbox/CheckboxWithDoc.tsx +2 -16
- package/mobile/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +73 -0
- package/mobile/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +58 -0
- package/mobile/src/ui-kit/DialogManager/openDocument.tsx +13 -0
- package/mobile/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -1
- package/mobile/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.tsx +4 -4
- package/mobile/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +2 -2
- package/package.json +1 -1
- package/src/api/RetailAPI/updateUserProfile.ts +3 -1
- package/src/components/ApplicationLeadForm/GroupedConsents.tsx +1 -1
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +12 -7
- package/src/ui-kit/Checkbox/CheckboxWithDoc.tsx +2 -16
- package/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.fixture.tsx +7 -0
- package/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +73 -0
- package/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +58 -0
- package/src/ui-kit/DialogManager/openDocument.tsx +13 -0
- package/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -1
- package/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.tsx +4 -4
- package/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +2 -2
|
@@ -6,6 +6,7 @@ import { updateUserTask } from '../../api/RetailAPI/updateUserTask';
|
|
|
6
6
|
import { getUpdateUserProfileData } from '../../api/RetailAPI/utils/getUpdateUserProfile';
|
|
7
7
|
import { getUpdateUserTaskData } from '../../api/RetailAPI/utils/getUpdateUserTask';
|
|
8
8
|
import { useLocalStorage } from '../../hooks/useLocalStorage';
|
|
9
|
+
import { useConsentBkiDialog } from '../../ui-kit/ConsentBkiDialog/useConsentBkiDialog';
|
|
9
10
|
import { getObjectValidator } from '../../ui-kit/FormField/getObjectValidator';
|
|
10
11
|
import { useVerifyPhoneDialog } from '../../ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog';
|
|
11
12
|
import { formatPhone } from '../../utils/formatPhone';
|
|
@@ -26,6 +27,8 @@ export const useApplicationLeadApi = ({ inputs, programId, saveForm }: Applicati
|
|
|
26
27
|
const [, setTaskId] = useLocalStorage<number>('taskId');
|
|
27
28
|
const [, setProfileId] = useLocalStorage<number>('profileId');
|
|
28
29
|
const [, setParticipantId] = useLocalStorage<number>('participantId');
|
|
30
|
+
const consentBkiDialog = useConsentBkiDialog();
|
|
31
|
+
const verifyPhoneDialog = useVerifyPhoneDialog();
|
|
29
32
|
|
|
30
33
|
const saveUserData = useCallback((participantId: number, taskId: number, profileId: number) => {
|
|
31
34
|
setParticipantId(participantId);
|
|
@@ -67,22 +70,24 @@ export const useApplicationLeadApi = ({ inputs, programId, saveForm }: Applicati
|
|
|
67
70
|
);
|
|
68
71
|
saveUserData(participantId, taskId, profileId);
|
|
69
72
|
saveForm(JSON.stringify(formData));
|
|
70
|
-
globalThis.location.href = '/credit-lead';
|
|
71
73
|
} catch {
|
|
72
74
|
setResponseStatus('Fail');
|
|
73
75
|
}
|
|
74
76
|
};
|
|
75
77
|
|
|
78
|
+
const handleCloseVerify = async () => {
|
|
79
|
+
await handleSuccessVerify();
|
|
80
|
+
consentBkiDialog.open(formData.phone, profileId);
|
|
81
|
+
};
|
|
82
|
+
|
|
76
83
|
const acceptedConsents: string[] = Object.keys(CONSENTS)
|
|
77
84
|
.filter((_) => formData[_])
|
|
78
85
|
.map((_) => CONSENTS[_]?.text);
|
|
79
86
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
});
|
|
85
|
-
verifyPhoneDialog.open();
|
|
87
|
+
verifyPhoneDialog.open(
|
|
88
|
+
handleCloseVerify,
|
|
89
|
+
verifyPhoneContent(formData?.phone, acceptedConsents),
|
|
90
|
+
);
|
|
86
91
|
}
|
|
87
92
|
} catch {
|
|
88
93
|
setResponseStatus('Fail');
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
3
|
-
import { Dialog } from '../DialogManager/Dialog';
|
|
2
|
+
import { openDocument } from '../DialogManager/openDocument';
|
|
4
3
|
import { useDialogManager } from '../DialogManager/useDialogManager';
|
|
5
4
|
import { renderErrorText } from '../Input/renderErrorText';
|
|
6
5
|
import { LinkButton } from '../LinkButton/LinkButton';
|
|
7
6
|
import { Text } from '../Text/Text';
|
|
8
7
|
import { Checkbox } from './Checkbox';
|
|
9
8
|
import { type CheckboxProps } from './CheckboxProps';
|
|
10
|
-
import { getDocument } from './getDocument';
|
|
11
9
|
|
|
12
10
|
const OPEN_DOC_BUTTON_TEXT = 'Ознакомиться';
|
|
13
11
|
|
|
@@ -24,10 +22,7 @@ export const CheckboxWithDoc = JSX<CheckboxWithDocProps>(
|
|
|
24
22
|
<div className="flex flex-wrap gap-x-m">
|
|
25
23
|
<Checkbox {...props} />
|
|
26
24
|
{docId ? (
|
|
27
|
-
<LinkButton
|
|
28
|
-
className="text-primary-main"
|
|
29
|
-
onClick={() => handleOpenDocument(docId, open)}
|
|
30
|
-
>
|
|
25
|
+
<LinkButton className="text-primary-main" onClick={() => openDocument(docId, open)}>
|
|
31
26
|
<Text>{OPEN_DOC_BUTTON_TEXT}</Text>
|
|
32
27
|
</LinkButton>
|
|
33
28
|
) : null}
|
|
@@ -37,12 +32,3 @@ export const CheckboxWithDoc = JSX<CheckboxWithDocProps>(
|
|
|
37
32
|
);
|
|
38
33
|
},
|
|
39
34
|
);
|
|
40
|
-
|
|
41
|
-
const handleOpenDocument = async (id: number, open: (dialog: VNode) => void) => {
|
|
42
|
-
const document = await getDocument(id);
|
|
43
|
-
open(
|
|
44
|
-
<Dialog className="my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0">
|
|
45
|
-
<iframe src={`${document}#toolbar=0`} className="w-full h-[80vh]" id="iframe-dialog" />
|
|
46
|
-
</Dialog>,
|
|
47
|
-
);
|
|
48
|
-
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { noop } from '../../utils/noop';
|
|
4
|
+
import { Button } from '../Button/Button';
|
|
5
|
+
import { Dialog } from '../DialogManager/Dialog';
|
|
6
|
+
import { openDocument } from '../DialogManager/openDocument';
|
|
7
|
+
import { useDialogManager } from '../DialogManager/useDialogManager';
|
|
8
|
+
import { Heading } from '../Heading/Heading';
|
|
9
|
+
import { Paragraph } from '../Paragraph/Paragraph';
|
|
10
|
+
import { RadioButtonGroup } from '../RadioButtonGroup/RadioButtonGroup';
|
|
11
|
+
export interface ConsentBkiDialogProps {
|
|
12
|
+
handleSubmit?: (confirmStatus: string) => void;
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const defaultConsentText = {
|
|
17
|
+
title: 'Подпишите согласие на запрос в БКИ',
|
|
18
|
+
description: 'Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const refuseConsentText = {
|
|
22
|
+
title: 'Вы уверены, что хотите отказаться от запроса в БКИ',
|
|
23
|
+
description: 'Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const ConsentBkiDialog = JSX<ConsentBkiDialogProps>(function ({
|
|
27
|
+
handleSubmit = noop,
|
|
28
|
+
onClose = noop,
|
|
29
|
+
}) {
|
|
30
|
+
const [confirmStatus, setConfirmStatus] = useState('');
|
|
31
|
+
const [showRefuceContent, setShowRefuceContent] = useState(false);
|
|
32
|
+
const { open, close } = useDialogManager();
|
|
33
|
+
const handleClose = useCallback(() => {
|
|
34
|
+
close();
|
|
35
|
+
handleSubmit(confirmStatus);
|
|
36
|
+
}, [confirmStatus]);
|
|
37
|
+
|
|
38
|
+
const handleConfirmChange = useCallback((value: string) => {
|
|
39
|
+
setConfirmStatus(value);
|
|
40
|
+
if (value === 'REFUSE') {
|
|
41
|
+
setShowRefuceContent(true);
|
|
42
|
+
}
|
|
43
|
+
}, []);
|
|
44
|
+
const consentText = showRefuceContent ? refuseConsentText : defaultConsentText;
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<Dialog className="my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg" onClose={onClose}>
|
|
48
|
+
<div className="flex flex-col gap-lg items-center">
|
|
49
|
+
<div role="button" onClick={() => openDocument(CONSENT_BKI_ID, open)}>
|
|
50
|
+
<Heading className="text-center text-balance" title={consentText.title} />
|
|
51
|
+
</div>
|
|
52
|
+
<Paragraph align="text-center">{consentText.description}</Paragraph>
|
|
53
|
+
<RadioButtonGroup
|
|
54
|
+
className="whitespace-normal"
|
|
55
|
+
orientation="horizontal"
|
|
56
|
+
items={ITEMS}
|
|
57
|
+
value={confirmStatus}
|
|
58
|
+
onChange={handleConfirmChange}
|
|
59
|
+
/>
|
|
60
|
+
<Button disabled={!confirmStatus} type="button" onClick={handleClose}>
|
|
61
|
+
Продолжить
|
|
62
|
+
</Button>
|
|
63
|
+
</div>
|
|
64
|
+
</Dialog>
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const ITEMS = [
|
|
69
|
+
{ id: 'SIGNED', text: 'Подписать' },
|
|
70
|
+
{ id: 'REFUSE', text: 'Отказаться' },
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
const CONSENT_BKI_ID = 2;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { updateUserProfile } from '../../api/RetailAPI/updateUserProfile';
|
|
2
|
+
import { formatPhone } from '../../utils/formatPhone';
|
|
3
|
+
import { useDialogManager } from '../DialogManager/useDialogManager';
|
|
4
|
+
import { useVerifyPhoneDialog } from '../VerifyPhoneDialog/useVerifyPhoneDialog';
|
|
5
|
+
import { ConsentBkiDialog } from './ConsentBkiDialog';
|
|
6
|
+
|
|
7
|
+
export const useConsentBkiDialog = () => {
|
|
8
|
+
const { open, closeAll } = useDialogManager();
|
|
9
|
+
const verifyPhoneDialog = useVerifyPhoneDialog();
|
|
10
|
+
|
|
11
|
+
const redirectToCreditForm = () => {
|
|
12
|
+
globalThis.location.href = '/credit-lead';
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const handleSuccessVerify = (profileId?: number) => async (smsCode?: string) => {
|
|
16
|
+
if (profileId) {
|
|
17
|
+
await updateUserProfile({
|
|
18
|
+
profile: {
|
|
19
|
+
id: profileId,
|
|
20
|
+
consentBkiFlg: true,
|
|
21
|
+
smsConsentBki: smsCode,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
redirectToCreditForm();
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const handleSubmitBkiConstent =
|
|
30
|
+
(phone?: string, profileId?: number) => async (confirmStatus: string) => {
|
|
31
|
+
await closeAll();
|
|
32
|
+
|
|
33
|
+
if (confirmStatus === 'SIGNED' && phone) {
|
|
34
|
+
verifyPhoneDialog.open(handleSuccessVerify(profileId), verifyPhoneContent(phone));
|
|
35
|
+
} else {
|
|
36
|
+
redirectToCreditForm();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
open: (phone?: string, profileId?: number) =>
|
|
42
|
+
open(
|
|
43
|
+
<ConsentBkiDialog
|
|
44
|
+
handleSubmit={handleSubmitBkiConstent(phone, profileId)}
|
|
45
|
+
onClose={redirectToCreditForm}
|
|
46
|
+
/>,
|
|
47
|
+
),
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const verifyPhoneContent = (phone: string) => ({
|
|
52
|
+
title: 'Подтвердите номер телефона',
|
|
53
|
+
description: `Мы отправили код на ${phone}`,
|
|
54
|
+
phoneNumber: formatPhone(phone),
|
|
55
|
+
textButton: 'Отправить',
|
|
56
|
+
__html: `<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>
|
|
57
|
+
<ul><li>согласие на запрос информации в БКИ</li></ul>`,
|
|
58
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type VNode } from '../../model/VNode';
|
|
2
|
+
import { getDocument } from '../Checkbox/getDocument';
|
|
3
|
+
import { Dialog } from './Dialog';
|
|
4
|
+
|
|
5
|
+
export const openDocument = async (id: number, open: (dialog: VNode) => void) => {
|
|
6
|
+
const document = await getDocument(id);
|
|
7
|
+
|
|
8
|
+
open(
|
|
9
|
+
<Dialog className="my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0">
|
|
10
|
+
<iframe src={`${document}#toolbar=0`} className="w-full h-[80vh]" id="iframe-dialog" />
|
|
11
|
+
</Dialog>,
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -14,7 +14,7 @@ import { SubmitButton } from './SubmitButton';
|
|
|
14
14
|
import { useVerifyPhoneDialogSubmit } from './useVerifyPhoneDialogSubmit';
|
|
15
15
|
|
|
16
16
|
export interface VerifyPhoneDialogProps {
|
|
17
|
-
close?: () => void;
|
|
17
|
+
close?: (smsCode?: string) => void;
|
|
18
18
|
onClose?: () => void;
|
|
19
19
|
title?: string;
|
|
20
20
|
description?: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useDialogManager
|
|
1
|
+
import { useDialogManager } from '../DialogManager/useDialogManager';
|
|
2
2
|
import { VerifyPhoneDialog, type VerifyPhoneDialogProps } from './VerifyPhoneDialog';
|
|
3
3
|
|
|
4
|
-
export const useVerifyPhoneDialog = (
|
|
4
|
+
export const useVerifyPhoneDialog = () => {
|
|
5
5
|
const { open, close } = useDialogManager();
|
|
6
6
|
|
|
7
7
|
return {
|
|
8
|
-
open: (
|
|
9
|
-
open(<VerifyPhoneDialog onClose={close} {...props}
|
|
8
|
+
open: (handleClose: () => void, props: VerifyPhoneDialogProps) =>
|
|
9
|
+
open(<VerifyPhoneDialog onClose={close} close={handleClose} {...props} />),
|
|
10
10
|
close,
|
|
11
11
|
};
|
|
12
12
|
};
|
|
@@ -3,7 +3,7 @@ import { checkCode } from '../../api/RetailAPI/checkCode';
|
|
|
3
3
|
|
|
4
4
|
type useVerifyPhoneDialogSubmitProps = {
|
|
5
5
|
values: string[];
|
|
6
|
-
close?: () => void;
|
|
6
|
+
close?: (smsCode?: string) => void;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export const useVerifyPhoneDialogSubmit = ({ close, values }: useVerifyPhoneDialogSubmitProps) => {
|
|
@@ -40,7 +40,7 @@ export const useVerifyPhoneDialogSubmit = ({ close, values }: useVerifyPhoneDial
|
|
|
40
40
|
smsCodesSetName: { key: 'AUTHENTICATION' },
|
|
41
41
|
});
|
|
42
42
|
resetError();
|
|
43
|
-
close && close();
|
|
43
|
+
close && close(values.join(''));
|
|
44
44
|
} catch {
|
|
45
45
|
setIsLoading(false);
|
|
46
46
|
attemps > 1 ? setErrorText('Исчерпан лимит ввода смс-кода') : setErrorText('Неверный код');
|
package/package.json
CHANGED
|
@@ -17,8 +17,10 @@ export type UpdateUserProfileBody = {
|
|
|
17
17
|
consentAssignmentClaimsFlg?: boolean;
|
|
18
18
|
consentCollectionFlg?: boolean;
|
|
19
19
|
consentInformFlg?: boolean;
|
|
20
|
+
consentBkiFlg?: boolean;
|
|
21
|
+
smsConsentBki?: string;
|
|
20
22
|
};
|
|
21
23
|
};
|
|
22
24
|
|
|
23
25
|
export const updateUserProfile = (body: UpdateUserProfileBody) =>
|
|
24
|
-
doRequest<CreateUserProfileResponse>('/user-data/updateUserProfile', '
|
|
26
|
+
doRequest<CreateUserProfileResponse>('/user-data/updateUserProfile', 'PUT', body);
|
|
@@ -68,7 +68,7 @@ const renderGeneralCheckbox =
|
|
|
68
68
|
(
|
|
69
69
|
<div className="flex items-start">
|
|
70
70
|
{generalCheckBox}
|
|
71
|
-
<button onClick={foldableData.onToggle} className="px-m py-2xs">
|
|
71
|
+
<button onClick={foldableData.onToggle} className="px-m py-2xs" type="button">
|
|
72
72
|
<Icon
|
|
73
73
|
className="text-primary-text"
|
|
74
74
|
name={foldableData.isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon'}
|
|
@@ -6,6 +6,7 @@ import { updateUserTask } from '../../api/RetailAPI/updateUserTask';
|
|
|
6
6
|
import { getUpdateUserProfileData } from '../../api/RetailAPI/utils/getUpdateUserProfile';
|
|
7
7
|
import { getUpdateUserTaskData } from '../../api/RetailAPI/utils/getUpdateUserTask';
|
|
8
8
|
import { useLocalStorage } from '../../hooks/useLocalStorage';
|
|
9
|
+
import { useConsentBkiDialog } from '../../ui-kit/ConsentBkiDialog/useConsentBkiDialog';
|
|
9
10
|
import { getObjectValidator } from '../../ui-kit/FormField/getObjectValidator';
|
|
10
11
|
import { useVerifyPhoneDialog } from '../../ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog';
|
|
11
12
|
import { formatPhone } from '../../utils/formatPhone';
|
|
@@ -26,6 +27,8 @@ export const useApplicationLeadApi = ({ inputs, programId, saveForm }: Applicati
|
|
|
26
27
|
const [, setTaskId] = useLocalStorage<number>('taskId');
|
|
27
28
|
const [, setProfileId] = useLocalStorage<number>('profileId');
|
|
28
29
|
const [, setParticipantId] = useLocalStorage<number>('participantId');
|
|
30
|
+
const consentBkiDialog = useConsentBkiDialog();
|
|
31
|
+
const verifyPhoneDialog = useVerifyPhoneDialog();
|
|
29
32
|
|
|
30
33
|
const saveUserData = useCallback((participantId: number, taskId: number, profileId: number) => {
|
|
31
34
|
setParticipantId(participantId);
|
|
@@ -67,22 +70,24 @@ export const useApplicationLeadApi = ({ inputs, programId, saveForm }: Applicati
|
|
|
67
70
|
);
|
|
68
71
|
saveUserData(participantId, taskId, profileId);
|
|
69
72
|
saveForm(JSON.stringify(formData));
|
|
70
|
-
globalThis.location.href = '/credit-lead';
|
|
71
73
|
} catch {
|
|
72
74
|
setResponseStatus('Fail');
|
|
73
75
|
}
|
|
74
76
|
};
|
|
75
77
|
|
|
78
|
+
const handleCloseVerify = async () => {
|
|
79
|
+
await handleSuccessVerify();
|
|
80
|
+
consentBkiDialog.open(formData.phone, profileId);
|
|
81
|
+
};
|
|
82
|
+
|
|
76
83
|
const acceptedConsents: string[] = Object.keys(CONSENTS)
|
|
77
84
|
.filter((_) => formData[_])
|
|
78
85
|
.map((_) => CONSENTS[_]?.text);
|
|
79
86
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
});
|
|
85
|
-
verifyPhoneDialog.open();
|
|
87
|
+
verifyPhoneDialog.open(
|
|
88
|
+
handleCloseVerify,
|
|
89
|
+
verifyPhoneContent(formData?.phone, acceptedConsents),
|
|
90
|
+
);
|
|
86
91
|
}
|
|
87
92
|
} catch {
|
|
88
93
|
setResponseStatus('Fail');
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
3
|
-
import { Dialog } from '../DialogManager/Dialog';
|
|
2
|
+
import { openDocument } from '../DialogManager/openDocument';
|
|
4
3
|
import { useDialogManager } from '../DialogManager/useDialogManager';
|
|
5
4
|
import { renderErrorText } from '../Input/renderErrorText';
|
|
6
5
|
import { LinkButton } from '../LinkButton/LinkButton';
|
|
7
6
|
import { Text } from '../Text/Text';
|
|
8
7
|
import { Checkbox } from './Checkbox';
|
|
9
8
|
import { type CheckboxProps } from './CheckboxProps';
|
|
10
|
-
import { getDocument } from './getDocument';
|
|
11
9
|
|
|
12
10
|
const OPEN_DOC_BUTTON_TEXT = 'Ознакомиться';
|
|
13
11
|
|
|
@@ -24,10 +22,7 @@ export const CheckboxWithDoc = JSX<CheckboxWithDocProps>(
|
|
|
24
22
|
<div className="flex flex-wrap gap-x-m">
|
|
25
23
|
<Checkbox {...props} />
|
|
26
24
|
{docId ? (
|
|
27
|
-
<LinkButton
|
|
28
|
-
className="text-primary-main"
|
|
29
|
-
onClick={() => handleOpenDocument(docId, open)}
|
|
30
|
-
>
|
|
25
|
+
<LinkButton className="text-primary-main" onClick={() => openDocument(docId, open)}>
|
|
31
26
|
<Text>{OPEN_DOC_BUTTON_TEXT}</Text>
|
|
32
27
|
</LinkButton>
|
|
33
28
|
) : null}
|
|
@@ -37,12 +32,3 @@ export const CheckboxWithDoc = JSX<CheckboxWithDocProps>(
|
|
|
37
32
|
);
|
|
38
33
|
},
|
|
39
34
|
);
|
|
40
|
-
|
|
41
|
-
const handleOpenDocument = async (id: number, open: (dialog: VNode) => void) => {
|
|
42
|
-
const document = await getDocument(id);
|
|
43
|
-
open(
|
|
44
|
-
<Dialog className="my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0">
|
|
45
|
-
<iframe src={`${document}#toolbar=0`} className="w-full h-[80vh]" id="iframe-dialog" />
|
|
46
|
-
</Dialog>,
|
|
47
|
-
);
|
|
48
|
-
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { noop } from '../../utils/noop';
|
|
4
|
+
import { Button } from '../Button/Button';
|
|
5
|
+
import { Dialog } from '../DialogManager/Dialog';
|
|
6
|
+
import { openDocument } from '../DialogManager/openDocument';
|
|
7
|
+
import { useDialogManager } from '../DialogManager/useDialogManager';
|
|
8
|
+
import { Heading } from '../Heading/Heading';
|
|
9
|
+
import { Paragraph } from '../Paragraph/Paragraph';
|
|
10
|
+
import { RadioButtonGroup } from '../RadioButtonGroup/RadioButtonGroup';
|
|
11
|
+
export interface ConsentBkiDialogProps {
|
|
12
|
+
handleSubmit?: (confirmStatus: string) => void;
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const defaultConsentText = {
|
|
17
|
+
title: 'Подпишите согласие на запрос в БКИ',
|
|
18
|
+
description: 'Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const refuseConsentText = {
|
|
22
|
+
title: 'Вы уверены, что хотите отказаться от запроса в БКИ',
|
|
23
|
+
description: 'Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const ConsentBkiDialog = JSX<ConsentBkiDialogProps>(function ({
|
|
27
|
+
handleSubmit = noop,
|
|
28
|
+
onClose = noop,
|
|
29
|
+
}) {
|
|
30
|
+
const [confirmStatus, setConfirmStatus] = useState('');
|
|
31
|
+
const [showRefuceContent, setShowRefuceContent] = useState(false);
|
|
32
|
+
const { open, close } = useDialogManager();
|
|
33
|
+
const handleClose = useCallback(() => {
|
|
34
|
+
close();
|
|
35
|
+
handleSubmit(confirmStatus);
|
|
36
|
+
}, [confirmStatus]);
|
|
37
|
+
|
|
38
|
+
const handleConfirmChange = useCallback((value: string) => {
|
|
39
|
+
setConfirmStatus(value);
|
|
40
|
+
if (value === 'REFUSE') {
|
|
41
|
+
setShowRefuceContent(true);
|
|
42
|
+
}
|
|
43
|
+
}, []);
|
|
44
|
+
const consentText = showRefuceContent ? refuseConsentText : defaultConsentText;
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<Dialog className="my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg" onClose={onClose}>
|
|
48
|
+
<div className="flex flex-col gap-lg items-center">
|
|
49
|
+
<div role="button" onClick={() => openDocument(CONSENT_BKI_ID, open)}>
|
|
50
|
+
<Heading className="text-center text-balance" title={consentText.title} />
|
|
51
|
+
</div>
|
|
52
|
+
<Paragraph align="text-center">{consentText.description}</Paragraph>
|
|
53
|
+
<RadioButtonGroup
|
|
54
|
+
className="whitespace-normal"
|
|
55
|
+
orientation="horizontal"
|
|
56
|
+
items={ITEMS}
|
|
57
|
+
value={confirmStatus}
|
|
58
|
+
onChange={handleConfirmChange}
|
|
59
|
+
/>
|
|
60
|
+
<Button disabled={!confirmStatus} type="button" onClick={handleClose}>
|
|
61
|
+
Продолжить
|
|
62
|
+
</Button>
|
|
63
|
+
</div>
|
|
64
|
+
</Dialog>
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const ITEMS = [
|
|
69
|
+
{ id: 'SIGNED', text: 'Подписать' },
|
|
70
|
+
{ id: 'REFUSE', text: 'Отказаться' },
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
const CONSENT_BKI_ID = 2;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { updateUserProfile } from '../../api/RetailAPI/updateUserProfile';
|
|
2
|
+
import { formatPhone } from '../../utils/formatPhone';
|
|
3
|
+
import { useDialogManager } from '../DialogManager/useDialogManager';
|
|
4
|
+
import { useVerifyPhoneDialog } from '../VerifyPhoneDialog/useVerifyPhoneDialog';
|
|
5
|
+
import { ConsentBkiDialog } from './ConsentBkiDialog';
|
|
6
|
+
|
|
7
|
+
export const useConsentBkiDialog = () => {
|
|
8
|
+
const { open, closeAll } = useDialogManager();
|
|
9
|
+
const verifyPhoneDialog = useVerifyPhoneDialog();
|
|
10
|
+
|
|
11
|
+
const redirectToCreditForm = () => {
|
|
12
|
+
globalThis.location.href = '/credit-lead';
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const handleSuccessVerify = (profileId?: number) => async (smsCode?: string) => {
|
|
16
|
+
if (profileId) {
|
|
17
|
+
await updateUserProfile({
|
|
18
|
+
profile: {
|
|
19
|
+
id: profileId,
|
|
20
|
+
consentBkiFlg: true,
|
|
21
|
+
smsConsentBki: smsCode,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
redirectToCreditForm();
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const handleSubmitBkiConstent =
|
|
30
|
+
(phone?: string, profileId?: number) => async (confirmStatus: string) => {
|
|
31
|
+
await closeAll();
|
|
32
|
+
|
|
33
|
+
if (confirmStatus === 'SIGNED' && phone) {
|
|
34
|
+
verifyPhoneDialog.open(handleSuccessVerify(profileId), verifyPhoneContent(phone));
|
|
35
|
+
} else {
|
|
36
|
+
redirectToCreditForm();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
open: (phone?: string, profileId?: number) =>
|
|
42
|
+
open(
|
|
43
|
+
<ConsentBkiDialog
|
|
44
|
+
handleSubmit={handleSubmitBkiConstent(phone, profileId)}
|
|
45
|
+
onClose={redirectToCreditForm}
|
|
46
|
+
/>,
|
|
47
|
+
),
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const verifyPhoneContent = (phone: string) => ({
|
|
52
|
+
title: 'Подтвердите номер телефона',
|
|
53
|
+
description: `Мы отправили код на ${phone}`,
|
|
54
|
+
phoneNumber: formatPhone(phone),
|
|
55
|
+
textButton: 'Отправить',
|
|
56
|
+
__html: `<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>
|
|
57
|
+
<ul><li>согласие на запрос информации в БКИ</li></ul>`,
|
|
58
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type VNode } from '../../model/VNode';
|
|
2
|
+
import { getDocument } from '../Checkbox/getDocument';
|
|
3
|
+
import { Dialog } from './Dialog';
|
|
4
|
+
|
|
5
|
+
export const openDocument = async (id: number, open: (dialog: VNode) => void) => {
|
|
6
|
+
const document = await getDocument(id);
|
|
7
|
+
|
|
8
|
+
open(
|
|
9
|
+
<Dialog className="my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0">
|
|
10
|
+
<iframe src={`${document}#toolbar=0`} className="w-full h-[80vh]" id="iframe-dialog" />
|
|
11
|
+
</Dialog>,
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -14,7 +14,7 @@ import { SubmitButton } from './SubmitButton';
|
|
|
14
14
|
import { useVerifyPhoneDialogSubmit } from './useVerifyPhoneDialogSubmit';
|
|
15
15
|
|
|
16
16
|
export interface VerifyPhoneDialogProps {
|
|
17
|
-
close?: () => void;
|
|
17
|
+
close?: (smsCode?: string) => void;
|
|
18
18
|
onClose?: () => void;
|
|
19
19
|
title?: string;
|
|
20
20
|
description?: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useDialogManager
|
|
1
|
+
import { useDialogManager } from '../DialogManager/useDialogManager';
|
|
2
2
|
import { VerifyPhoneDialog, type VerifyPhoneDialogProps } from './VerifyPhoneDialog';
|
|
3
3
|
|
|
4
|
-
export const useVerifyPhoneDialog = (
|
|
4
|
+
export const useVerifyPhoneDialog = () => {
|
|
5
5
|
const { open, close } = useDialogManager();
|
|
6
6
|
|
|
7
7
|
return {
|
|
8
|
-
open: (
|
|
9
|
-
open(<VerifyPhoneDialog onClose={close} {...props}
|
|
8
|
+
open: (handleClose: () => void, props: VerifyPhoneDialogProps) =>
|
|
9
|
+
open(<VerifyPhoneDialog onClose={close} close={handleClose} {...props} />),
|
|
10
10
|
close,
|
|
11
11
|
};
|
|
12
12
|
};
|
|
@@ -3,7 +3,7 @@ import { checkCode } from '../../api/RetailAPI/checkCode';
|
|
|
3
3
|
|
|
4
4
|
type useVerifyPhoneDialogSubmitProps = {
|
|
5
5
|
values: string[];
|
|
6
|
-
close?: () => void;
|
|
6
|
+
close?: (smsCode?: string) => void;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export const useVerifyPhoneDialogSubmit = ({ close, values }: useVerifyPhoneDialogSubmitProps) => {
|
|
@@ -40,7 +40,7 @@ export const useVerifyPhoneDialogSubmit = ({ close, values }: useVerifyPhoneDial
|
|
|
40
40
|
smsCodesSetName: { key: 'AUTHENTICATION' },
|
|
41
41
|
});
|
|
42
42
|
resetError();
|
|
43
|
-
close && close();
|
|
43
|
+
close && close(values.join(''));
|
|
44
44
|
} catch {
|
|
45
45
|
setIsLoading(false);
|
|
46
46
|
attemps > 1 ? setErrorText('Исчерпан лимит ввода смс-кода') : setErrorText('Неверный код');
|