@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.
Files changed (223) hide show
  1. package/bundle/api/LeadServiceAPI.d.ts +12 -3
  2. package/bundle/bundle.umd.js +715 -683
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ApplicationForm/VerifyPhoneDialog.d.ts +10 -0
  5. package/bundle/components/ApplicationForm/useVerifyPhoneDialogSubmit.d.ts +18 -0
  6. package/bundle/components/TariffsTable/TariffsTableCell.d.ts +1 -1
  7. package/bundle/retail/api/checkCode.d.ts +1 -9
  8. package/bundle/retail/api/sendCode.d.ts +1 -1
  9. package/bundle/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -4
  10. package/bundle/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -6
  11. package/bundle/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -1
  12. package/bundle/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.d.ts +16 -0
  13. package/bundle/utils/getTimer.d.ts +2 -0
  14. package/dist/api/LeadServiceAPI.d.ts +12 -3
  15. package/dist/api/LeadServiceAPI.js +0 -3
  16. package/dist/api/LeadServiceAPI.js.map +1 -1
  17. package/dist/components/ApplicationForm/ApplicationForm.js +1 -3
  18. package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  19. package/dist/components/ApplicationForm/VerifyPhoneDialog.d.ts +10 -0
  20. package/dist/components/ApplicationForm/VerifyPhoneDialog.js +37 -0
  21. package/dist/components/ApplicationForm/VerifyPhoneDialog.js.map +1 -0
  22. package/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.d.ts +18 -0
  23. package/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.js +50 -0
  24. package/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.js.map +1 -0
  25. package/dist/components/TariffsTable/TariffsTableCell.d.ts +1 -1
  26. package/dist/retail/api/checkCode.d.ts +1 -9
  27. package/dist/retail/api/checkCode.js +1 -22
  28. package/dist/retail/api/checkCode.js.map +1 -1
  29. package/dist/retail/api/sendCode.d.ts +1 -1
  30. package/dist/retail/api/sendCode.js +2 -8
  31. package/dist/retail/api/sendCode.js.map +1 -1
  32. package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -4
  33. package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +5 -24
  34. package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  35. package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -6
  36. package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +7 -10
  37. package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  38. package/dist/retail/utils/mockLocalStorage.js +2 -2
  39. package/dist/retail/utils/mockLocalStorage.js.map +1 -1
  40. package/dist/ui-kit/BaseTile/BaseTile.js +1 -1
  41. package/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
  42. package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -1
  43. package/dist/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.d.ts +16 -0
  44. package/dist/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.js +17 -0
  45. package/dist/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.js.map +1 -0
  46. package/dist/utils/getTimer.d.ts +2 -0
  47. package/dist/utils/getTimer.js +6 -0
  48. package/dist/utils/getTimer.js.map +1 -0
  49. package/lib/api/LeadServiceAPI.d.ts +12 -3
  50. package/lib/api/LeadServiceAPI.js +0 -3
  51. package/lib/api/LeadServiceAPI.js.map +1 -1
  52. package/lib/common.css +1 -1
  53. package/lib/components/ApplicationForm/ApplicationForm.js +1 -3
  54. package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  55. package/lib/components/ApplicationForm/VerifyPhoneDialog.d.ts +10 -0
  56. package/lib/components/ApplicationForm/VerifyPhoneDialog.js +35 -0
  57. package/lib/components/ApplicationForm/VerifyPhoneDialog.js.map +1 -0
  58. package/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.d.ts +18 -0
  59. package/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.js +47 -0
  60. package/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.js.map +1 -0
  61. package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
  62. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.d.ts +1 -1
  63. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.fixture.d.ts +2 -0
  64. package/lib/components/TariffsTable/TariffsTableCell.d.ts +1 -1
  65. package/lib/retail/api/checkCode.d.ts +1 -9
  66. package/lib/retail/api/checkCode.js +1 -22
  67. package/lib/retail/api/checkCode.js.map +1 -1
  68. package/lib/retail/api/sendCode.d.ts +1 -1
  69. package/lib/retail/api/sendCode.js +1 -7
  70. package/lib/retail/api/sendCode.js.map +1 -1
  71. package/lib/retail/components/DraftDialog/utils.d.ts +3 -3
  72. package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -4
  73. package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +5 -24
  74. package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  75. package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -6
  76. package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +5 -8
  77. package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  78. package/lib/retail/utils/mockLocalStorage.js +2 -2
  79. package/lib/retail/utils/mockLocalStorage.js.map +1 -1
  80. package/lib/ui-kit/BaseTile/BaseTile.js +1 -1
  81. package/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
  82. package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -1
  83. package/lib/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.d.ts +16 -0
  84. package/lib/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.js +15 -0
  85. package/lib/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.js.map +1 -0
  86. package/lib/utils/getTimer.d.ts +2 -0
  87. package/lib/utils/getTimer.js +3 -0
  88. package/lib/utils/getTimer.js.map +1 -0
  89. package/mobile/bundle/api/LeadServiceAPI.d.ts +12 -3
  90. package/mobile/bundle/bundle.umd.js +715 -683
  91. package/mobile/bundle/bundle.umd.min.js +1 -1
  92. package/mobile/bundle/components/ApplicationForm/VerifyPhoneDialog.d.ts +10 -0
  93. package/mobile/bundle/components/ApplicationForm/useVerifyPhoneDialogSubmit.d.ts +18 -0
  94. package/mobile/bundle/components/TariffsTable/TariffsTableCell.d.ts +1 -1
  95. package/mobile/bundle/retail/api/checkCode.d.ts +1 -9
  96. package/mobile/bundle/retail/api/sendCode.d.ts +1 -1
  97. package/mobile/bundle/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -4
  98. package/mobile/bundle/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -6
  99. package/mobile/bundle/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -1
  100. package/mobile/bundle/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.d.ts +16 -0
  101. package/mobile/bundle/utils/getTimer.d.ts +2 -0
  102. package/mobile/dist/api/LeadServiceAPI.d.ts +12 -3
  103. package/mobile/dist/api/LeadServiceAPI.js +0 -3
  104. package/mobile/dist/api/LeadServiceAPI.js.map +1 -1
  105. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +1 -3
  106. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  107. package/mobile/dist/components/ApplicationForm/VerifyPhoneDialog.d.ts +10 -0
  108. package/mobile/dist/components/ApplicationForm/VerifyPhoneDialog.js +37 -0
  109. package/mobile/dist/components/ApplicationForm/VerifyPhoneDialog.js.map +1 -0
  110. package/mobile/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.d.ts +18 -0
  111. package/mobile/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.js +50 -0
  112. package/mobile/dist/components/ApplicationForm/useVerifyPhoneDialogSubmit.js.map +1 -0
  113. package/mobile/dist/components/TariffsTable/TariffsTableCell.d.ts +1 -1
  114. package/mobile/dist/retail/api/checkCode.d.ts +1 -9
  115. package/mobile/dist/retail/api/checkCode.js +1 -22
  116. package/mobile/dist/retail/api/checkCode.js.map +1 -1
  117. package/mobile/dist/retail/api/sendCode.d.ts +1 -1
  118. package/mobile/dist/retail/api/sendCode.js +2 -8
  119. package/mobile/dist/retail/api/sendCode.js.map +1 -1
  120. package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -4
  121. package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +5 -24
  122. package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  123. package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -6
  124. package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +7 -10
  125. package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  126. package/mobile/dist/retail/utils/mockLocalStorage.js +2 -2
  127. package/mobile/dist/retail/utils/mockLocalStorage.js.map +1 -1
  128. package/mobile/dist/ui-kit/BaseTile/BaseTile.js +1 -1
  129. package/mobile/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
  130. package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -1
  131. package/mobile/dist/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.d.ts +16 -0
  132. package/mobile/dist/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.js +17 -0
  133. package/mobile/dist/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.js.map +1 -0
  134. package/mobile/dist/utils/getTimer.d.ts +2 -0
  135. package/mobile/dist/utils/getTimer.js +6 -0
  136. package/mobile/dist/utils/getTimer.js.map +1 -0
  137. package/mobile/lib/api/LeadServiceAPI.d.ts +12 -3
  138. package/mobile/lib/api/LeadServiceAPI.js +0 -3
  139. package/mobile/lib/api/LeadServiceAPI.js.map +1 -1
  140. package/mobile/lib/common.css +1 -1
  141. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +1 -3
  142. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  143. package/mobile/lib/components/ApplicationForm/VerifyPhoneDialog.d.ts +10 -0
  144. package/mobile/lib/components/ApplicationForm/VerifyPhoneDialog.js +35 -0
  145. package/mobile/lib/components/ApplicationForm/VerifyPhoneDialog.js.map +1 -0
  146. package/mobile/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.d.ts +18 -0
  147. package/mobile/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.js +47 -0
  148. package/mobile/lib/components/ApplicationForm/useVerifyPhoneDialogSubmit.js.map +1 -0
  149. package/mobile/lib/components/TariffsTable/TariffsTableCell.d.ts +1 -1
  150. package/mobile/lib/retail/api/checkCode.d.ts +1 -9
  151. package/mobile/lib/retail/api/checkCode.js +1 -22
  152. package/mobile/lib/retail/api/checkCode.js.map +1 -1
  153. package/mobile/lib/retail/api/sendCode.d.ts +1 -1
  154. package/mobile/lib/retail/api/sendCode.js +1 -7
  155. package/mobile/lib/retail/api/sendCode.js.map +1 -1
  156. package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -4
  157. package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +5 -24
  158. package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  159. package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -6
  160. package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +5 -8
  161. package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  162. package/mobile/lib/retail/utils/mockLocalStorage.js +2 -2
  163. package/mobile/lib/retail/utils/mockLocalStorage.js.map +1 -1
  164. package/mobile/lib/ui-kit/BaseTile/BaseTile.js +1 -1
  165. package/mobile/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
  166. package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -1
  167. package/mobile/lib/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.d.ts +16 -0
  168. package/mobile/lib/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.js +15 -0
  169. package/mobile/lib/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.js.map +1 -0
  170. package/mobile/lib/utils/getTimer.d.ts +2 -0
  171. package/mobile/lib/utils/getTimer.js +3 -0
  172. package/mobile/lib/utils/getTimer.js.map +1 -0
  173. package/mobile/src/api/LeadServiceAPI.ts +13 -7
  174. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +1 -3
  175. package/mobile/src/components/ApplicationForm/VerifyPhoneDialog.tsx +73 -0
  176. package/mobile/src/components/ApplicationForm/useVerifyPhoneDialogSubmit.tsx +63 -0
  177. package/mobile/src/components/TariffsTable/TariffsTableCell.tsx +1 -1
  178. package/mobile/src/retail/api/checkCode.ts +2 -47
  179. package/mobile/src/retail/api/sendCode.ts +1 -9
  180. package/mobile/src/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.tsx +23 -82
  181. package/mobile/src/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +7 -21
  182. package/mobile/src/retail/utils/mockLocalStorage.ts +9 -15
  183. package/mobile/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
  184. package/mobile/src/ui-kit/ResponseTypeDialog/ResponseTypeDialog.tsx +1 -1
  185. package/mobile/src/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.tsx +80 -0
  186. package/mobile/src/utils/getTimer.ts +4 -0
  187. package/package.json +1 -1
  188. package/src/api/LeadServiceAPI.ts +13 -7
  189. package/src/components/ApplicationForm/ApplicationForm.tsx +1 -3
  190. package/src/components/ApplicationForm/VerifyPhoneDialog.tsx +73 -0
  191. package/src/components/ApplicationForm/useVerifyPhoneDialogSubmit.tsx +63 -0
  192. package/src/components/Carousel/Carousel.fixture.mobile.tsx +16 -16
  193. package/src/components/Carousel/Carousel.fixture.tsx +42 -20
  194. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.mobile.tsx +19 -19
  195. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +44 -23
  196. package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.tsx +12 -12
  197. package/src/components/TariffsTable/TariffsTableCell.tsx +1 -1
  198. package/src/icons/IconName.ts +4 -4
  199. package/src/retail/api/checkCode.ts +2 -47
  200. package/src/retail/api/sendCode.ts +1 -9
  201. package/src/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.tsx +23 -82
  202. package/src/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +7 -21
  203. package/src/retail/utils/mockLocalStorage.ts +9 -15
  204. package/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
  205. package/src/ui-kit/ResponseTypeDialog/ResponseTypeDialog.tsx +1 -1
  206. package/src/ui-kit/VerifyPhoneDialogLayout/VerfiyPhoneDialogLayout.tsx +80 -0
  207. package/src/utils/getTimer.ts +4 -0
  208. package/bundle/model/onClose.d.ts +0 -3
  209. package/dist/model/onClose.d.ts +0 -3
  210. package/dist/model/onClose.js +0 -2
  211. package/dist/model/onClose.js.map +0 -1
  212. package/lib/model/onClose.d.ts +0 -3
  213. package/lib/model/onClose.js +0 -2
  214. package/lib/model/onClose.js.map +0 -1
  215. package/mobile/bundle/model/onClose.d.ts +0 -3
  216. package/mobile/dist/model/onClose.d.ts +0 -3
  217. package/mobile/dist/model/onClose.js +0 -2
  218. package/mobile/dist/model/onClose.js.map +0 -1
  219. package/mobile/lib/model/onClose.d.ts +0 -3
  220. package/mobile/lib/model/onClose.js +0 -2
  221. package/mobile/lib/model/onClose.js.map +0 -1
  222. package/mobile/src/model/onClose.ts +0 -3
  223. 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 { type LeadRequest } from '../../../api/LeadServiceAPI';
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
- smsText: values.join(''),
55
- smsCodesSetName: { key: 'AUTHENTICATION' },
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
- await onSuccess?.(values.join(''));
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 && isRetail) {
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
- phoneNumber: PHONE,
19
- smsCodesSetName: { key: 'AUTHENTICATION' },
20
- },
21
- true,
22
- );
23
-
24
- await checkCode(
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="grow space-y-lg w-fit">
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/onClose';
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
+ );
@@ -0,0 +1,4 @@
1
+ export const TIME_TO_RESEND = 180;
2
+
3
+ export const getTimer = (sendTime: number) =>
4
+ TIME_TO_RESEND - Math.floor((Date.now() - sendTime) / 1000);
@@ -1,3 +0,0 @@
1
- export interface OnCloseProps {
2
- onClose?: () => void;
3
- }
@@ -1,3 +0,0 @@
1
- export interface OnCloseProps {
2
- onClose?: () => void;
3
- }
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- //# sourceMappingURL=onClose.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"onClose.js","sourceRoot":"","sources":["../../src/model/onClose.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- export interface OnCloseProps {
2
- onClose?: () => void;
3
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=onClose.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"onClose.js","sourceRoot":"","sources":["../../src/model/onClose.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- export interface OnCloseProps {
2
- onClose?: () => void;
3
- }
@@ -1,3 +0,0 @@
1
- export interface OnCloseProps {
2
- onClose?: () => void;
3
- }
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- //# sourceMappingURL=onClose.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"onClose.js","sourceRoot":"","sources":["../../src/model/onClose.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- export interface OnCloseProps {
2
- onClose?: () => void;
3
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=onClose.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"onClose.js","sourceRoot":"","sources":["../../src/model/onClose.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- export interface OnCloseProps {
2
- onClose?: () => void;
3
- }
@@ -1,3 +0,0 @@
1
- export interface OnCloseProps {
2
- onClose?: () => void;
3
- }