@alfalab/core-components-confirmation 12.3.4 → 12.4.0
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/{component-ad8387ce.d.ts → component-ad335d4a.d.ts} +0 -0
- package/{component-ad8387ce.js → component-ad335d4a.js} +9 -9
- package/component.desktop.js +8 -10
- package/component.mobile.js +10 -12
- package/component.responsive.d.ts +7 -1
- package/component.responsive.js +15 -16
- package/components/base-confirmation/component.js +7 -9
- package/components/base-confirmation/index.css +2 -2
- package/components/base-confirmation/index.d.ts +1 -1
- package/components/base-confirmation/index.js +5 -7
- package/components/countdown-loader/component.js +5 -7
- package/components/countdown-loader/index.css +2 -2
- package/components/countdown-loader/index.js +1 -3
- package/components/header/component.js +5 -7
- package/components/header/index.css +4 -4
- package/components/header/index.js +1 -3
- package/components/index.js +10 -12
- package/components/screens/fatal-error/component.js +10 -12
- package/components/screens/fatal-error/index.css +6 -6
- package/components/screens/fatal-error/index.js +3 -5
- package/components/screens/hint/component.js +18 -20
- package/components/screens/hint/index.css +12 -12
- package/components/screens/hint/index.js +3 -5
- package/components/screens/index.js +8 -10
- package/components/screens/initial/component.js +18 -15
- package/components/screens/initial/countdown-section.js +4 -6
- package/components/screens/initial/index.css +18 -18
- package/components/screens/initial/index.js +5 -7
- package/components/screens/temp-block/component.js +12 -14
- package/components/screens/temp-block/index.css +7 -7
- package/components/screens/temp-block/index.js +4 -6
- package/context.js +0 -2
- package/{countdown-section-f4894842.d.ts → countdown-section-6d91891a.d.ts} +0 -0
- package/countdown-section-6d91891a.js +49 -0
- package/cssm/{component-5a4af768.d.ts → component-3c591970.d.ts} +0 -0
- package/cssm/{component-5a4af768.js → component-3c591970.js} +9 -9
- package/cssm/component.desktop.js +12 -14
- package/cssm/component.mobile.js +15 -17
- package/cssm/component.responsive.d.ts +7 -1
- package/cssm/component.responsive.js +19 -20
- package/cssm/components/base-confirmation/component.js +10 -12
- package/cssm/components/base-confirmation/index.d.ts +1 -1
- package/cssm/components/base-confirmation/index.js +9 -11
- package/cssm/components/countdown-loader/component.js +5 -7
- package/cssm/components/countdown-loader/index.js +1 -3
- package/cssm/components/header/component.js +5 -7
- package/cssm/components/header/index.js +1 -3
- package/cssm/components/index.js +12 -14
- package/cssm/components/screens/fatal-error/component.js +11 -13
- package/cssm/components/screens/fatal-error/index.js +4 -6
- package/cssm/components/screens/hint/component.js +19 -21
- package/cssm/components/screens/hint/index.js +4 -6
- package/cssm/components/screens/index.js +10 -12
- package/cssm/components/screens/initial/component.js +21 -18
- package/cssm/components/screens/initial/countdown-section.js +18 -20
- package/cssm/components/screens/initial/index.js +6 -8
- package/cssm/components/screens/temp-block/component.js +14 -16
- package/cssm/components/screens/temp-block/index.js +6 -8
- package/cssm/context.js +0 -2
- package/cssm/desktop.d.ts +1 -0
- package/cssm/desktop.js +10 -12
- package/cssm/index.js +24 -26
- package/cssm/mobile.d.ts +1 -0
- package/cssm/mobile.js +10 -12
- package/cssm/responsive.d.ts +1 -0
- package/cssm/responsive.js +11 -13
- package/cssm/types.js +0 -2
- package/cssm/utils.js +6 -8
- package/desktop.d.ts +1 -0
- package/desktop.js +6 -8
- package/esm/{component-b1ceb5d0.d.ts → component-0eefd74d.d.ts} +0 -0
- package/esm/{component-b1ceb5d0.js → component-0eefd74d.js} +4 -4
- package/esm/component.desktop.js +5 -5
- package/esm/component.mobile.js +6 -6
- package/esm/component.responsive.d.ts +7 -1
- package/esm/component.responsive.js +13 -12
- package/esm/components/base-confirmation/component.js +7 -7
- package/esm/components/base-confirmation/index.css +2 -2
- package/esm/components/base-confirmation/index.d.ts +1 -1
- package/esm/components/base-confirmation/index.js +5 -5
- package/esm/components/countdown-loader/component.js +3 -3
- package/esm/components/countdown-loader/index.css +2 -2
- package/esm/components/countdown-loader/index.js +1 -1
- package/esm/components/header/component.js +1 -1
- package/esm/components/header/index.css +4 -4
- package/esm/components/header/index.js +1 -1
- package/esm/components/index.js +9 -9
- package/esm/components/screens/fatal-error/component.js +3 -3
- package/esm/components/screens/fatal-error/index.css +6 -6
- package/esm/components/screens/fatal-error/index.js +3 -3
- package/esm/components/screens/hint/component.js +3 -3
- package/esm/components/screens/hint/index.css +12 -12
- package/esm/components/screens/hint/index.js +3 -3
- package/esm/components/screens/index.js +8 -8
- package/esm/components/screens/initial/component.js +10 -5
- package/esm/components/screens/initial/countdown-section.js +4 -4
- package/esm/components/screens/initial/index.css +18 -18
- package/esm/components/screens/initial/index.js +5 -5
- package/esm/components/screens/temp-block/component.js +4 -4
- package/esm/components/screens/temp-block/index.css +7 -7
- package/esm/components/screens/temp-block/index.js +4 -4
- package/esm/{countdown-section-608e4e3a.d.ts → countdown-section-0837d1c0.d.ts} +0 -0
- package/esm/{countdown-section-608e4e3a.js → countdown-section-0837d1c0.js} +6 -6
- package/esm/desktop.d.ts +1 -0
- package/esm/desktop.js +6 -6
- package/esm/index.js +12 -12
- package/esm/mobile.css +2 -2
- package/esm/mobile.d.ts +1 -0
- package/esm/mobile.js +6 -6
- package/esm/responsive.d.ts +1 -0
- package/esm/responsive.js +6 -6
- package/esm/utils.js +6 -6
- package/index.js +21 -23
- package/mobile.css +2 -2
- package/mobile.d.ts +1 -0
- package/mobile.js +6 -8
- package/modern/component.desktop.js +5 -5
- package/modern/component.mobile.js +6 -6
- package/modern/component.responsive.d.ts +7 -1
- package/modern/component.responsive.js +12 -12
- package/modern/components/base-confirmation/component.js +8 -8
- package/modern/components/base-confirmation/index.css +2 -2
- package/modern/components/base-confirmation/index.js +5 -5
- package/modern/components/countdown-loader/component.js +1 -1
- package/modern/components/countdown-loader/index.css +2 -2
- package/modern/components/countdown-loader/index.js +1 -1
- package/modern/components/header/component.js +1 -1
- package/modern/components/header/index.css +4 -4
- package/modern/components/header/index.js +1 -1
- package/modern/components/index.js +9 -9
- package/modern/components/screens/fatal-error/component.js +3 -3
- package/modern/components/screens/fatal-error/index.css +6 -6
- package/modern/components/screens/fatal-error/index.js +3 -3
- package/modern/components/screens/hint/component.js +3 -3
- package/modern/components/screens/hint/index.css +12 -12
- package/modern/components/screens/hint/index.js +3 -3
- package/modern/components/screens/index.js +8 -8
- package/modern/components/screens/initial/component.js +10 -5
- package/modern/components/screens/initial/countdown-section.js +4 -4
- package/modern/components/screens/initial/index.css +18 -18
- package/modern/components/screens/initial/index.js +5 -5
- package/modern/components/screens/temp-block/component.js +4 -4
- package/modern/components/screens/temp-block/index.css +7 -7
- package/modern/components/screens/temp-block/index.js +4 -4
- package/modern/{countdown-section-cb87c8ea.d.ts → countdown-section-4c1f4500.d.ts} +0 -0
- package/modern/{countdown-section-cb87c8ea.js → countdown-section-4c1f4500.js} +5 -5
- package/modern/desktop.d.ts +1 -0
- package/modern/desktop.js +6 -6
- package/modern/index.js +12 -12
- package/modern/mobile.css +2 -2
- package/modern/mobile.d.ts +1 -0
- package/modern/mobile.js +6 -6
- package/modern/responsive.d.ts +1 -0
- package/modern/responsive.js +8 -8
- package/package.json +6 -6
- package/responsive.d.ts +1 -0
- package/responsive.js +6 -8
- package/types.js +0 -2
- package/utils.js +6 -8
- package/countdown-section-f4894842.js +0 -49
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
|
-
import { formatMsAsMinutes } from './utils.js';
|
|
4
|
-
import { ConfirmationContext } from './context.js';
|
|
5
3
|
import { Button } from '@alfalab/core-components-button/modern';
|
|
6
|
-
import { Typography } from '@alfalab/core-components-typography/modern';
|
|
7
4
|
import { Loader } from '@alfalab/core-components-loader/modern';
|
|
5
|
+
import { Typography } from '@alfalab/core-components-typography/modern';
|
|
6
|
+
import { ConfirmationContext } from './context.js';
|
|
7
|
+
import { formatMsAsMinutes } from './utils.js';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const styles = {"component":"confirmation__component_uowal","typographyTheme":"confirmation__typographyTheme_uowal","phone":"confirmation__phone_uowal","compact":"confirmation__compact_uowal","loaderWrap":"confirmation__loaderWrap_uowal","left":"confirmation__left_uowal","center":"confirmation__center_uowal","codeInput":"confirmation__codeInput_uowal","smsComeLink":"confirmation__smsComeLink_uowal","countdownContainer":"confirmation__countdownContainer_uowal","countdownMobile":"confirmation__countdownMobile_uowal","countdownLoaderMobile":"confirmation__countdownLoaderMobile_uowal","getCodeButton":"confirmation__getCodeButton_uowal","getCodeButtonMobile":"confirmation__getCodeButtonMobile_uowal","containerInput":"confirmation__containerInput_uowal"};
|
|
10
10
|
require('./components/screens/initial/index.css')
|
|
11
11
|
|
|
12
12
|
const CountdownSection = ({ codeSendHintVisible, timePassed, processing, mobile, handleSmsRetryClick, }) => {
|
|
@@ -26,7 +26,7 @@ const CountdownSection = ({ codeSendHintVisible, timePassed, processing, mobile,
|
|
|
26
26
|
React.createElement("span", { className: styles.loaderText }, state === 'CODE_CHECKING' ? texts.codeChecking : texts.codeSending)));
|
|
27
27
|
}
|
|
28
28
|
if (blockSmsRetry)
|
|
29
|
-
renderText(texts.noAttemptsLeft);
|
|
29
|
+
return renderText(texts.noAttemptsLeft);
|
|
30
30
|
if (timePassed) {
|
|
31
31
|
return (React.createElement(Button, { size: mobile ? 'xs' : 'xxs', view: 'secondary', onClick: handleSmsRetryClick, className: cn(styles.getCodeButton, { [styles.getCodeButtonMobile]: mobile }) }, texts.buttonRetry));
|
|
32
32
|
}
|
package/modern/desktop.d.ts
CHANGED
package/modern/desktop.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
+
export { ConfirmationDesktop } from './component.desktop.js';
|
|
1
2
|
import 'react';
|
|
3
|
+
import './components/base-confirmation/component.js';
|
|
2
4
|
import 'classnames';
|
|
3
5
|
import '@alfalab/hooks';
|
|
4
|
-
import './utils.js';
|
|
5
6
|
import './context.js';
|
|
7
|
+
import './utils.js';
|
|
6
8
|
import './types.js';
|
|
9
|
+
import './components/screens/initial/component.js';
|
|
7
10
|
import '@alfalab/core-components-button/modern';
|
|
8
11
|
import '@alfalab/core-components-code-input/modern';
|
|
9
12
|
import '@alfalab/core-components-link/modern';
|
|
10
13
|
import '@alfalab/core-components-typography/modern';
|
|
11
14
|
import './components/header/component.js';
|
|
15
|
+
import './countdown-section-4c1f4500.js';
|
|
12
16
|
import '@alfalab/core-components-loader/modern';
|
|
13
|
-
import './countdown-section-cb87c8ea.js';
|
|
14
|
-
import './components/screens/initial/component.js';
|
|
15
17
|
import './components/screens/hint/component.js';
|
|
16
18
|
import './components/screens/fatal-error/component.js';
|
|
17
|
-
import './components/countdown-loader/component.js';
|
|
18
19
|
import './components/screens/temp-block/component.js';
|
|
19
|
-
import './components/
|
|
20
|
-
export { ConfirmationDesktop } from './component.desktop.js';
|
|
20
|
+
import './components/countdown-loader/component.js';
|
package/modern/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
+
export { ConfirmationDesktop as Confirmation } from './component.desktop.js';
|
|
2
|
+
export { ConfirmationResponsive } from './component.responsive.js';
|
|
3
|
+
export { Initial } from './components/screens/initial/component.js';
|
|
4
|
+
export { Hint } from './components/screens/hint/component.js';
|
|
5
|
+
export { FatalError } from './components/screens/fatal-error/component.js';
|
|
6
|
+
export { TempBlock } from './components/screens/temp-block/component.js';
|
|
7
|
+
export { CountdownLoader } from './components/countdown-loader/component.js';
|
|
8
|
+
export { ConfirmationContext } from './context.js';
|
|
9
|
+
export { defaultTexts } from './types.js';
|
|
10
|
+
export { ONE_DAY, ONE_MINUTE, formatMsAsMinutes, useConfirmation, useCountdown } from './utils.js';
|
|
1
11
|
import 'react';
|
|
12
|
+
import './components/base-confirmation/component.js';
|
|
2
13
|
import 'classnames';
|
|
3
14
|
import '@alfalab/hooks';
|
|
4
|
-
export { ONE_DAY, ONE_MINUTE, formatMsAsMinutes, useConfirmation, useCountdown } from './utils.js';
|
|
5
|
-
export { ConfirmationContext } from './context.js';
|
|
6
|
-
export { defaultTexts } from './types.js';
|
|
7
15
|
import '@alfalab/core-components-button/modern';
|
|
8
16
|
import '@alfalab/core-components-code-input/modern';
|
|
9
17
|
import '@alfalab/core-components-link/modern';
|
|
10
18
|
import '@alfalab/core-components-typography/modern';
|
|
11
19
|
import './components/header/component.js';
|
|
20
|
+
import './countdown-section-4c1f4500.js';
|
|
12
21
|
import '@alfalab/core-components-loader/modern';
|
|
13
|
-
import './countdown-section-cb87c8ea.js';
|
|
14
|
-
export { Initial } from './components/screens/initial/component.js';
|
|
15
|
-
export { Hint } from './components/screens/hint/component.js';
|
|
16
|
-
export { FatalError } from './components/screens/fatal-error/component.js';
|
|
17
|
-
export { CountdownLoader } from './components/countdown-loader/component.js';
|
|
18
|
-
export { TempBlock } from './components/screens/temp-block/component.js';
|
|
19
|
-
import './components/base-confirmation/component.js';
|
|
20
|
-
export { ConfirmationDesktop as Confirmation } from './component.desktop.js';
|
|
21
22
|
import './component.mobile.js';
|
|
22
|
-
export { ConfirmationResponsive } from './component.responsive.js';
|
package/modern/mobile.css
CHANGED
package/modern/mobile.d.ts
CHANGED
package/modern/mobile.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
+
export { ConfirmationMobile } from './component.mobile.js';
|
|
1
2
|
import 'react';
|
|
2
3
|
import 'classnames';
|
|
4
|
+
import './components/base-confirmation/component.js';
|
|
3
5
|
import '@alfalab/hooks';
|
|
4
|
-
import './utils.js';
|
|
5
6
|
import './context.js';
|
|
7
|
+
import './utils.js';
|
|
6
8
|
import './types.js';
|
|
9
|
+
import './components/screens/initial/component.js';
|
|
7
10
|
import '@alfalab/core-components-button/modern';
|
|
8
11
|
import '@alfalab/core-components-code-input/modern';
|
|
9
12
|
import '@alfalab/core-components-link/modern';
|
|
10
13
|
import '@alfalab/core-components-typography/modern';
|
|
11
14
|
import './components/header/component.js';
|
|
15
|
+
import './countdown-section-4c1f4500.js';
|
|
12
16
|
import '@alfalab/core-components-loader/modern';
|
|
13
|
-
import './countdown-section-cb87c8ea.js';
|
|
14
|
-
import './components/screens/initial/component.js';
|
|
15
17
|
import './components/screens/hint/component.js';
|
|
16
18
|
import './components/screens/fatal-error/component.js';
|
|
17
|
-
import './components/countdown-loader/component.js';
|
|
18
19
|
import './components/screens/temp-block/component.js';
|
|
19
|
-
import './components/
|
|
20
|
-
export { ConfirmationMobile } from './component.mobile.js';
|
|
20
|
+
import './components/countdown-loader/component.js';
|
package/modern/responsive.d.ts
CHANGED
package/modern/responsive.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
+
export { ConfirmationResponsive } from './component.responsive.js';
|
|
1
2
|
import 'react';
|
|
2
|
-
import 'classnames';
|
|
3
3
|
import '@alfalab/hooks';
|
|
4
|
-
import './
|
|
4
|
+
import './component.desktop.js';
|
|
5
|
+
import './components/base-confirmation/component.js';
|
|
6
|
+
import 'classnames';
|
|
5
7
|
import './context.js';
|
|
8
|
+
import './utils.js';
|
|
6
9
|
import './types.js';
|
|
10
|
+
import './components/screens/initial/component.js';
|
|
7
11
|
import '@alfalab/core-components-button/modern';
|
|
8
12
|
import '@alfalab/core-components-code-input/modern';
|
|
9
13
|
import '@alfalab/core-components-link/modern';
|
|
10
14
|
import '@alfalab/core-components-typography/modern';
|
|
11
15
|
import './components/header/component.js';
|
|
16
|
+
import './countdown-section-4c1f4500.js';
|
|
12
17
|
import '@alfalab/core-components-loader/modern';
|
|
13
|
-
import './countdown-section-cb87c8ea.js';
|
|
14
|
-
import './components/screens/initial/component.js';
|
|
15
18
|
import './components/screens/hint/component.js';
|
|
16
19
|
import './components/screens/fatal-error/component.js';
|
|
17
|
-
import './components/countdown-loader/component.js';
|
|
18
20
|
import './components/screens/temp-block/component.js';
|
|
19
|
-
import './components/
|
|
20
|
-
import './component.desktop.js';
|
|
21
|
+
import './components/countdown-loader/component.js';
|
|
21
22
|
import './component.mobile.js';
|
|
22
|
-
export { ConfirmationResponsive } from './component.responsive.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-confirmation",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.4.0",
|
|
4
4
|
"description": "Sms confirmation component",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"directory": "dist"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@alfalab/core-components-button": "^7.0.
|
|
18
|
-
"@alfalab/core-components-code-input": "^2.
|
|
19
|
-
"@alfalab/core-components-link": "^5.0.
|
|
20
|
-
"@alfalab/core-components-loader": "^3.0.
|
|
21
|
-
"@alfalab/core-components-typography": "^3.0.
|
|
17
|
+
"@alfalab/core-components-button": "^7.0.2",
|
|
18
|
+
"@alfalab/core-components-code-input": "^2.3.1",
|
|
19
|
+
"@alfalab/core-components-link": "^5.0.2",
|
|
20
|
+
"@alfalab/core-components-loader": "^3.0.4",
|
|
21
|
+
"@alfalab/core-components-typography": "^3.0.7",
|
|
22
22
|
"@alfalab/hooks": "^1.4.1",
|
|
23
23
|
"@alfalab/icons-glyph": "^2.71.0",
|
|
24
24
|
"@alfalab/utils": "^1.13.3",
|
package/responsive.d.ts
CHANGED
package/responsive.js
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
require('./component-ad8387ce.js');
|
|
3
|
+
var component_responsive = require('./component.responsive.js');
|
|
4
|
+
require('./component-ad335d4a.js');
|
|
6
5
|
require('react');
|
|
7
6
|
require('classnames');
|
|
8
7
|
require('@alfalab/hooks');
|
|
9
|
-
require('./utils.js');
|
|
10
8
|
require('./context.js');
|
|
9
|
+
require('./utils.js');
|
|
11
10
|
require('./types.js');
|
|
11
|
+
require('./components/screens/initial/component.js');
|
|
12
12
|
require('@alfalab/core-components-button');
|
|
13
13
|
require('@alfalab/core-components-code-input');
|
|
14
14
|
require('@alfalab/core-components-link');
|
|
15
15
|
require('@alfalab/core-components-typography');
|
|
16
16
|
require('./components/header/component.js');
|
|
17
|
+
require('./countdown-section-6d91891a.js');
|
|
17
18
|
require('@alfalab/core-components-loader');
|
|
18
|
-
require('./countdown-section-f4894842.js');
|
|
19
|
-
require('./components/screens/initial/component.js');
|
|
20
19
|
require('./components/screens/hint/component.js');
|
|
21
20
|
require('./components/screens/fatal-error/component.js');
|
|
22
|
-
require('./components/countdown-loader/component.js');
|
|
23
21
|
require('./components/screens/temp-block/component.js');
|
|
22
|
+
require('./components/countdown-loader/component.js');
|
|
24
23
|
require('./component.desktop.js');
|
|
25
24
|
require('./component.mobile.js');
|
|
26
|
-
var component_responsive = require('./component.responsive.js');
|
|
27
25
|
|
|
28
26
|
|
|
29
27
|
|
package/types.js
CHANGED
package/utils.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var React = require('react');
|
|
6
4
|
|
|
7
5
|
/**
|
|
@@ -15,15 +13,15 @@ function formatMsAsMinutes(ms) {
|
|
|
15
13
|
var totalMinutes = Math.floor(totalSeconds / 60);
|
|
16
14
|
var totalHours = Math.floor(totalMinutes / 60);
|
|
17
15
|
var seconds = totalSeconds % 60;
|
|
18
|
-
var paddedSeconds =
|
|
16
|
+
var paddedSeconds = "00".concat(seconds).slice(-2);
|
|
19
17
|
if (totalHours > 0) {
|
|
20
18
|
var minutes = totalMinutes % 60;
|
|
21
|
-
var paddedMinutes_1 =
|
|
22
|
-
var paddedHours =
|
|
23
|
-
return paddedHours
|
|
19
|
+
var paddedMinutes_1 = "00".concat(minutes).slice(-2);
|
|
20
|
+
var paddedHours = "00".concat(totalHours).slice(-2);
|
|
21
|
+
return "".concat(paddedHours, ":").concat(paddedMinutes_1, ":").concat(paddedSeconds);
|
|
24
22
|
}
|
|
25
|
-
var paddedMinutes =
|
|
26
|
-
return paddedMinutes
|
|
23
|
+
var paddedMinutes = "00".concat(totalMinutes).slice(-2);
|
|
24
|
+
return "".concat(paddedMinutes, ":").concat(paddedSeconds);
|
|
27
25
|
}
|
|
28
26
|
/**
|
|
29
27
|
* Возвращает время, которое осталось до истечения таймера в ms
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
var cn = require('classnames');
|
|
5
|
-
var utils = require('./utils.js');
|
|
6
|
-
var context = require('./context.js');
|
|
7
|
-
var coreComponentsButton = require('@alfalab/core-components-button');
|
|
8
|
-
var coreComponentsTypography = require('@alfalab/core-components-typography');
|
|
9
|
-
var coreComponentsLoader = require('@alfalab/core-components-loader');
|
|
10
|
-
|
|
11
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
-
|
|
13
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
-
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
15
|
-
|
|
16
|
-
var styles = {"component":"confirmation__component_17tyk","typographyTheme":"confirmation__typographyTheme_17tyk","phone":"confirmation__phone_17tyk","compact":"confirmation__compact_17tyk","loaderWrap":"confirmation__loaderWrap_17tyk","left":"confirmation__left_17tyk","center":"confirmation__center_17tyk","codeInput":"confirmation__codeInput_17tyk","smsComeLink":"confirmation__smsComeLink_17tyk","countdownContainer":"confirmation__countdownContainer_17tyk","countdownMobile":"confirmation__countdownMobile_17tyk","countdownLoaderMobile":"confirmation__countdownLoaderMobile_17tyk","getCodeButton":"confirmation__getCodeButton_17tyk","getCodeButtonMobile":"confirmation__getCodeButtonMobile_17tyk","containerInput":"confirmation__containerInput_17tyk"};
|
|
17
|
-
require('./components/screens/initial/index.css')
|
|
18
|
-
|
|
19
|
-
var CountdownSection = function (_a) {
|
|
20
|
-
var _b, _c;
|
|
21
|
-
var codeSendHintVisible = _a.codeSendHintVisible, timePassed = _a.timePassed, processing = _a.processing, mobile = _a.mobile, handleSmsRetryClick = _a.handleSmsRetryClick;
|
|
22
|
-
var _d = React.useContext(context.ConfirmationContext), state = _d.state, texts = _d.texts, timeLeft = _d.timeLeft, blockSmsRetry = _d.blockSmsRetry;
|
|
23
|
-
var renderText = function (text) {
|
|
24
|
-
var _a;
|
|
25
|
-
return (React__default['default'].createElement(coreComponentsTypography.Typography.Text, { className: cn__default['default'](styles.countdownContainer, (_a = {},
|
|
26
|
-
_a[styles.countdownMobile] = mobile,
|
|
27
|
-
_a[styles.typographyTheme] = !mobile,
|
|
28
|
-
_a)), view: mobile ? 'primary-small' : 'primary-medium', tag: 'div' }, text));
|
|
29
|
-
};
|
|
30
|
-
if (codeSendHintVisible)
|
|
31
|
-
return renderText(texts.codeSended);
|
|
32
|
-
if (processing) {
|
|
33
|
-
return (React__default['default'].createElement("div", { className: cn__default['default'](styles.loaderWrap, styles.countdownContainer, (_b = {},
|
|
34
|
-
_b[styles.countdownLoaderMobile] = mobile,
|
|
35
|
-
_b[styles.typographyTheme] = !mobile,
|
|
36
|
-
_b)) },
|
|
37
|
-
React__default['default'].createElement(coreComponentsLoader.Loader, null),
|
|
38
|
-
React__default['default'].createElement("span", { className: styles.loaderText }, state === 'CODE_CHECKING' ? texts.codeChecking : texts.codeSending)));
|
|
39
|
-
}
|
|
40
|
-
if (blockSmsRetry)
|
|
41
|
-
renderText(texts.noAttemptsLeft);
|
|
42
|
-
if (timePassed) {
|
|
43
|
-
return (React__default['default'].createElement(coreComponentsButton.Button, { size: mobile ? 'xs' : 'xxs', view: 'secondary', onClick: handleSmsRetryClick, className: cn__default['default'](styles.getCodeButton, (_c = {}, _c[styles.getCodeButtonMobile] = mobile, _c)) }, texts.buttonRetry));
|
|
44
|
-
}
|
|
45
|
-
return renderText(texts.countdown + " " + utils.formatMsAsMinutes(timeLeft));
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
exports.CountdownSection = CountdownSection;
|
|
49
|
-
exports.styles = styles;
|