@redneckz/wildless-cms-uni-blocks 0.13.16 → 0.13.17
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/bin/migration-scripts/0.13.13.js +34 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +13 -21
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/CalculatorContent.d.ts +1 -3
- package/bundle/components/Carousel/Carousel.d.ts +0 -1
- package/bundle/components/Carousel/CarouselContent.d.ts +2 -0
- package/bundle/components/ErrorBlock/ErrorBlockContent.d.ts +4 -4
- package/dist/components/Blocks.mobile.js +2 -0
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/Calculator/CalculatorContent.d.ts +1 -3
- package/dist/components/Calculator/RefinancingCalculatorForm.js +2 -3
- package/dist/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/checkRefinancingSourceBookRowCommonParams.js +0 -5
- package/dist/components/Calculator/checkRefinancingSourceBookRowCommonParams.js.map +1 -1
- package/dist/components/Calculator/getRefinancingCalculatorRateParams.js +1 -1
- package/dist/components/Calculator/getRefinancingCalculatorRateParams.js.map +1 -1
- package/dist/components/Calculator/useRefinancingCalculatorParams.js +3 -0
- package/dist/components/Calculator/useRefinancingCalculatorParams.js.map +1 -1
- package/dist/components/Carousel/Carousel.d.ts +0 -1
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/Carousel/CarouselContent.d.ts +2 -0
- package/dist/components/ContentPage/ContentPage.js +1 -1
- package/dist/components/ContentPage/ContentPage.js.map +1 -1
- package/dist/components/ErrorBlock/ErrorBlock.js +3 -4
- package/dist/components/ErrorBlock/ErrorBlock.js.map +1 -1
- package/dist/components/ErrorBlock/ErrorBlockContent.d.ts +4 -4
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +1 -1
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/dist/ui-kit/Button/ButtonInner.js +1 -5
- package/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Blocks.mobile.js +2 -0
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/Calculator/CalculatorContent.d.ts +1 -3
- package/lib/components/Calculator/RefinancingCalculatorForm.js +2 -3
- package/lib/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/checkRefinancingSourceBookRowCommonParams.js +0 -5
- package/lib/components/Calculator/checkRefinancingSourceBookRowCommonParams.js.map +1 -1
- package/lib/components/Calculator/getRefinancingCalculatorRateParams.js +1 -1
- package/lib/components/Calculator/getRefinancingCalculatorRateParams.js.map +1 -1
- package/lib/components/Calculator/useRefinancingCalculatorParams.js +3 -0
- package/lib/components/Calculator/useRefinancingCalculatorParams.js.map +1 -1
- package/lib/components/Carousel/Carousel.d.ts +0 -1
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/Carousel/CarouselContent.d.ts +2 -0
- package/lib/components/ContentPage/ContentPage.js +1 -1
- package/lib/components/ContentPage/ContentPage.js.map +1 -1
- package/lib/components/ErrorBlock/ErrorBlock.fixture.mobile.d.ts +7 -0
- package/lib/components/ErrorBlock/ErrorBlock.js +3 -4
- package/lib/components/ErrorBlock/ErrorBlock.js.map +1 -1
- package/lib/components/ErrorBlock/ErrorBlockContent.d.ts +4 -4
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +1 -1
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/lib/ui-kit/Button/ButtonInner.js +1 -5
- package/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +22 -17
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/CalculatorContent.d.ts +1 -3
- package/mobile/bundle/components/Carousel/Carousel.d.ts +0 -1
- package/mobile/bundle/components/Carousel/CarouselContent.d.ts +2 -0
- package/mobile/bundle/components/ErrorBlock/ErrorBlockContent.d.ts +4 -4
- package/mobile/dist/components/Blocks.js +2 -0
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/Calculator/CalculatorContent.d.ts +1 -3
- package/mobile/dist/components/Calculator/RefinancingCalculatorForm.js +2 -3
- package/mobile/dist/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/checkRefinancingSourceBookRowCommonParams.js +0 -5
- package/mobile/dist/components/Calculator/checkRefinancingSourceBookRowCommonParams.js.map +1 -1
- package/mobile/dist/components/Calculator/getRefinancingCalculatorRateParams.js +1 -1
- package/mobile/dist/components/Calculator/getRefinancingCalculatorRateParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useRefinancingCalculatorParams.js +3 -0
- package/mobile/dist/components/Calculator/useRefinancingCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Carousel/Carousel.d.ts +0 -1
- package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
- package/mobile/dist/components/Carousel/CarouselContent.d.ts +2 -0
- package/mobile/dist/components/ContentPage/ContentPage.js +1 -1
- package/mobile/dist/components/ContentPage/ContentPage.js.map +1 -1
- package/mobile/dist/components/ErrorBlock/ErrorBlock.js +3 -4
- package/mobile/dist/components/ErrorBlock/ErrorBlock.js.map +1 -1
- package/mobile/dist/components/ErrorBlock/ErrorBlockContent.d.ts +4 -4
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +1 -1
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/mobile/dist/ui-kit/Button/ButtonInner.js +1 -5
- package/mobile/dist/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/Blocks.js +2 -0
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/Calculator/CalculatorContent.d.ts +1 -3
- package/mobile/lib/components/Calculator/RefinancingCalculatorForm.js +2 -3
- package/mobile/lib/components/Calculator/RefinancingCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/checkRefinancingSourceBookRowCommonParams.js +0 -5
- package/mobile/lib/components/Calculator/checkRefinancingSourceBookRowCommonParams.js.map +1 -1
- package/mobile/lib/components/Calculator/getRefinancingCalculatorRateParams.js +1 -1
- package/mobile/lib/components/Calculator/getRefinancingCalculatorRateParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useRefinancingCalculatorParams.js +3 -0
- package/mobile/lib/components/Calculator/useRefinancingCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Carousel/Carousel.d.ts +0 -1
- package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
- package/mobile/lib/components/Carousel/CarouselContent.d.ts +2 -0
- package/mobile/lib/components/ContentPage/ContentPage.js +1 -1
- package/mobile/lib/components/ContentPage/ContentPage.js.map +1 -1
- package/mobile/lib/components/ErrorBlock/ErrorBlock.js +3 -4
- package/mobile/lib/components/ErrorBlock/ErrorBlock.js.map +1 -1
- package/mobile/lib/components/ErrorBlock/ErrorBlockContent.d.ts +4 -4
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +1 -1
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -1
- package/mobile/lib/ui-kit/Button/ButtonInner.js +1 -5
- package/mobile/lib/ui-kit/Button/ButtonInner.js.map +1 -1
- package/mobile/src/components/Blocks.ts +2 -0
- package/mobile/src/components/Calculator/CalculatorContent.ts +1 -3
- package/mobile/src/components/Calculator/RefinancingCalculatorForm.tsx +6 -9
- package/mobile/src/components/Calculator/checkRefinancingSourceBookRowCommonParams.ts +0 -5
- package/mobile/src/components/Calculator/getRefinancingCalculatorRateParams.ts +1 -1
- package/mobile/src/components/Calculator/useRefinancingCalculatorParams.ts +8 -0
- package/mobile/src/components/Carousel/Carousel.tsx +0 -1
- package/mobile/src/components/Carousel/CarouselContent.ts +2 -0
- package/mobile/src/components/ContentPage/ContentPage.tsx +1 -1
- package/mobile/src/components/ErrorBlock/ErrorBlock.example.json +2 -2
- package/mobile/src/components/ErrorBlock/ErrorBlock.tsx +8 -14
- package/mobile/src/components/ErrorBlock/ErrorBlock.ui.json +1 -1
- package/mobile/src/components/ErrorBlock/ErrorBlockContent.ts +4 -4
- package/mobile/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +1 -5
- package/mobile/src/ui-kit/Button/ButtonInner.tsx +2 -2
- package/package.json +1 -1
- package/src/components/Blocks.mobile.ts +2 -0
- package/src/components/Calculator/Calculator.fixture.tsx +0 -1
- package/src/components/Calculator/CalculatorContent.ts +1 -3
- package/src/components/Calculator/RefinancingCalculatorForm.tsx +6 -9
- package/src/components/Calculator/checkRefinancingSourceBookRowCommonParams.ts +0 -5
- package/src/components/Calculator/getRefinancingCalculatorRateParams.ts +1 -1
- package/src/components/Calculator/useRefinancingCalculatorParams.ts +8 -0
- package/src/components/Carousel/Carousel.tsx +0 -1
- package/src/components/Carousel/CarouselContent.ts +2 -0
- package/src/components/ContentPage/ContentPage.tsx +1 -1
- package/src/components/ErrorBlock/ErrorBlock.example.json +2 -2
- package/src/components/ErrorBlock/ErrorBlock.fixture.mobile.tsx +52 -0
- package/src/components/ErrorBlock/ErrorBlock.fixture.tsx +4 -4
- package/src/components/ErrorBlock/ErrorBlock.tsx +8 -14
- package/src/components/ErrorBlock/ErrorBlock.ui.json +1 -1
- package/src/components/ErrorBlock/ErrorBlockContent.ts +4 -4
- package/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +1 -5
- package/src/ui-kit/Button/ButtonInner.tsx +2 -2
|
@@ -30,11 +30,11 @@ const getButtonStyle = (props: ButtonContent) => {
|
|
|
30
30
|
|
|
31
31
|
const withTextStyle = `${aboveText ? 'py-2.5 px-9' : 'py-4 px-9'}`;
|
|
32
32
|
|
|
33
|
-
return
|
|
33
|
+
return style(
|
|
34
34
|
'group/btn items-center justify-center',
|
|
35
35
|
isWithText(props) ? withTextStyle : 'h-12 w-12',
|
|
36
36
|
rounded ? 'rounded-full' : '',
|
|
37
|
-
|
|
37
|
+
);
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
const isWithText = ({ text, aboveText, appendLeft }: ButtonProps) =>
|
package/package.json
CHANGED
|
@@ -16,6 +16,7 @@ import { CarouselProgramsCard } from './CarouselProgramsCard/CarouselProgramsCar
|
|
|
16
16
|
import { CarouselRecommendationCard } from './CarouselRecommendationCard/CarouselRecommendationCard';
|
|
17
17
|
import { CarouselTariffsCard } from './CarouselTariffsCard/CarouselTariffsCard';
|
|
18
18
|
import { ComparisonTable } from './ComparisonTable/ComparisonTable';
|
|
19
|
+
import { ErrorBlock } from './ErrorBlock/ErrorBlock';
|
|
19
20
|
import { ExchangeRateTile } from './ExchangeRateTile/ExchangeRateTile';
|
|
20
21
|
import { Footer } from './Footer/Footer';
|
|
21
22
|
import { Header } from './Header/Header';
|
|
@@ -59,6 +60,7 @@ export const Blocks: BlocksRegistry = {
|
|
|
59
60
|
CarouselRecommendationCard,
|
|
60
61
|
CarouselTariffsCard,
|
|
61
62
|
ComparisonTable,
|
|
63
|
+
ErrorBlock,
|
|
62
64
|
ExchangeRateTile,
|
|
63
65
|
Footer,
|
|
64
66
|
Header,
|
|
@@ -26,8 +26,6 @@ export interface RefinancingCalculatorParamsViewSettings {
|
|
|
26
26
|
isShowSalaryClient?: boolean;
|
|
27
27
|
/** @title Комплексная страховая защита */
|
|
28
28
|
isShowInsurance?: boolean;
|
|
29
|
-
/** @title Получить дополнительную сумму */
|
|
30
|
-
isShowExtraMoney?: boolean;
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
export interface DepositCalculatorParamsViewSettings {
|
|
@@ -118,7 +116,7 @@ export type BonusCalculatorParamsDef = TitleProps &
|
|
|
118
116
|
|
|
119
117
|
/**
|
|
120
118
|
* @title Калькулятор рефинансирования
|
|
121
|
-
* @default {"calcType": "
|
|
119
|
+
* @default {"calcType": "RefinancingCalculatorForm"}
|
|
122
120
|
*/
|
|
123
121
|
export type RefinancingCalculatorParamsDef = TitleProps &
|
|
124
122
|
RefinancingCalculatorProps & {
|
|
@@ -54,13 +54,12 @@ export const RefinancingCalculatorForm = JSX<RefinancingCalculatorProp>(
|
|
|
54
54
|
title: 'Остаток долга в других банках, ₽ ',
|
|
55
55
|
step: 500,
|
|
56
56
|
min: calculatorParams.minSum,
|
|
57
|
-
max: calculatorParams.maxSum,
|
|
57
|
+
max: calculatorParams.maxSum - calculatorParams.maxSumExtra,
|
|
58
58
|
...field('moneyValue'),
|
|
59
59
|
value: calculatorParams.moneyValue,
|
|
60
60
|
})}
|
|
61
61
|
{renderWantedSumInput({
|
|
62
62
|
title: 'Ежемесячный платеж в других банках, ₽',
|
|
63
|
-
isShowItems: false,
|
|
64
63
|
step: 500,
|
|
65
64
|
min: calculatorParams.minSumOld,
|
|
66
65
|
max: calculatorParams.maxSumOld,
|
|
@@ -131,12 +130,10 @@ const renderCreditParamsForm = (
|
|
|
131
130
|
value={params.isInsurance}
|
|
132
131
|
/>
|
|
133
132
|
) : null}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
/>
|
|
140
|
-
) : null}
|
|
133
|
+
<Checkbox
|
|
134
|
+
text="Получить дополнительную сумму"
|
|
135
|
+
{...field('isExtraMoney')}
|
|
136
|
+
value={params.isExtraMoney}
|
|
137
|
+
/>
|
|
141
138
|
</div>
|
|
142
139
|
);
|
|
@@ -25,11 +25,6 @@ export const checkRefinancingSourceBookRowCommonParams = (props: CheckSourceBook
|
|
|
25
25
|
...props,
|
|
26
26
|
fieldKey: 'isInsurance',
|
|
27
27
|
viewSettingFieldKey: 'isShowInsurance',
|
|
28
|
-
}) &&
|
|
29
|
-
checkRowParam({
|
|
30
|
-
...props,
|
|
31
|
-
fieldKey: 'isExtraMoney',
|
|
32
|
-
viewSettingFieldKey: 'isShowExtraMoney',
|
|
33
28
|
});
|
|
34
29
|
|
|
35
30
|
const checkRowParam = ({
|
|
@@ -33,7 +33,7 @@ export const getRefinancingCalculatorRateParams = ({
|
|
|
33
33
|
userInputParams,
|
|
34
34
|
paramsViewSettings,
|
|
35
35
|
}) &&
|
|
36
|
-
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], row) &&
|
|
36
|
+
checkRangeByKeys(moneyValue + moneyExtra, ['minSum', 'maxSum'], row) &&
|
|
37
37
|
checkRangeByKeys(oldMonthlyPayment, ['minSumOld', 'maxSumOld'], row) &&
|
|
38
38
|
checkRangeByKeys(moneyExtra, ['minSumExtra', 'maxSumExtra'], row) &&
|
|
39
39
|
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], row),
|
|
@@ -78,6 +78,12 @@ export const useRefinancingCalculatorParams = (
|
|
|
78
78
|
rateRows,
|
|
79
79
|
);
|
|
80
80
|
|
|
81
|
+
const { minSumOld, maxSumOld } = getLimitRangeByKeys(
|
|
82
|
+
['minSumOld', 'maxSumOld'],
|
|
83
|
+
sourceBookLimitParams,
|
|
84
|
+
rateRows,
|
|
85
|
+
);
|
|
86
|
+
|
|
81
87
|
const { minMonths, maxMonths } = getLimitRangeByKeys(
|
|
82
88
|
['minMonths', 'maxMonths'],
|
|
83
89
|
sourceBookLimitParams,
|
|
@@ -104,6 +110,8 @@ export const useRefinancingCalculatorParams = (
|
|
|
104
110
|
...userInputParams,
|
|
105
111
|
minSum,
|
|
106
112
|
maxSum,
|
|
113
|
+
minSumOld,
|
|
114
|
+
maxSumOld,
|
|
107
115
|
minMonths,
|
|
108
116
|
maxMonths,
|
|
109
117
|
moneyValue,
|
|
@@ -13,7 +13,6 @@ import { renderCarouselCards } from './renderCarouselCards';
|
|
|
13
13
|
|
|
14
14
|
export interface CarouselProps extends CarouselContent, UniBlockProps {
|
|
15
15
|
itemCount?: number;
|
|
16
|
-
showDots?: boolean;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
export const Carousel: JSXBlock<CarouselProps> = JSX<CarouselProps>(
|
|
@@ -44,7 +44,7 @@ export const ContentPage: JSXBlock<ContentPageProps> = JSX<ContentPageProps>(
|
|
|
44
44
|
{renderBlocksList(slots?.header, { ...options, slotName: 'header' })}
|
|
45
45
|
</div>
|
|
46
46
|
) : null}
|
|
47
|
-
<div className="container @lg:grid @lg:grid-cols-12 @lg:gap-2xs">
|
|
47
|
+
<div className="container space-y-px @lg:space-y-0 @lg:grid @lg:grid-cols-12 @lg:gap-2xs">
|
|
48
48
|
{renderChildren({ block: data, options, extraProps: { className: 'scroll-mt-12' } })}
|
|
49
49
|
{renderBlocksList(slots?.footer, { ...options, slotName: 'footer' })}
|
|
50
50
|
</div>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import '../../setup-fixture';
|
|
2
|
+
|
|
3
|
+
import type { Picture } from '../../model/Picture';
|
|
4
|
+
import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
|
|
5
|
+
import { ErrorBlock } from './ErrorBlock';
|
|
6
|
+
|
|
7
|
+
const image: Picture = {
|
|
8
|
+
src: 'error.png',
|
|
9
|
+
format: 'webp',
|
|
10
|
+
alt: 'Ошибка',
|
|
11
|
+
size: {
|
|
12
|
+
width: 460,
|
|
13
|
+
height: 294,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const buttonPrimary: ButtonProps = {
|
|
18
|
+
href: '/credit-cards',
|
|
19
|
+
text: 'Вернуться на главную',
|
|
20
|
+
target: '_blank',
|
|
21
|
+
version: 'primary',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
default: (
|
|
26
|
+
<div className="container grid grid-cols-12">
|
|
27
|
+
<ErrorBlock
|
|
28
|
+
className="col-span-12"
|
|
29
|
+
title="Страница не найдена"
|
|
30
|
+
description="Возможно неправильно набран адрес или такой странице не существует"
|
|
31
|
+
error={{
|
|
32
|
+
contentType: 'Code',
|
|
33
|
+
code: '404',
|
|
34
|
+
}}
|
|
35
|
+
button={buttonPrimary}
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
),
|
|
39
|
+
'error-with-image': (
|
|
40
|
+
<div className="container grid grid-cols-12">
|
|
41
|
+
<ErrorBlock
|
|
42
|
+
className="col-span-12"
|
|
43
|
+
title="Ваш браузер устарел"
|
|
44
|
+
description="Чтобы открыть наш сайт обновите Ваш браузер или скачайте обновленные версии браузеров"
|
|
45
|
+
error={{
|
|
46
|
+
contentType: 'Image',
|
|
47
|
+
image: image,
|
|
48
|
+
}}
|
|
49
|
+
/>
|
|
50
|
+
</div>
|
|
51
|
+
),
|
|
52
|
+
};
|
|
@@ -27,9 +27,9 @@ export default {
|
|
|
27
27
|
<ErrorBlock
|
|
28
28
|
className="col-span-12"
|
|
29
29
|
title="Страница не найдена"
|
|
30
|
-
|
|
30
|
+
description="Возможно неправильно набран адрес или такой странице не существует"
|
|
31
31
|
error={{
|
|
32
|
-
|
|
32
|
+
contentType: 'Code',
|
|
33
33
|
code: '404',
|
|
34
34
|
}}
|
|
35
35
|
button={buttonPrimary}
|
|
@@ -41,9 +41,9 @@ export default {
|
|
|
41
41
|
<ErrorBlock
|
|
42
42
|
className="col-span-12"
|
|
43
43
|
title="Ваш браузер устарел"
|
|
44
|
-
|
|
44
|
+
description="Чтобы открыть наш сайт обновите Ваш браузер или скачайте обновленные версии браузеров"
|
|
45
45
|
error={{
|
|
46
|
-
|
|
46
|
+
contentType: 'Image',
|
|
47
47
|
image: image,
|
|
48
48
|
}}
|
|
49
49
|
/>
|
|
@@ -10,34 +10,28 @@ import { Headline } from '../Headline/Headline';
|
|
|
10
10
|
export interface ErrorBlockProps extends ErrorBlockContent, UniBlockProps {}
|
|
11
11
|
|
|
12
12
|
const renderErrorContent = (error: ErrorBlockContent['error']) => {
|
|
13
|
-
if (error?.
|
|
13
|
+
if (error?.contentType === 'Image' && error?.image) {
|
|
14
14
|
return <Img image={error.image} />;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
if (error?.
|
|
17
|
+
if (error?.contentType === 'Code' && error.code) {
|
|
18
18
|
return <div className="font-mohave text-title-extra gradient-color-text">{error.code}</div>;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
return null;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const getErrorBlockStyle = (text: string) => (text ? 'py-20' : 'mb-16 mt-24');
|
|
25
|
-
|
|
26
24
|
export const ErrorBlock = JSX<ErrorBlockProps>(
|
|
27
|
-
({ className = '', title,
|
|
25
|
+
({ className = '', title, description, error, button, ...rest }) => (
|
|
28
26
|
<BlockWrapper
|
|
29
|
-
className={style('flex flex-col gap-
|
|
30
|
-
defaultPadding={style('
|
|
27
|
+
className={style('flex flex-col gap-2xl justify-center items-center', className)}
|
|
28
|
+
defaultPadding={style('p-6xl')}
|
|
31
29
|
version="transparent"
|
|
32
30
|
{...rest}
|
|
33
31
|
>
|
|
34
|
-
<div className="flex justify-center
|
|
35
|
-
<Headline title={title} description={
|
|
36
|
-
{button?.text ?
|
|
37
|
-
<Button className="py-4 px-9" version={button?.version} {...button}>
|
|
38
|
-
{button.text}
|
|
39
|
-
</Button>
|
|
40
|
-
) : null}
|
|
32
|
+
<div className="flex justify-center">{renderErrorContent(error)}</div>
|
|
33
|
+
<Headline title={title} description={description} headlineVersion="XL" isEmbedded={true} />
|
|
34
|
+
{button?.text ? <Button version={button?.version} text={button?.text} {...button} /> : null}
|
|
41
35
|
</BlockWrapper>
|
|
42
36
|
),
|
|
43
37
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DescriptionProps, TitleProps } from '../../model/HeadlineType';
|
|
2
2
|
import type { UniBlockContent } from '../../model/JSXBlock';
|
|
3
3
|
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
4
4
|
import type { ButtonContent } from '../../ui-kit/Button/ButtonContent';
|
|
@@ -8,14 +8,14 @@ import type { ButtonContent } from '../../ui-kit/Button/ButtonContent';
|
|
|
8
8
|
*/
|
|
9
9
|
export type ErrorImageDef = ImageContent & {
|
|
10
10
|
/** @default Image */
|
|
11
|
-
|
|
11
|
+
contentType: 'Image';
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @title Код ошибки
|
|
16
16
|
*/
|
|
17
17
|
export type ErrorCodeDef = {
|
|
18
|
-
|
|
18
|
+
contentType: 'Code';
|
|
19
19
|
code?: ErrorType;
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -42,7 +42,7 @@ export type ErrorType =
|
|
|
42
42
|
*/
|
|
43
43
|
export type ErrorBlockContent = UniBlockContent &
|
|
44
44
|
TitleProps &
|
|
45
|
-
|
|
45
|
+
DescriptionProps & {
|
|
46
46
|
error?: ErrorContentDef;
|
|
47
47
|
/** @title Кнопка */
|
|
48
48
|
button?: ButtonContent;
|
|
@@ -71,11 +71,7 @@ export const ExchangeCurrencyCalculator = JSX<ExchangeCurrencyCalculatorProps>(
|
|
|
71
71
|
calcState.selectSell,
|
|
72
72
|
),
|
|
73
73
|
})}
|
|
74
|
-
{button?.text ?
|
|
75
|
-
<Button className="py-4 px-9" version={button?.version} {...button}>
|
|
76
|
-
{button.text}
|
|
77
|
-
</Button>
|
|
78
|
-
) : null}
|
|
74
|
+
{button?.text ? <Button text={button.text} version={button?.version} {...button} /> : null}
|
|
79
75
|
</div>
|
|
80
76
|
);
|
|
81
77
|
},
|
|
@@ -30,11 +30,11 @@ const getButtonStyle = (props: ButtonContent) => {
|
|
|
30
30
|
|
|
31
31
|
const withTextStyle = `${aboveText ? 'py-2.5 px-9' : 'py-4 px-9'}`;
|
|
32
32
|
|
|
33
|
-
return
|
|
33
|
+
return style(
|
|
34
34
|
'group/btn items-center justify-center',
|
|
35
35
|
isWithText(props) ? withTextStyle : 'h-12 w-12',
|
|
36
36
|
rounded ? 'rounded-full' : '',
|
|
37
|
-
|
|
37
|
+
);
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
const isWithText = ({ text, aboveText, appendLeft }: ButtonProps) =>
|