@redneckz/wildless-cms-uni-blocks 0.14.1039 → 0.14.1041
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +65 -113
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ReferalForm/ReferalFormContent.d.ts +2 -2
- package/bundle/components/ReferalForm/referalFormData.d.ts +2 -2
- package/bundle/retail/api/getTaskById.d.ts +1 -1
- package/bundle/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +16 -19
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ReferalForm/ReferalForm.js +6 -6
- package/dist/components/ReferalForm/ReferalForm.js.map +1 -1
- package/dist/components/ReferalForm/ReferalFormContent.d.ts +2 -2
- package/dist/components/ReferalForm/referalFormData.d.ts +2 -2
- package/dist/components/ReferalForm/referalFormData.js +8 -14
- package/dist/components/ReferalForm/referalFormData.js.map +1 -1
- package/dist/components/ReferalForm/renderLinkInput.js +4 -1
- package/dist/components/ReferalForm/renderLinkInput.js.map +1 -1
- package/dist/retail/api/getTaskById.d.ts +1 -1
- package/dist/retail/api/getTaskById.js +4 -1
- package/dist/retail/api/getTaskById.js.map +1 -1
- package/dist/retail/components/DraftDialog/utils.js +20 -18
- package/dist/retail/components/DraftDialog/utils.js.map +1 -1
- package/dist/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/dist/retail/utils/productTypeToTaskType.js +13 -0
- package/dist/retail/utils/productTypeToTaskType.js.map +1 -0
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +16 -19
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ReferalForm/ReferalForm.js +6 -6
- package/lib/components/ReferalForm/ReferalForm.js.map +1 -1
- package/lib/components/ReferalForm/ReferalFormContent.d.ts +2 -2
- package/lib/components/ReferalForm/referalFormData.d.ts +2 -2
- package/lib/components/ReferalForm/referalFormData.js +7 -13
- package/lib/components/ReferalForm/referalFormData.js.map +1 -1
- package/lib/components/ReferalForm/renderLinkInput.js +4 -1
- package/lib/components/ReferalForm/renderLinkInput.js.map +1 -1
- package/lib/retail/api/getTaskById.d.ts +1 -1
- package/lib/retail/api/getTaskById.js +4 -1
- package/lib/retail/api/getTaskById.js.map +1 -1
- package/lib/retail/components/DraftDialog/utils.js +20 -18
- package/lib/retail/components/DraftDialog/utils.js.map +1 -1
- package/lib/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/lib/retail/utils/productTypeToTaskType.js +10 -0
- package/lib/retail/utils/productTypeToTaskType.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +65 -113
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ReferalForm/ReferalFormContent.d.ts +2 -2
- package/mobile/bundle/components/ReferalForm/referalFormData.d.ts +2 -2
- package/mobile/bundle/retail/api/getTaskById.d.ts +1 -1
- package/mobile/bundle/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +16 -19
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ReferalForm/ReferalForm.js +6 -6
- package/mobile/dist/components/ReferalForm/ReferalForm.js.map +1 -1
- package/mobile/dist/components/ReferalForm/ReferalFormContent.d.ts +2 -2
- package/mobile/dist/components/ReferalForm/referalFormData.d.ts +2 -2
- package/mobile/dist/components/ReferalForm/referalFormData.js +8 -14
- package/mobile/dist/components/ReferalForm/referalFormData.js.map +1 -1
- package/mobile/dist/components/ReferalForm/renderLinkInput.js +4 -1
- package/mobile/dist/components/ReferalForm/renderLinkInput.js.map +1 -1
- package/mobile/dist/retail/api/getTaskById.d.ts +1 -1
- package/mobile/dist/retail/api/getTaskById.js +4 -1
- package/mobile/dist/retail/api/getTaskById.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/utils.js +20 -18
- package/mobile/dist/retail/components/DraftDialog/utils.js.map +1 -1
- package/mobile/dist/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/mobile/dist/retail/utils/productTypeToTaskType.js +13 -0
- package/mobile/dist/retail/utils/productTypeToTaskType.js.map +1 -0
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +16 -19
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ReferalForm/ReferalForm.js +6 -6
- package/mobile/lib/components/ReferalForm/ReferalForm.js.map +1 -1
- package/mobile/lib/components/ReferalForm/ReferalFormContent.d.ts +2 -2
- package/mobile/lib/components/ReferalForm/referalFormData.d.ts +2 -2
- package/mobile/lib/components/ReferalForm/referalFormData.js +7 -13
- package/mobile/lib/components/ReferalForm/referalFormData.js.map +1 -1
- package/mobile/lib/components/ReferalForm/renderLinkInput.js +4 -1
- package/mobile/lib/components/ReferalForm/renderLinkInput.js.map +1 -1
- package/mobile/lib/retail/api/getTaskById.d.ts +1 -1
- package/mobile/lib/retail/api/getTaskById.js +4 -1
- package/mobile/lib/retail/api/getTaskById.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/utils.js +20 -18
- package/mobile/lib/retail/components/DraftDialog/utils.js.map +1 -1
- package/mobile/lib/retail/utils/productTypeToTaskType.d.ts +3 -0
- package/mobile/lib/retail/utils/productTypeToTaskType.js +10 -0
- package/mobile/lib/retail/utils/productTypeToTaskType.js.map +1 -0
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +15 -24
- package/mobile/src/components/ReferalForm/ReferalForm.example.json +3 -1
- package/mobile/src/components/ReferalForm/ReferalForm.tsx +11 -11
- package/mobile/src/components/ReferalForm/ReferalFormContent.ts +11 -9
- package/mobile/src/components/ReferalForm/referalFormData.ts +8 -14
- package/mobile/src/components/ReferalForm/renderLinkInput.tsx +5 -1
- package/mobile/src/retail/api/getTaskById.ts +7 -2
- package/mobile/src/retail/components/DraftDialog/utils.ts +20 -18
- package/mobile/src/retail/utils/productTypeToTaskType.ts +13 -0
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +15 -24
- package/src/components/ReferalForm/ReferalForm.example.json +3 -1
- package/src/components/ReferalForm/ReferalForm.fixture.mobile.tsx +2 -0
- package/src/components/ReferalForm/ReferalForm.fixture.tsx +2 -0
- package/src/components/ReferalForm/ReferalForm.tsx +11 -11
- package/src/components/ReferalForm/ReferalFormContent.ts +11 -9
- package/src/components/ReferalForm/referalFormData.ts +8 -14
- package/src/components/ReferalForm/renderLinkInput.tsx +5 -1
- package/src/retail/api/getTaskById.ts +7 -2
- package/src/retail/components/DraftDialog/utils.ts +20 -18
- package/src/retail/utils/productTypeToTaskType.ts +13 -0
- package/bundle/components/ReferalForm/renderSections.d.ts +0 -3
- package/dist/components/ReferalForm/renderSections.d.ts +0 -3
- package/dist/components/ReferalForm/renderSections.js +0 -10
- package/dist/components/ReferalForm/renderSections.js.map +0 -1
- package/lib/components/ReferalForm/renderSections.d.ts +0 -3
- package/lib/components/ReferalForm/renderSections.js +0 -7
- package/lib/components/ReferalForm/renderSections.js.map +0 -1
- package/mobile/bundle/components/ReferalForm/renderSections.d.ts +0 -3
- package/mobile/dist/components/ReferalForm/renderSections.d.ts +0 -3
- package/mobile/dist/components/ReferalForm/renderSections.js +0 -10
- package/mobile/dist/components/ReferalForm/renderSections.js.map +0 -1
- package/mobile/lib/components/ReferalForm/renderSections.d.ts +0 -3
- package/mobile/lib/components/ReferalForm/renderSections.js +0 -7
- package/mobile/lib/components/ReferalForm/renderSections.js.map +0 -1
- package/mobile/src/components/ReferalForm/renderSections.tsx +0 -18
- package/src/components/ReferalForm/renderSections.tsx +0 -18
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare const
|
|
1
|
+
import { type FieldDef } from '../ApplicationForm/ApplicationFormContent';
|
|
2
|
+
export declare const inputs: FieldDef[];
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
export const
|
|
2
|
-
{ title: 'Заполните ваши данные и получите персональную ссылку', inputs: [] },
|
|
1
|
+
export const inputs = [
|
|
3
2
|
{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
name: 'email',
|
|
12
|
-
required: true,
|
|
13
|
-
},
|
|
14
|
-
],
|
|
3
|
+
name: 'dadataPartyInnSelect',
|
|
4
|
+
required: true,
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
name: 'email',
|
|
8
|
+
required: true,
|
|
15
9
|
},
|
|
16
10
|
];
|
|
17
11
|
//# sourceMappingURL=referalFormData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"referalFormData.js","sourceRoot":"","sources":["../../../src/components/ReferalForm/referalFormData.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"referalFormData.js","sourceRoot":"","sources":["../../../src/components/ReferalForm/referalFormData.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAe;IAChC;QACE,IAAI,EAAE,sBAAsB;QAC5B,QAAQ,EAAE,IAAI;KACf;IACD;QACE,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,IAAI;KACf;CACF,CAAC"}
|
|
@@ -4,6 +4,9 @@ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
|
4
4
|
import { Img } from '../../ui-kit/Img/Img.js';
|
|
5
5
|
import { defaultStyle } from '../../ui-kit/Input/styles.js';
|
|
6
6
|
import { style } from '../../utils/style.js';
|
|
7
|
+
const defaultIcon = {
|
|
8
|
+
icon: 'CopyIcon',
|
|
9
|
+
};
|
|
7
10
|
export const renderLinkInput = JSX(({ className, value = '', copyIcon }) => {
|
|
8
11
|
const onClick = useCallback(async () => {
|
|
9
12
|
try {
|
|
@@ -13,6 +16,6 @@ export const renderLinkInput = JSX(({ className, value = '', copyIcon }) => {
|
|
|
13
16
|
console.log('Ошибка копирования');
|
|
14
17
|
}
|
|
15
18
|
}, []);
|
|
16
|
-
return (_jsxs("div", { className: style('relative flex items-center max-w-lg m-auto', className), children: [_jsx("input", { className: style('h-14 border-gray text-ellipsis pr-5xl', defaultStyle), type: "text", value: value, disabled: true }), _jsx("div", { role: "button", className: "absolute right-3", onClick: onClick, children: _jsx(Img, { image: copyIcon }) })] }));
|
|
19
|
+
return (_jsxs("div", { className: style('relative flex items-center max-w-lg m-auto', className), children: [_jsx("input", { className: style('h-14 border-gray text-ellipsis pr-5xl', defaultStyle), type: "text", value: value, disabled: true }), _jsx("div", { role: "button", className: "absolute right-3", onClick: onClick, children: _jsx(Img, { image: copyIcon ?? defaultIcon, width: "20px" }) })] }));
|
|
17
20
|
});
|
|
18
21
|
//# sourceMappingURL=renderLinkInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderLinkInput.js","sourceRoot":"","sources":["../../../src/components/ReferalForm/renderLinkInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAM1C,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAuB,CAAC,EAAE,SAAS,EAAE,KAAK,GAAG,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/F,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QACrC,IAAI;YACF,MAAM,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;SACvD;QAAC,MAAM;YACN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L,eAAK,SAAS,EAAE,KAAK,CAAC,4CAA4C,EAAE,SAAS,CAAC,aAC5E,gBACE,SAAS,EAAE,KAAK,CAAC,uCAAuC,EAAE,YAAY,CAAC,EACvE,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,IAAI,GACd,EACF,cAAK,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,kBAAkB,EAAC,OAAO,EAAE,OAAO,YAC9D,KAAC,GAAG,IAAC,KAAK,EAAE,QAAQ,IAAI,WAAW,EAAE,KAAK,EAAC,MAAM,GAAG,GAChD,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { checkNewMicroservice } from '../utils/checkNewMicroservice.js';
|
|
1
2
|
import { fetchRetailJSON } from './doRequest.js';
|
|
2
3
|
export const getTaskById = async (body) => {
|
|
3
|
-
const
|
|
4
|
+
const isNewMicroservice = checkNewMicroservice();
|
|
5
|
+
const endpoint = isNewMicroservice ? '/public-data/getTaskById' : '/user-data/getTaskById';
|
|
6
|
+
const res = await fetchRetailJSON(endpoint, 'POST', body);
|
|
4
7
|
return res || undefined;
|
|
5
8
|
};
|
|
6
9
|
//# sourceMappingURL=getTaskById.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTaskById.js","sourceRoot":"","sources":["../../../src/retail/api/getTaskById.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAO9C,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,IAAqB,EAA6B,EAAE;IACpF,MAAM,GAAG,GAAG,MAAM,eAAe,CAAO,
|
|
1
|
+
{"version":3,"file":"getTaskById.js","sourceRoot":"","sources":["../../../src/retail/api/getTaskById.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAO9C,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,IAAqB,EAA6B,EAAE;IACpF,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;IAEjD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,wBAAwB,CAAC;IAE3F,MAAM,GAAG,GAAG,MAAM,eAAe,CAAO,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAEhE,OAAO,GAAG,IAAI,SAAS,CAAC;AAC1B,CAAC,CAAC"}
|
|
@@ -59,24 +59,26 @@ export const getSelectValue = (option, map) => {
|
|
|
59
59
|
: undefined;
|
|
60
60
|
};
|
|
61
61
|
export const getProductData = (taskType) => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
switch (taskType) {
|
|
63
|
+
case 'debit':
|
|
64
|
+
return {
|
|
65
|
+
nextStepLink: '/debit-card-lead',
|
|
66
|
+
newTaskLink: '/natural/debetcards',
|
|
67
|
+
description: 'На дебетовую карту',
|
|
68
|
+
};
|
|
69
|
+
case 'credit':
|
|
70
|
+
return {
|
|
71
|
+
nextStepLink: '/credit-lead',
|
|
72
|
+
newTaskLink: '/natural/loans/all-goals',
|
|
73
|
+
description: 'На получение кредита',
|
|
74
|
+
};
|
|
75
|
+
case 'card':
|
|
76
|
+
default:
|
|
77
|
+
return {
|
|
78
|
+
nextStepLink: '/credit-card-lead',
|
|
79
|
+
newTaskLink: '/natural/creditcards/svoya',
|
|
80
|
+
description: 'На получение кредитной карты',
|
|
81
|
+
};
|
|
68
82
|
}
|
|
69
|
-
else if (taskType === 'credit') {
|
|
70
|
-
return {
|
|
71
|
-
nextStepLink: '/credit-lead',
|
|
72
|
-
newTaskLink: '/natural/loans/all-goals',
|
|
73
|
-
description: 'На получение кредита',
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
return {
|
|
77
|
-
nextStepLink: '/credit-card-lead',
|
|
78
|
-
newTaskLink: '/natural/creditcards/svoya',
|
|
79
|
-
description: 'На получение кредитной карты',
|
|
80
|
-
};
|
|
81
83
|
};
|
|
82
84
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AA+BjF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,WAAW;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,kBAAqD,EAAE,EAAE;IAC7F,MAAM,KAAK,GAAG,kBAAkB,EAAE,IAAI,CACpC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,qCAAuB,CAC7D,EAAE,KAAK,CAAC;IACT,MAAM,iBAAiB,GAAG,kBAAkB,EAAE,IAAI,CAChD,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,+DAAoC,CAC1E,EAAE,KAAK,CAAC;IACT,MAAM,gBAAgB,GAAG,kBAAkB,EAAE,IAAI,CAC/C,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,6DAAmC,CACzE,EAAE,KAAK,CAAC;IACT,MAAM,WAAW,GAAG,kBAAkB,EAAE,IAAI,CAC1C,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,mDAA8B,CACpE,EAAE,KAAK,CAAC;IACT,MAAM,aAAa,GAAG,kBAAkB,EAAE,IAAI,CAC5C,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,uDAAgC,CACtE,EAAE,KAAK,CAAC;IACT,MAAM,YA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GAAG,CAAC,MAA+B,EAAE,EAAE;IACtE,OAAO,MAAM,EAAE,GAAG;QAChB,CAAC,CAAC;YACE,GAAG,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ;SAC9C;QACH,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,MAAuB,EACvB,GAA4B,EACR,EAAE;IACtB,OAAO,MAAM,EAAE,GAAG;QAChB,CAAC,CAAC;YACE,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK;SAC3C;QACH,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAwB,EAAE,EAAE;IACzD,QAAQ,QAAQ,EAAE;QAChB,KAAK,OAAO;YACV,OAAO;gBACL,YAAY,EAAE,kBAAkB;gBAChC,WAAW,EAAE,qBAAqB;gBAClC,WAAW,EAAE,oBAAoB;aAClC,CAAC;QACJ,KAAK,QAAQ;YACX,OAAO;gBACL,YAAY,EAAE,cAAc;gBAC5B,WAAW,EAAE,0BAA0B;gBACvC,WAAW,EAAE,sBAAsB;aACpC,CAAC;QACJ,KAAK,MAAM,CAAC;QACZ;YACE,OAAO;gBACL,YAAY,EAAE,mBAAmB;gBACjC,WAAW,EAAE,4BAA4B;gBACzC,WAAW,EAAE,8BAA8B;aAC5C,CAAC;KACL;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productTypeToTaskType.js","sourceRoot":"","sources":["../../../src/retail/utils/productTypeToTaskType.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,WAAwB,EAAiB,EAAE;IAC/E,IAAI,WAAW,KAAK,WAAW,EAAE;QAC/B,OAAO,OAAO,CAAC;KAChB;IACD,IAAI,WAAW,KAAK,YAAY,EAAE;QAChC,OAAO,MAAM,CAAC;KACf;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
|
|
@@ -8,7 +8,6 @@ import { createDraftTask } from '../../retail/api/createDraftTask';
|
|
|
8
8
|
import { createParticipant } from '../../retail/api/createParticipant';
|
|
9
9
|
import { createUserProfile } from '../../retail/api/createUserProfile';
|
|
10
10
|
import { createUserTaskDebit } from '../../retail/api/createUserTaskDebit';
|
|
11
|
-
import { type Task } from '../../retail/api/draftTasksKZO';
|
|
12
11
|
import { getClaimChannel } from '../../retail/api/getClaimChannel';
|
|
13
12
|
import { getLastTaskStatus } from '../../retail/api/getLastTaskStatus';
|
|
14
13
|
import { getTaskById } from '../../retail/api/getTaskById';
|
|
@@ -18,7 +17,6 @@ import { updateUserTask } from '../../retail/api/updateUserTask';
|
|
|
18
17
|
import { useConsentBkiDialog } from '../../retail/components/ConsentBkiDialog/useConsentBkiDialog';
|
|
19
18
|
import { useDraftDialog } from '../../retail/components/DraftDialog/useDraftDialog';
|
|
20
19
|
import { VerifyPhoneDialog } from '../../retail/components/VerifyPhoneDialog/VerifyPhoneDialog';
|
|
21
|
-
import { useDraftSearch } from '../../retail/hooks/useDraftSearch';
|
|
22
20
|
import {
|
|
23
21
|
type CommonLeadProps,
|
|
24
22
|
type ProductType,
|
|
@@ -26,9 +24,9 @@ import {
|
|
|
26
24
|
type UpdateUserDataNewMicroserviceProps,
|
|
27
25
|
type UpdateUserDataProps,
|
|
28
26
|
} from '../../retail/model/ApplicationLeadFormTypes';
|
|
29
|
-
import { type DraftTaskType } from '../../retail/model/DraftTaskType';
|
|
30
27
|
import { type FormRetailConsents, type LeadFormState } from '../../retail/model/LeadFormState';
|
|
31
28
|
import { getUpdateUserProfileData } from '../../retail/utils/getUpdateUserProfile';
|
|
29
|
+
import { productTypeToTaskType } from '../../retail/utils/productTypeToTaskType';
|
|
32
30
|
import { useDialog } from '../../ui-kit/DialogManager/useDialog';
|
|
33
31
|
import { formatPhone } from '../../utils/formatPhone';
|
|
34
32
|
import { productTypeToConsentsMap } from './consents';
|
|
@@ -70,7 +68,6 @@ export const useApplicationLeadApi = ({
|
|
|
70
68
|
const consentBkiDialog = useConsentBkiDialog(goToNextStep);
|
|
71
69
|
const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
|
|
72
70
|
const draftDialog = useDraftDialog();
|
|
73
|
-
const { searchDrafts } = useDraftSearch();
|
|
74
71
|
|
|
75
72
|
const handleFailSendForm = () => {
|
|
76
73
|
verifyPhoneDialog.close();
|
|
@@ -124,7 +121,7 @@ export const useApplicationLeadApi = ({
|
|
|
124
121
|
draftDialog.open({
|
|
125
122
|
task,
|
|
126
123
|
isFromLead: true,
|
|
127
|
-
taskType: productType
|
|
124
|
+
taskType: productTypeToTaskType(productType),
|
|
128
125
|
sendAspects,
|
|
129
126
|
onClose: sendCurrentTask,
|
|
130
127
|
});
|
|
@@ -199,7 +196,6 @@ export const useApplicationLeadApi = ({
|
|
|
199
196
|
common,
|
|
200
197
|
draftDialog,
|
|
201
198
|
sendCurrentTask,
|
|
202
|
-
searchDrafts,
|
|
203
199
|
});
|
|
204
200
|
|
|
205
201
|
const acceptedConsents = getAcceptedConsents(transformedFormData, productType);
|
|
@@ -263,35 +259,30 @@ const createHandleSuccessVerifyNew =
|
|
|
263
259
|
common,
|
|
264
260
|
draftDialog,
|
|
265
261
|
sendCurrentTask,
|
|
266
|
-
searchDrafts,
|
|
267
262
|
}: {
|
|
268
263
|
common: CommonLeadProps;
|
|
269
264
|
draftDialog: any;
|
|
270
265
|
sendCurrentTask: () => Promise<void>;
|
|
271
|
-
searchDrafts: () => Promise<{ draft: Task | null; taskType: DraftTaskType | undefined }>;
|
|
272
266
|
}) =>
|
|
273
267
|
async () => {
|
|
274
|
-
const { verifyPhoneDialog, sendAspects, handleFailSendForm } =
|
|
268
|
+
const { verifyPhoneDialog, sendAspects, handleFailSendForm, userId, programId, productType } =
|
|
269
|
+
common;
|
|
275
270
|
try {
|
|
276
|
-
const {
|
|
277
|
-
|
|
278
|
-
verifyPhoneDialog.close();
|
|
271
|
+
const lastTaskId = await getLastTaskStatus({ userId, programId });
|
|
279
272
|
|
|
280
|
-
if (
|
|
273
|
+
if (lastTaskId) {
|
|
274
|
+
const task = await getTaskById({ taskId: lastTaskId });
|
|
275
|
+
verifyPhoneDialog.close();
|
|
281
276
|
draftDialog.open({
|
|
282
|
-
task
|
|
283
|
-
|
|
277
|
+
task,
|
|
278
|
+
isFromLead: true,
|
|
279
|
+
taskType: productTypeToTaskType(productType),
|
|
280
|
+
sendAspects,
|
|
281
|
+
onClose: sendCurrentTask,
|
|
284
282
|
});
|
|
285
|
-
|
|
286
|
-
|
|
283
|
+
} else {
|
|
284
|
+
await sendCurrentTask();
|
|
287
285
|
}
|
|
288
|
-
draftDialog.open({
|
|
289
|
-
task: draft,
|
|
290
|
-
taskType,
|
|
291
|
-
isFromLead: true,
|
|
292
|
-
sendAspects,
|
|
293
|
-
onClose: sendCurrentTask,
|
|
294
|
-
});
|
|
295
286
|
} catch {
|
|
296
287
|
handleFailSendForm();
|
|
297
288
|
}
|
|
@@ -2,7 +2,9 @@ import { useCallback, useMemo, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
|
2
2
|
import { useForm } from '../../hooks/useForm/useForm';
|
|
3
3
|
import { ApplicationFormLayout } from '../../ui-kit/ApplicationFormLayout/ApplicationFormLayout';
|
|
4
4
|
import { SubmitButton } from '../../ui-kit/Button/SubmitButton';
|
|
5
|
+
import { getField } from '../../ui-kit/FormField/getField';
|
|
5
6
|
import { getFormValidator } from '../../ui-kit/FormField/getObjectValidator';
|
|
7
|
+
import { renderTitle } from '../../ui-kit/FormField/renderTitle';
|
|
6
8
|
import { Link } from '../../ui-kit/Link/Link';
|
|
7
9
|
import { Paragraph } from '../../ui-kit/Paragraph/Paragraph';
|
|
8
10
|
import { type Option } from '../../ui-kit/Select/Option';
|
|
@@ -11,8 +13,7 @@ import { UniBlock } from '../../UniBlock/UniBlock';
|
|
|
11
13
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
12
14
|
import { type FieldDef } from '../ApplicationForm/ApplicationFormContent';
|
|
13
15
|
import { type ReferalFormContent } from './ReferalFormContent';
|
|
14
|
-
import {
|
|
15
|
-
import { renderSections } from './renderSections';
|
|
16
|
+
import { inputs } from './referalFormData';
|
|
16
17
|
import { ResultLink } from './ResultLink';
|
|
17
18
|
|
|
18
19
|
export interface FormState {
|
|
@@ -23,13 +24,9 @@ export interface FormState {
|
|
|
23
24
|
export interface ReferalFormProps extends ReferalFormContent, UniBlockProps {}
|
|
24
25
|
|
|
25
26
|
export const ReferalForm = UniBlock<ReferalFormProps>(
|
|
26
|
-
({ link = '', button, copyIcon, ...rest }) => {
|
|
27
|
+
({ title, description, link = '', button, copyIcon, ...rest }) => {
|
|
27
28
|
const [isShowResultLink, setIsShowResultLink] = useState(false);
|
|
28
29
|
const [referalLink, setReferalLink] = useState('');
|
|
29
|
-
const inputs = useMemo(
|
|
30
|
-
() => (sections?.flatMap((_) => _?.inputs) || []) as FieldDef[],
|
|
31
|
-
[sections],
|
|
32
|
-
);
|
|
33
30
|
|
|
34
31
|
const formValidator = useMemo(() => getFormValidator(inputs), [inputs]);
|
|
35
32
|
|
|
@@ -52,14 +49,17 @@ export const ReferalForm = UniBlock<ReferalFormProps>(
|
|
|
52
49
|
return (
|
|
53
50
|
<ApplicationFormLayout
|
|
54
51
|
className="container space-y-m col-span-12"
|
|
55
|
-
title={getTitle(isShowResultLink)}
|
|
52
|
+
title={getTitle(title, isShowResultLink)}
|
|
56
53
|
{...rest}
|
|
57
54
|
>
|
|
58
55
|
{isShowResultLink ? (
|
|
59
56
|
<ResultLink link={referalLink} copyIcon={copyIcon} />
|
|
60
57
|
) : (
|
|
61
58
|
<form onSubmit={onSubmit}>
|
|
62
|
-
|
|
59
|
+
<div className="grid @xl:grid-cols-2 gap-x-m">
|
|
60
|
+
{renderTitle(description)}
|
|
61
|
+
{inputs.map(getField<FieldDef>(field))}
|
|
62
|
+
</div>
|
|
63
63
|
<Paragraph size="text-l" font="font-light" color="text-secondary-text">
|
|
64
64
|
<Text>Нажимая кнопку, вы подтверждаете согласие с </Text>
|
|
65
65
|
<Link href="/privacy-policy" target="_blank" ariaLabel="условия передачи данных">
|
|
@@ -76,5 +76,5 @@ export const ReferalForm = UniBlock<ReferalFormProps>(
|
|
|
76
76
|
},
|
|
77
77
|
);
|
|
78
78
|
|
|
79
|
-
const getTitle = (isShowResultLink = false) =>
|
|
80
|
-
isShowResultLink ? 'Ваша личная ссылка' :
|
|
79
|
+
const getTitle = (title = '', isShowResultLink = false) =>
|
|
80
|
+
isShowResultLink ? 'Ваша личная ссылка' : title;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { type TextProps } from '../../model/HeadlineType';
|
|
1
|
+
import { type DescriptionProps, type TextProps, type TitleProps } from '../../model/HeadlineType';
|
|
2
2
|
import { type Picture } from '../../model/Picture';
|
|
3
3
|
import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @title Форма для создания реферальной ссылки
|
|
7
7
|
*/
|
|
8
|
-
export type ReferalFormContent = UniBlockContent &
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
export type ReferalFormContent = UniBlockContent &
|
|
9
|
+
TitleProps &
|
|
10
|
+
DescriptionProps & {
|
|
11
|
+
/** @title Адрес страницы с заявкой для реферала */
|
|
12
|
+
link?: string;
|
|
13
|
+
/** @title Кнопка */
|
|
14
|
+
button?: TextProps;
|
|
15
|
+
/** @title Иконка кнопки копирования */
|
|
16
|
+
copyIcon?: Picture;
|
|
17
|
+
};
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type FieldDef } from '../ApplicationForm/ApplicationFormContent';
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
{ title: 'Заполните ваши данные и получите персональную ссылку', inputs: [] },
|
|
3
|
+
export const inputs: FieldDef[] = [
|
|
5
4
|
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
{
|
|
13
|
-
name: 'email',
|
|
14
|
-
required: true,
|
|
15
|
-
},
|
|
16
|
-
],
|
|
5
|
+
name: 'dadataPartyInnSelect',
|
|
6
|
+
required: true,
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: 'email',
|
|
10
|
+
required: true,
|
|
17
11
|
},
|
|
18
12
|
];
|
|
@@ -10,6 +10,10 @@ type renderLinkInputProps = InputProps & {
|
|
|
10
10
|
copyIcon?: Picture;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
const defaultIcon: Picture = {
|
|
14
|
+
icon: 'CopyIcon',
|
|
15
|
+
};
|
|
16
|
+
|
|
13
17
|
export const renderLinkInput = JSX<renderLinkInputProps>(({ className, value = '', copyIcon }) => {
|
|
14
18
|
const onClick = useCallback(async () => {
|
|
15
19
|
try {
|
|
@@ -28,7 +32,7 @@ export const renderLinkInput = JSX<renderLinkInputProps>(({ className, value = '
|
|
|
28
32
|
disabled={true}
|
|
29
33
|
/>
|
|
30
34
|
<div role="button" className="absolute right-3" onClick={onClick}>
|
|
31
|
-
<Img image={copyIcon} />
|
|
35
|
+
<Img image={copyIcon ?? defaultIcon} width="20px" />
|
|
32
36
|
</div>
|
|
33
37
|
</div>
|
|
34
38
|
);
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import { checkNewMicroservice } from '../utils/checkNewMicroservice';
|
|
1
2
|
import { fetchRetailJSON } from './doRequest';
|
|
2
3
|
import { type Task } from './draftTasksKZO';
|
|
3
4
|
|
|
4
5
|
type GetTaskByIdBody = {
|
|
5
|
-
taskId: number;
|
|
6
|
+
taskId: string | number;
|
|
6
7
|
};
|
|
7
8
|
|
|
8
9
|
export const getTaskById = async (body: GetTaskByIdBody): Promise<Task | undefined> => {
|
|
9
|
-
const
|
|
10
|
+
const isNewMicroservice = checkNewMicroservice();
|
|
11
|
+
|
|
12
|
+
const endpoint = isNewMicroservice ? '/public-data/getTaskById' : '/user-data/getTaskById';
|
|
13
|
+
|
|
14
|
+
const res = await fetchRetailJSON<Task>(endpoint, 'POST', body);
|
|
10
15
|
|
|
11
16
|
return res || undefined;
|
|
12
17
|
};
|
|
@@ -130,23 +130,25 @@ export const getSelectValue = (
|
|
|
130
130
|
};
|
|
131
131
|
|
|
132
132
|
export const getProductData = (taskType?: DraftTaskType) => {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
133
|
+
switch (taskType) {
|
|
134
|
+
case 'debit':
|
|
135
|
+
return {
|
|
136
|
+
nextStepLink: '/debit-card-lead',
|
|
137
|
+
newTaskLink: '/natural/debetcards',
|
|
138
|
+
description: 'На дебетовую карту',
|
|
139
|
+
};
|
|
140
|
+
case 'credit':
|
|
141
|
+
return {
|
|
142
|
+
nextStepLink: '/credit-lead',
|
|
143
|
+
newTaskLink: '/natural/loans/all-goals',
|
|
144
|
+
description: 'На получение кредита',
|
|
145
|
+
};
|
|
146
|
+
case 'card':
|
|
147
|
+
default:
|
|
148
|
+
return {
|
|
149
|
+
nextStepLink: '/credit-card-lead',
|
|
150
|
+
newTaskLink: '/natural/creditcards/svoya',
|
|
151
|
+
description: 'На получение кредитной карты',
|
|
152
|
+
};
|
|
145
153
|
}
|
|
146
|
-
|
|
147
|
-
return {
|
|
148
|
-
nextStepLink: '/credit-card-lead',
|
|
149
|
-
newTaskLink: '/natural/creditcards/svoya',
|
|
150
|
-
description: 'На получение кредитной карты',
|
|
151
|
-
};
|
|
152
154
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ProductType } from '../model/ApplicationLeadFormTypes';
|
|
2
|
+
import { type DraftTaskType } from '../model/DraftTaskType';
|
|
3
|
+
|
|
4
|
+
export const productTypeToTaskType = (productType: ProductType): DraftTaskType => {
|
|
5
|
+
if (productType === 'debitCard') {
|
|
6
|
+
return 'debit';
|
|
7
|
+
}
|
|
8
|
+
if (productType === 'creditCard') {
|
|
9
|
+
return 'card';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return 'credit';
|
|
13
|
+
};
|
package/package.json
CHANGED
|
@@ -8,7 +8,6 @@ import { createDraftTask } from '../../retail/api/createDraftTask';
|
|
|
8
8
|
import { createParticipant } from '../../retail/api/createParticipant';
|
|
9
9
|
import { createUserProfile } from '../../retail/api/createUserProfile';
|
|
10
10
|
import { createUserTaskDebit } from '../../retail/api/createUserTaskDebit';
|
|
11
|
-
import { type Task } from '../../retail/api/draftTasksKZO';
|
|
12
11
|
import { getClaimChannel } from '../../retail/api/getClaimChannel';
|
|
13
12
|
import { getLastTaskStatus } from '../../retail/api/getLastTaskStatus';
|
|
14
13
|
import { getTaskById } from '../../retail/api/getTaskById';
|
|
@@ -18,7 +17,6 @@ import { updateUserTask } from '../../retail/api/updateUserTask';
|
|
|
18
17
|
import { useConsentBkiDialog } from '../../retail/components/ConsentBkiDialog/useConsentBkiDialog';
|
|
19
18
|
import { useDraftDialog } from '../../retail/components/DraftDialog/useDraftDialog';
|
|
20
19
|
import { VerifyPhoneDialog } from '../../retail/components/VerifyPhoneDialog/VerifyPhoneDialog';
|
|
21
|
-
import { useDraftSearch } from '../../retail/hooks/useDraftSearch';
|
|
22
20
|
import {
|
|
23
21
|
type CommonLeadProps,
|
|
24
22
|
type ProductType,
|
|
@@ -26,9 +24,9 @@ import {
|
|
|
26
24
|
type UpdateUserDataNewMicroserviceProps,
|
|
27
25
|
type UpdateUserDataProps,
|
|
28
26
|
} from '../../retail/model/ApplicationLeadFormTypes';
|
|
29
|
-
import { type DraftTaskType } from '../../retail/model/DraftTaskType';
|
|
30
27
|
import { type FormRetailConsents, type LeadFormState } from '../../retail/model/LeadFormState';
|
|
31
28
|
import { getUpdateUserProfileData } from '../../retail/utils/getUpdateUserProfile';
|
|
29
|
+
import { productTypeToTaskType } from '../../retail/utils/productTypeToTaskType';
|
|
32
30
|
import { useDialog } from '../../ui-kit/DialogManager/useDialog';
|
|
33
31
|
import { formatPhone } from '../../utils/formatPhone';
|
|
34
32
|
import { productTypeToConsentsMap } from './consents';
|
|
@@ -70,7 +68,6 @@ export const useApplicationLeadApi = ({
|
|
|
70
68
|
const consentBkiDialog = useConsentBkiDialog(goToNextStep);
|
|
71
69
|
const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
|
|
72
70
|
const draftDialog = useDraftDialog();
|
|
73
|
-
const { searchDrafts } = useDraftSearch();
|
|
74
71
|
|
|
75
72
|
const handleFailSendForm = () => {
|
|
76
73
|
verifyPhoneDialog.close();
|
|
@@ -124,7 +121,7 @@ export const useApplicationLeadApi = ({
|
|
|
124
121
|
draftDialog.open({
|
|
125
122
|
task,
|
|
126
123
|
isFromLead: true,
|
|
127
|
-
taskType: productType
|
|
124
|
+
taskType: productTypeToTaskType(productType),
|
|
128
125
|
sendAspects,
|
|
129
126
|
onClose: sendCurrentTask,
|
|
130
127
|
});
|
|
@@ -199,7 +196,6 @@ export const useApplicationLeadApi = ({
|
|
|
199
196
|
common,
|
|
200
197
|
draftDialog,
|
|
201
198
|
sendCurrentTask,
|
|
202
|
-
searchDrafts,
|
|
203
199
|
});
|
|
204
200
|
|
|
205
201
|
const acceptedConsents = getAcceptedConsents(transformedFormData, productType);
|
|
@@ -263,35 +259,30 @@ const createHandleSuccessVerifyNew =
|
|
|
263
259
|
common,
|
|
264
260
|
draftDialog,
|
|
265
261
|
sendCurrentTask,
|
|
266
|
-
searchDrafts,
|
|
267
262
|
}: {
|
|
268
263
|
common: CommonLeadProps;
|
|
269
264
|
draftDialog: any;
|
|
270
265
|
sendCurrentTask: () => Promise<void>;
|
|
271
|
-
searchDrafts: () => Promise<{ draft: Task | null; taskType: DraftTaskType | undefined }>;
|
|
272
266
|
}) =>
|
|
273
267
|
async () => {
|
|
274
|
-
const { verifyPhoneDialog, sendAspects, handleFailSendForm } =
|
|
268
|
+
const { verifyPhoneDialog, sendAspects, handleFailSendForm, userId, programId, productType } =
|
|
269
|
+
common;
|
|
275
270
|
try {
|
|
276
|
-
const {
|
|
277
|
-
|
|
278
|
-
verifyPhoneDialog.close();
|
|
271
|
+
const lastTaskId = await getLastTaskStatus({ userId, programId });
|
|
279
272
|
|
|
280
|
-
if (
|
|
273
|
+
if (lastTaskId) {
|
|
274
|
+
const task = await getTaskById({ taskId: lastTaskId });
|
|
275
|
+
verifyPhoneDialog.close();
|
|
281
276
|
draftDialog.open({
|
|
282
|
-
task
|
|
283
|
-
|
|
277
|
+
task,
|
|
278
|
+
isFromLead: true,
|
|
279
|
+
taskType: productTypeToTaskType(productType),
|
|
280
|
+
sendAspects,
|
|
281
|
+
onClose: sendCurrentTask,
|
|
284
282
|
});
|
|
285
|
-
|
|
286
|
-
|
|
283
|
+
} else {
|
|
284
|
+
await sendCurrentTask();
|
|
287
285
|
}
|
|
288
|
-
draftDialog.open({
|
|
289
|
-
task: draft,
|
|
290
|
-
taskType,
|
|
291
|
-
isFromLead: true,
|
|
292
|
-
sendAspects,
|
|
293
|
-
onClose: sendCurrentTask,
|
|
294
|
-
});
|
|
295
286
|
} catch {
|
|
296
287
|
handleFailSendForm();
|
|
297
288
|
}
|
|
@@ -15,6 +15,8 @@ export default {
|
|
|
15
15
|
<div className="container grid grid-cols-12">
|
|
16
16
|
<ReferalForm
|
|
17
17
|
link="https://www.rshb.ru/business/dlya-druga/rko"
|
|
18
|
+
description="Заполните ваши данные и получите персональную ссылку"
|
|
19
|
+
title="Как получить бесплатное обслуживание счёта"
|
|
18
20
|
button={{ text: 'Получить ссылку' }}
|
|
19
21
|
copyIcon={icon}
|
|
20
22
|
/>
|