@redneckz/wildless-cms-uni-blocks 0.14.912 → 0.14.914
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/LeadServiceAPI.d.ts +12 -3
- package/bundle/bundle.umd.js +715 -683
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/VerifyPhoneDialog.d.ts +10 -0
- package/bundle/components/ApplicationForm/useVerifyPhoneDialogSubmit.d.ts +18 -0
- package/bundle/components/TariffsTable/TariffsTableCell.d.ts +1 -1
- package/bundle/retail/api/checkCode.d.ts +1 -9
- package/bundle/retail/api/sendCode.d.ts +1 -1
- package/bundle/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -4
- package/bundle/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -6
- package/bundle/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -1
- package/bundle/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.d.ts +16 -0
- package/bundle/utils/getTimer.d.ts +2 -0
- package/dist/api/LeadServiceAPI.d.ts +12 -3
- package/dist/api/LeadServiceAPI.js +0 -3
- package/dist/api/LeadServiceAPI.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationForm.js +1 -3
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/components/ApplicationForm/VerifyPhoneDialog.d.ts +10 -0
- package/dist/components/ApplicationForm/VerifyPhoneDialog.js +37 -0
- package/dist/components/ApplicationForm/VerifyPhoneDialog.js.map +1 -0
- package/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.d.ts +18 -0
- package/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.js +50 -0
- package/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.js.map +1 -0
- package/dist/components/TariffsTable/TariffsTableCell.d.ts +1 -1
- package/dist/retail/api/checkCode.d.ts +1 -9
- package/dist/retail/api/checkCode.js +1 -22
- package/dist/retail/api/checkCode.js.map +1 -1
- package/dist/retail/api/sendCode.d.ts +1 -1
- package/dist/retail/api/sendCode.js +2 -8
- package/dist/retail/api/sendCode.js.map +1 -1
- package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -4
- package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +5 -24
- package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -6
- package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +7 -10
- package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/dist/retail/utils/mockLocalStorage.js +2 -2
- package/dist/retail/utils/mockLocalStorage.js.map +1 -1
- package/dist/ui-kit/BaseTile/BaseTile.js +1 -1
- package/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -1
- package/dist/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.d.ts +16 -0
- package/dist/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.js +17 -0
- package/dist/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.js.map +1 -0
- package/dist/utils/getTimer.d.ts +2 -0
- package/dist/utils/getTimer.js +6 -0
- package/dist/utils/getTimer.js.map +1 -0
- package/lib/api/LeadServiceAPI.d.ts +12 -3
- package/lib/api/LeadServiceAPI.js +0 -3
- package/lib/api/LeadServiceAPI.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.js +1 -3
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/components/ApplicationForm/VerifyPhoneDialog.d.ts +10 -0
- package/lib/components/ApplicationForm/VerifyPhoneDialog.js +35 -0
- package/lib/components/ApplicationForm/VerifyPhoneDialog.js.map +1 -0
- package/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.d.ts +18 -0
- package/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.js +47 -0
- package/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.js.map +1 -0
- package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.d.ts +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.fixture.d.ts +2 -0
- package/lib/components/TariffsTable/TariffsTableCell.d.ts +1 -1
- package/lib/retail/api/checkCode.d.ts +1 -9
- package/lib/retail/api/checkCode.js +1 -22
- package/lib/retail/api/checkCode.js.map +1 -1
- package/lib/retail/api/sendCode.d.ts +1 -1
- package/lib/retail/api/sendCode.js +1 -7
- package/lib/retail/api/sendCode.js.map +1 -1
- package/lib/retail/components/DraftDialog/utils.d.ts +3 -3
- package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -4
- package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +5 -24
- package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -6
- package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +5 -8
- package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/lib/retail/utils/mockLocalStorage.js +2 -2
- package/lib/retail/utils/mockLocalStorage.js.map +1 -1
- package/lib/ui-kit/BaseTile/BaseTile.js +1 -1
- package/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -1
- package/lib/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.d.ts +16 -0
- package/lib/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.js +15 -0
- package/lib/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.js.map +1 -0
- package/lib/utils/getTimer.d.ts +2 -0
- package/lib/utils/getTimer.js +3 -0
- package/lib/utils/getTimer.js.map +1 -0
- package/mobile/bundle/api/LeadServiceAPI.d.ts +12 -3
- package/mobile/bundle/bundle.umd.js +715 -683
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/VerifyPhoneDialog.d.ts +10 -0
- package/mobile/bundle/components/ApplicationForm/useVerifyPhoneDialogSubmit.d.ts +18 -0
- package/mobile/bundle/components/TariffsTable/TariffsTableCell.d.ts +1 -1
- package/mobile/bundle/retail/api/checkCode.d.ts +1 -9
- package/mobile/bundle/retail/api/sendCode.d.ts +1 -1
- package/mobile/bundle/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -4
- package/mobile/bundle/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -6
- package/mobile/bundle/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -1
- package/mobile/bundle/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.d.ts +16 -0
- package/mobile/bundle/utils/getTimer.d.ts +2 -0
- package/mobile/dist/api/LeadServiceAPI.d.ts +12 -3
- package/mobile/dist/api/LeadServiceAPI.js +0 -3
- package/mobile/dist/api/LeadServiceAPI.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js +1 -3
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/VerifyPhoneDialog.d.ts +10 -0
- package/mobile/dist/components/ApplicationForm/VerifyPhoneDialog.js +37 -0
- package/mobile/dist/components/ApplicationForm/VerifyPhoneDialog.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.d.ts +18 -0
- package/mobile/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.js +50 -0
- package/mobile/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.js.map +1 -0
- package/mobile/dist/components/TariffsTable/TariffsTableCell.d.ts +1 -1
- package/mobile/dist/retail/api/checkCode.d.ts +1 -9
- package/mobile/dist/retail/api/checkCode.js +1 -22
- package/mobile/dist/retail/api/checkCode.js.map +1 -1
- package/mobile/dist/retail/api/sendCode.d.ts +1 -1
- package/mobile/dist/retail/api/sendCode.js +2 -8
- package/mobile/dist/retail/api/sendCode.js.map +1 -1
- package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -4
- package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +5 -24
- package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -6
- package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +7 -10
- package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/dist/retail/utils/mockLocalStorage.js +2 -2
- package/mobile/dist/retail/utils/mockLocalStorage.js.map +1 -1
- package/mobile/dist/ui-kit/BaseTile/BaseTile.js +1 -1
- package/mobile/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.d.ts +16 -0
- package/mobile/dist/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.js +17 -0
- package/mobile/dist/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.js.map +1 -0
- package/mobile/dist/utils/getTimer.d.ts +2 -0
- package/mobile/dist/utils/getTimer.js +6 -0
- package/mobile/dist/utils/getTimer.js.map +1 -0
- package/mobile/lib/api/LeadServiceAPI.d.ts +12 -3
- package/mobile/lib/api/LeadServiceAPI.js +0 -3
- package/mobile/lib/api/LeadServiceAPI.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js +1 -3
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/VerifyPhoneDialog.d.ts +10 -0
- package/mobile/lib/components/ApplicationForm/VerifyPhoneDialog.js +35 -0
- package/mobile/lib/components/ApplicationForm/VerifyPhoneDialog.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.d.ts +18 -0
- package/mobile/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.js +47 -0
- package/mobile/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.js.map +1 -0
- package/mobile/lib/components/TariffsTable/TariffsTableCell.d.ts +1 -1
- package/mobile/lib/retail/api/checkCode.d.ts +1 -9
- package/mobile/lib/retail/api/checkCode.js +1 -22
- package/mobile/lib/retail/api/checkCode.js.map +1 -1
- package/mobile/lib/retail/api/sendCode.d.ts +1 -1
- package/mobile/lib/retail/api/sendCode.js +1 -7
- package/mobile/lib/retail/api/sendCode.js.map +1 -1
- package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -4
- package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +5 -24
- package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -6
- package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +5 -8
- package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/lib/retail/utils/mockLocalStorage.js +2 -2
- package/mobile/lib/retail/utils/mockLocalStorage.js.map +1 -1
- package/mobile/lib/ui-kit/BaseTile/BaseTile.js +1 -1
- package/mobile/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.d.ts +16 -0
- package/mobile/lib/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.js +15 -0
- package/mobile/lib/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.js.map +1 -0
- package/mobile/lib/utils/getTimer.d.ts +2 -0
- package/mobile/lib/utils/getTimer.js +3 -0
- package/mobile/lib/utils/getTimer.js.map +1 -0
- package/mobile/src/api/LeadServiceAPI.ts +13 -7
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +1 -3
- package/mobile/src/components/ApplicationForm/VerifyPhoneDialog.tsx +73 -0
- package/mobile/src/components/ApplicationForm/useVerifyPhoneDialogSubmit.tsx +63 -0
- package/mobile/src/components/TariffsTable/TariffsTableCell.tsx +1 -1
- package/mobile/src/retail/api/checkCode.ts +2 -47
- package/mobile/src/retail/api/sendCode.ts +1 -9
- package/mobile/src/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.tsx +23 -82
- package/mobile/src/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +7 -21
- package/mobile/src/retail/utils/mockLocalStorage.ts +9 -15
- package/mobile/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
- package/mobile/src/ui-kit/ResponseTypeDialog/ResponseTypeDialog.tsx +1 -1
- package/mobile/src/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.tsx +80 -0
- package/mobile/src/utils/getTimer.ts +4 -0
- package/package.json +1 -1
- package/src/api/LeadServiceAPI.ts +13 -7
- package/src/components/ApplicationForm/ApplicationForm.tsx +1 -3
- package/src/components/ApplicationForm/VerifyPhoneDialog.tsx +73 -0
- package/src/components/ApplicationForm/useVerifyPhoneDialogSubmit.tsx +63 -0
- package/src/components/Carousel/Carousel.fixture.mobile.tsx +16 -16
- package/src/components/Carousel/Carousel.fixture.tsx +42 -20
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.mobile.tsx +19 -19
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +44 -23
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.tsx +12 -12
- package/src/components/TariffsTable/TariffsTableCell.tsx +1 -1
- package/src/icons/IconName.ts +4 -4
- package/src/retail/api/checkCode.ts +2 -47
- package/src/retail/api/sendCode.ts +1 -9
- package/src/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.tsx +23 -82
- package/src/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +7 -21
- package/src/retail/utils/mockLocalStorage.ts +9 -15
- package/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
- package/src/ui-kit/ResponseTypeDialog/ResponseTypeDialog.tsx +1 -1
- package/src/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.tsx +80 -0
- package/src/utils/getTimer.ts +4 -0
- package/bundle/model/onClose.d.ts +0 -3
- package/dist/model/onClose.d.ts +0 -3
- package/dist/model/onClose.js +0 -2
- package/dist/model/onClose.js.map +0 -1
- package/lib/model/onClose.d.ts +0 -3
- package/lib/model/onClose.js +0 -2
- package/lib/model/onClose.js.map +0 -1
- package/mobile/bundle/model/onClose.d.ts +0 -3
- package/mobile/dist/model/onClose.d.ts +0 -3
- package/mobile/dist/model/onClose.js +0 -2
- package/mobile/dist/model/onClose.js.map +0 -1
- package/mobile/lib/model/onClose.d.ts +0 -3
- package/mobile/lib/model/onClose.js +0 -2
- package/mobile/lib/model/onClose.js.map +0 -1
- package/mobile/src/model/onClose.ts +0 -3
- package/src/model/onClose.ts +0 -3
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
2
|
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
3
3
|
import { useSessionStore } from '@redneckz/uni-jsx/lib/Store/useSessionStore';
|
|
4
|
-
import {
|
|
4
|
+
import { getTimer } from '../../../utils/getTimer';
|
|
5
5
|
import { checkCode } from '../../api/checkCode';
|
|
6
6
|
|
|
7
7
|
export const TIME_TO_RESEND = 180;
|
|
8
|
-
export const TIME_TO_MAIN_EXPIRE = 600;
|
|
9
8
|
|
|
10
9
|
type useVerifyPhoneDialogSubmitProps = {
|
|
11
10
|
values: string[];
|
|
12
11
|
onSuccess?: (smsCode?: string) => void;
|
|
13
|
-
formatData?: LeadRequest;
|
|
14
|
-
reqId?: string;
|
|
15
|
-
isRetail?: boolean;
|
|
16
12
|
};
|
|
17
13
|
|
|
18
14
|
export interface SmsCodeStore {
|
|
@@ -25,9 +21,6 @@ export interface SmsCodeStore {
|
|
|
25
21
|
export const useVerifyPhoneDialogSubmit = ({
|
|
26
22
|
values,
|
|
27
23
|
onSuccess,
|
|
28
|
-
formatData,
|
|
29
|
-
reqId,
|
|
30
|
-
isRetail = true,
|
|
31
24
|
}: useVerifyPhoneDialogSubmitProps) => {
|
|
32
25
|
const sessionStore = useSessionStore<SmsCodeStore>();
|
|
33
26
|
const attempts = sessionStore.smsCode?.attempts || 0;
|
|
@@ -49,19 +42,14 @@ export const useVerifyPhoneDialogSubmit = ({
|
|
|
49
42
|
attempts: attempts + 1,
|
|
50
43
|
};
|
|
51
44
|
startLoading();
|
|
52
|
-
await checkCode(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
body: isRetail ? undefined : formatData,
|
|
57
|
-
reqId: isRetail ? undefined : reqId,
|
|
58
|
-
},
|
|
59
|
-
isRetail,
|
|
60
|
-
);
|
|
45
|
+
await checkCode({
|
|
46
|
+
smsText: values.join(''),
|
|
47
|
+
smsCodesSetName: { key: 'AUTHENTICATION' },
|
|
48
|
+
});
|
|
61
49
|
setTimeNextReq(0);
|
|
62
50
|
resetError();
|
|
63
51
|
sessionStore.smsCode = null;
|
|
64
|
-
|
|
52
|
+
onSuccess?.(values.join(''));
|
|
65
53
|
} catch {
|
|
66
54
|
setErrorText(attempts > 1 ? 'Исчерпан лимит ввода смс-кода' : 'Неверный код');
|
|
67
55
|
} finally {
|
|
@@ -70,7 +58,7 @@ export const useVerifyPhoneDialogSubmit = ({
|
|
|
70
58
|
}, [values, attempts]);
|
|
71
59
|
|
|
72
60
|
useEffect(() => {
|
|
73
|
-
if (isTimeExpired
|
|
61
|
+
if (isTimeExpired) {
|
|
74
62
|
setErrorText('Код просрочен');
|
|
75
63
|
} else if (attempts > 2) {
|
|
76
64
|
setErrorText('Исчерпан лимит ввода смс-кода');
|
|
@@ -88,5 +76,3 @@ export const useVerifyPhoneDialogSubmit = ({
|
|
|
88
76
|
setErrorText,
|
|
89
77
|
};
|
|
90
78
|
};
|
|
91
|
-
|
|
92
|
-
const getTimer = (sendTime: number) => TIME_TO_RESEND - Math.floor((Date.now() - sendTime) / 1000);
|
|
@@ -13,21 +13,15 @@ export const mockLocalStorage = async () => {
|
|
|
13
13
|
globalThis.localStorage.getItem('profileId') ??
|
|
14
14
|
(await createUserProfile({ profile: { phone: PHONE } }));
|
|
15
15
|
|
|
16
|
-
await sendCode(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{
|
|
26
|
-
smsCodesSetName: { key: 'AUTHENTICATION' },
|
|
27
|
-
smsText: '1234',
|
|
28
|
-
},
|
|
29
|
-
true,
|
|
30
|
-
);
|
|
16
|
+
await sendCode({
|
|
17
|
+
phoneNumber: PHONE,
|
|
18
|
+
smsCodesSetName: { key: 'AUTHENTICATION' },
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
await checkCode({
|
|
22
|
+
smsCodesSetName: { key: 'AUTHENTICATION' },
|
|
23
|
+
smsText: '1234',
|
|
24
|
+
});
|
|
31
25
|
|
|
32
26
|
const task = {
|
|
33
27
|
taskId: globalThis.localStorage.getItem('taskId'),
|
|
@@ -94,7 +94,7 @@ export const BaseTile = JSX<BaseTileProps>(
|
|
|
94
94
|
|
|
95
95
|
const renderMiddleContent = (insetTitle: VNode, children: VNode) =>
|
|
96
96
|
insetTitle || children ? (
|
|
97
|
-
<div className="
|
|
97
|
+
<div className="space-y-lg">
|
|
98
98
|
{insetTitle}
|
|
99
99
|
{children}
|
|
100
100
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { Headline } from '../../components/Headline/Headline';
|
|
3
|
-
import { type OnCloseProps } from '../../model/
|
|
3
|
+
import { type OnCloseProps } from '../../model/OnCloseProps';
|
|
4
4
|
import { Button } from '../Button/Button';
|
|
5
5
|
import { Dialog } from '../DialogManager/Dialog';
|
|
6
6
|
import { Img } from '../Img/Img';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { Headline } from '../../components/Headline/Headline';
|
|
3
|
+
import { type OnCloseProps } from '../../model/OnCloseProps';
|
|
4
|
+
import { type VNode } from '../../model/VNode';
|
|
5
|
+
import { InputCode } from '../../retail/components/VerifyPhoneDialog/InputCode';
|
|
6
|
+
import { SubmitButton } from '../../retail/components/VerifyPhoneDialog/SubmitButton';
|
|
7
|
+
import { Button } from '../Button/Button';
|
|
8
|
+
import { ButtonTitle } from '../Button/ButtonTitle';
|
|
9
|
+
import { Dialog } from '../DialogManager/Dialog';
|
|
10
|
+
import { Loader } from '../Loader/Loader';
|
|
11
|
+
import { Timer } from '../TimerCircle/Timer';
|
|
12
|
+
|
|
13
|
+
export interface VerifyPhoneDialogProps extends OnCloseProps {
|
|
14
|
+
isSubmitButtonDisabled: boolean;
|
|
15
|
+
onSubmit: () => Promise<void>;
|
|
16
|
+
onSendCode: () => Promise<void>;
|
|
17
|
+
timeNextReq: number;
|
|
18
|
+
values: string[];
|
|
19
|
+
onChange: (values: string[]) => void;
|
|
20
|
+
phone: string;
|
|
21
|
+
children?: VNode;
|
|
22
|
+
isLoading?: boolean;
|
|
23
|
+
errorText?: string;
|
|
24
|
+
hasError?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const VerifyPhoneDialogLayout = JSX<VerifyPhoneDialogProps>(
|
|
28
|
+
({
|
|
29
|
+
children,
|
|
30
|
+
isLoading,
|
|
31
|
+
isSubmitButtonDisabled,
|
|
32
|
+
timeNextReq,
|
|
33
|
+
onSubmit,
|
|
34
|
+
onSendCode,
|
|
35
|
+
values,
|
|
36
|
+
onChange,
|
|
37
|
+
errorText,
|
|
38
|
+
hasError,
|
|
39
|
+
phone,
|
|
40
|
+
onClose,
|
|
41
|
+
}) => (
|
|
42
|
+
<Dialog maxWidth="lg" onClose={onClose}>
|
|
43
|
+
<div className="flex flex-col gap-xl items-center rounded-md">
|
|
44
|
+
{renderHeadline(phone)}
|
|
45
|
+
<InputCode values={values} setValues={onChange} errorText={errorText} hasError={hasError} />
|
|
46
|
+
{renderText(timeNextReq, onSendCode)}
|
|
47
|
+
{children}
|
|
48
|
+
{renderNextButton(isSubmitButtonDisabled, onSubmit)}
|
|
49
|
+
{isLoading ? <Loader blur={false} /> : null}
|
|
50
|
+
</div>
|
|
51
|
+
</Dialog>
|
|
52
|
+
),
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const renderHeadline = (phone: string) => (
|
|
56
|
+
<Headline
|
|
57
|
+
className="w-full"
|
|
58
|
+
title="Подтвердите номер телефона"
|
|
59
|
+
description={`Мы отправили код на ${phone}`}
|
|
60
|
+
headlineVersion="XS"
|
|
61
|
+
isEmbedded={true}
|
|
62
|
+
as="h6"
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const renderNextButton = (disabled: boolean, onClick: () => void) => (
|
|
67
|
+
<SubmitButton text="Далее" disabled={disabled} onClick={onClick} />
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
const renderText = (timeNextReq: number, handleSendCode: () => void) =>
|
|
71
|
+
timeNextReq ? (
|
|
72
|
+
<div className="flex flex-row text-l font-light text-base gap-2xs">
|
|
73
|
+
<span> Получить новый код можно через</span>
|
|
74
|
+
<Timer seconds={timeNextReq} />
|
|
75
|
+
</div>
|
|
76
|
+
) : (
|
|
77
|
+
<Button embedded onClick={handleSendCode}>
|
|
78
|
+
<ButtonTitle>Получить новый код</ButtonTitle>
|
|
79
|
+
</Button>
|
|
80
|
+
);
|
package/dist/model/onClose.d.ts
DELETED
package/dist/model/onClose.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"onClose.js","sourceRoot":"","sources":["../../src/model/onClose.ts"],"names":[],"mappings":""}
|
package/lib/model/onClose.d.ts
DELETED
package/lib/model/onClose.js
DELETED
package/lib/model/onClose.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"onClose.js","sourceRoot":"","sources":["../../src/model/onClose.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"onClose.js","sourceRoot":"","sources":["../../src/model/onClose.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"onClose.js","sourceRoot":"","sources":["../../src/model/onClose.ts"],"names":[],"mappings":""}
|
package/src/model/onClose.ts
DELETED