@redneckz/wildless-cms-uni-blocks 0.8.20 → 0.8.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +96 -82
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/CreditCalculatorForm.d.ts +0 -2
- package/bundle/components/Calculator/constants.d.ts +2 -2
- package/bundle/components/Calculator/renderInterestPayment.d.ts +9 -1
- package/bundle/components/Calculator/renderPaymentType.d.ts +12 -0
- package/bundle/components/Calculator/renderRegistrationType.d.ts +10 -0
- package/bundle/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
- package/bundle/components/Calculator/useCreditCalculatorParams.d.ts +1 -4
- package/bundle/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/bundle/components/StepsBlock/StepsBlock.d.ts +1 -1
- package/bundle/components/StepsBlock/StepsBlockContent.d.ts +2 -1
- package/bundle/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -2
- package/bundle/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js +7 -2
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/CreditCalculatorForm.d.ts +0 -2
- package/dist/components/Calculator/CreditCalculatorForm.js +7 -15
- package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/DepositCalculatorForm.js +13 -1
- package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/constants.d.ts +2 -2
- package/dist/components/Calculator/constants.js +6 -7
- package/dist/components/Calculator/constants.js.map +1 -1
- package/dist/components/Calculator/rangeHelpers.js +1 -1
- package/dist/components/Calculator/rangeHelpers.js.map +1 -1
- package/dist/components/Calculator/renderInterestPayment.d.ts +9 -1
- package/dist/components/Calculator/renderInterestPayment.js +2 -2
- package/dist/components/Calculator/renderInterestPayment.js.map +1 -1
- package/dist/components/Calculator/renderPaymentType.d.ts +12 -0
- package/dist/components/Calculator/renderPaymentType.js +22 -0
- package/dist/components/Calculator/renderPaymentType.js.map +1 -0
- package/dist/components/Calculator/renderRegistrationType.d.ts +10 -0
- package/dist/components/Calculator/renderRegistrationType.js +22 -0
- package/dist/components/Calculator/renderRegistrationType.js.map +1 -0
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
- package/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useCreditCalculatorParams.d.ts +1 -4
- package/dist/components/Calculator/useCreditCalculatorParams.js +2 -4
- package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/dist/components/Calculator/useDepositCalculatorParams.js +2 -1
- package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/dist/components/Footer/Contacts.js +1 -1
- package/dist/components/Footer/Contacts.js.map +1 -1
- package/dist/components/Footer/Sitemap.js +7 -5
- package/dist/components/Footer/Sitemap.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.d.ts +1 -1
- package/dist/components/StepsBlock/StepsBlock.js +11 -8
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js +2 -6
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +2 -1
- package/dist/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -2
- package/dist/components/StepsBlock/StepsBlockStyleMaps.js +7 -39
- package/dist/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js +5 -1
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js +7 -2
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/CreditCalculatorForm.d.ts +0 -2
- package/lib/components/Calculator/CreditCalculatorForm.js +6 -14
- package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/DepositCalculatorForm.js +13 -1
- package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/constants.d.ts +2 -2
- package/lib/components/Calculator/constants.js +6 -7
- package/lib/components/Calculator/constants.js.map +1 -1
- package/lib/components/Calculator/rangeHelpers.js +1 -1
- package/lib/components/Calculator/rangeHelpers.js.map +1 -1
- package/lib/components/Calculator/renderInterestPayment.d.ts +9 -1
- package/lib/components/Calculator/renderInterestPayment.js +2 -2
- package/lib/components/Calculator/renderInterestPayment.js.map +1 -1
- package/lib/components/Calculator/renderPaymentType.d.ts +12 -0
- package/lib/components/Calculator/renderPaymentType.js +19 -0
- package/lib/components/Calculator/renderPaymentType.js.map +1 -0
- package/lib/components/Calculator/renderRegistrationType.d.ts +10 -0
- package/lib/components/Calculator/renderRegistrationType.js +19 -0
- package/lib/components/Calculator/renderRegistrationType.js.map +1 -0
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
- package/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useCreditCalculatorParams.d.ts +1 -4
- package/lib/components/Calculator/useCreditCalculatorParams.js +2 -4
- package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/lib/components/Calculator/useDepositCalculatorParams.js +2 -1
- package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/lib/components/Footer/Contacts.js +1 -1
- package/lib/components/Footer/Contacts.js.map +1 -1
- package/lib/components/Footer/Sitemap.js +7 -5
- package/lib/components/Footer/Sitemap.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.d.ts +1 -1
- package/lib/components/StepsBlock/StepsBlock.js +12 -9
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.mobile.js +3 -7
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +2 -1
- package/lib/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -2
- package/lib/components/StepsBlock/StepsBlockStyleMaps.js +6 -38
- package/lib/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js +5 -1
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +10 -46
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/CreditCalculatorForm.d.ts +0 -2
- package/mobile/bundle/components/Calculator/constants.d.ts +2 -2
- package/mobile/bundle/components/Calculator/renderInterestPayment.d.ts +9 -1
- package/mobile/bundle/components/Calculator/renderPaymentType.d.ts +12 -0
- package/mobile/bundle/components/Calculator/renderRegistrationType.d.ts +10 -0
- package/mobile/bundle/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
- package/mobile/bundle/components/Calculator/useCreditCalculatorParams.d.ts +1 -4
- package/mobile/bundle/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +2 -1
- package/mobile/bundle/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -2
- package/mobile/bundle/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +7 -2
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/CreditCalculatorForm.d.ts +0 -2
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js +7 -15
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js +13 -1
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/constants.d.ts +2 -2
- package/mobile/dist/components/Calculator/constants.js +6 -7
- package/mobile/dist/components/Calculator/constants.js.map +1 -1
- package/mobile/dist/components/Calculator/rangeHelpers.js +1 -1
- package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -1
- package/mobile/dist/components/Calculator/renderInterestPayment.d.ts +9 -1
- package/mobile/dist/components/Calculator/renderInterestPayment.js +2 -2
- package/mobile/dist/components/Calculator/renderInterestPayment.js.map +1 -1
- package/mobile/dist/components/Calculator/renderPaymentType.d.ts +12 -0
- package/mobile/dist/components/Calculator/renderPaymentType.js +22 -0
- package/mobile/dist/components/Calculator/renderPaymentType.js.map +1 -0
- package/mobile/dist/components/Calculator/renderRegistrationType.d.ts +10 -0
- package/mobile/dist/components/Calculator/renderRegistrationType.js +22 -0
- package/mobile/dist/components/Calculator/renderRegistrationType.js.map +1 -0
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
- package/mobile/dist/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.d.ts +1 -4
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +2 -4
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +2 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Footer/Contacts.js +1 -1
- package/mobile/dist/components/Footer/Contacts.js.map +1 -1
- package/mobile/dist/components/Footer/Sitemap.js +7 -5
- package/mobile/dist/components/Footer/Sitemap.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlock.js +2 -6
- package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +2 -1
- package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -2
- package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.js +7 -39
- package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js +5 -1
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +7 -2
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/CreditCalculatorForm.d.ts +0 -2
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js +6 -14
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js +13 -1
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/constants.d.ts +2 -2
- package/mobile/lib/components/Calculator/constants.js +6 -7
- package/mobile/lib/components/Calculator/constants.js.map +1 -1
- package/mobile/lib/components/Calculator/rangeHelpers.js +1 -1
- package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -1
- package/mobile/lib/components/Calculator/renderInterestPayment.d.ts +9 -1
- package/mobile/lib/components/Calculator/renderInterestPayment.js +2 -2
- package/mobile/lib/components/Calculator/renderInterestPayment.js.map +1 -1
- package/mobile/lib/components/Calculator/renderPaymentType.d.ts +12 -0
- package/mobile/lib/components/Calculator/renderPaymentType.js +19 -0
- package/mobile/lib/components/Calculator/renderPaymentType.js.map +1 -0
- package/mobile/lib/components/Calculator/renderRegistrationType.d.ts +10 -0
- package/mobile/lib/components/Calculator/renderRegistrationType.js +19 -0
- package/mobile/lib/components/Calculator/renderRegistrationType.js.map +1 -0
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.d.ts +3 -2
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js +1 -1
- package/mobile/lib/components/Calculator/useBusinessDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.d.ts +1 -4
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +2 -4
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +2 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Footer/Contacts.js +1 -1
- package/mobile/lib/components/Footer/Contacts.js.map +1 -1
- package/mobile/lib/components/Footer/Sitemap.js +7 -5
- package/mobile/lib/components/Footer/Sitemap.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlock.js +3 -7
- package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +2 -1
- package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.d.ts +1 -2
- package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.js +6 -38
- package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +2 -0
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js +5 -1
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +9 -8
- package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +8 -22
- package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +22 -8
- package/mobile/src/components/Calculator/constants.ts +6 -7
- package/mobile/src/components/Calculator/rangeHelpers.ts +1 -1
- package/mobile/src/components/Calculator/renderInterestPayment.tsx +21 -9
- package/mobile/src/components/Calculator/renderPaymentType.tsx +49 -0
- package/mobile/src/components/Calculator/renderRegistrationType.tsx +51 -0
- package/mobile/src/components/Calculator/useBusinessDepositCalculatorParams.ts +4 -3
- package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +3 -8
- package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +4 -2
- package/mobile/src/components/Catalog/Catalog.ui.json +1 -0
- package/mobile/src/components/Footer/Contacts.tsx +1 -1
- package/mobile/src/components/Footer/Sitemap.tsx +10 -5
- package/mobile/src/components/Gallery/Gallery.ui.json +1 -0
- package/mobile/src/components/MiniGallery/MiniGallery.ui.json +1 -0
- package/mobile/src/components/StepsBlock/StepsBlock.example.json +3 -1
- package/mobile/src/components/StepsBlock/StepsBlock.tsx +23 -27
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +2 -1
- package/mobile/src/components/StepsBlock/StepsBlockStyleMaps.ts +6 -40
- package/mobile/src/ui-kit/RadioButtonGroup/RadioButtonGroup.tsx +9 -2
- package/package.json +1 -1
- package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +9 -8
- package/src/components/Calculator/CreditCalculatorForm.tsx +8 -22
- package/src/components/Calculator/DepositCalculatorForm.tsx +22 -8
- package/src/components/Calculator/constants.ts +6 -7
- package/src/components/Calculator/rangeHelpers.ts +1 -1
- package/src/components/Calculator/renderInterestPayment.tsx +21 -9
- package/src/components/Calculator/renderPaymentType.tsx +49 -0
- package/src/components/Calculator/renderRegistrationType.tsx +51 -0
- package/src/components/Calculator/useBusinessDepositCalculatorParams.ts +4 -3
- package/src/components/Calculator/useCreditCalculatorParams.ts +3 -8
- package/src/components/Calculator/useDepositCalculatorParams.ts +4 -2
- package/src/components/Catalog/Catalog.ui.json +1 -0
- package/src/components/Footer/Contacts.tsx +1 -1
- package/src/components/Footer/Sitemap.tsx +10 -5
- package/src/components/Gallery/Gallery.ui.json +1 -0
- package/src/components/MiniGallery/MiniGallery.ui.json +1 -0
- package/src/components/StepsBlock/StepsBlock.example.json +3 -1
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +4 -0
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +23 -27
- package/src/components/StepsBlock/StepsBlock.tsx +34 -27
- package/src/components/StepsBlock/StepsBlockContent.ts +2 -1
- package/src/components/StepsBlock/StepsBlockStyleMaps.ts +6 -40
- package/src/ui-kit/RadioButtonGroup/RadioButtonGroup.fixture.tsx +22 -5
- package/src/ui-kit/RadioButtonGroup/RadioButtonGroup.tsx +9 -2
|
@@ -11,6 +11,7 @@ import { Rate } from './Rate';
|
|
|
11
11
|
import { renderFootnote } from './renderFootnote';
|
|
12
12
|
import { renderInterestPayment } from './renderInterestPayment';
|
|
13
13
|
import { renderMonthsInput } from './renderMonthsInput';
|
|
14
|
+
import { renderRegistrationType } from './renderRegistrationType';
|
|
14
15
|
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
15
16
|
import { useDepositCalculatorParams } from './useDepositCalculatorParams';
|
|
16
17
|
|
|
@@ -28,10 +29,16 @@ export const DepositCalculatorForm = JSX<DepositCalculatorProp>(
|
|
|
28
29
|
(_: boolean) => toggleIsMonthlyInterestPayment(_),
|
|
29
30
|
[],
|
|
30
31
|
);
|
|
32
|
+
const [isRemoteRegistration, toggleIsRemoteRegistration] = useState(false);
|
|
33
|
+
const handleIsRemoteRegistration = useCallback(
|
|
34
|
+
(_: boolean) => toggleIsRemoteRegistration(_),
|
|
35
|
+
[],
|
|
36
|
+
);
|
|
31
37
|
const userInputParams = {
|
|
32
38
|
moneyValue,
|
|
33
39
|
monthsValue,
|
|
34
40
|
isMonthlyInterestPayment,
|
|
41
|
+
isRemoteRegistration,
|
|
35
42
|
};
|
|
36
43
|
const handleMonthsValue = useCallback((_: number) => setMonthsValue(_), []);
|
|
37
44
|
|
|
@@ -55,16 +62,23 @@ export const DepositCalculatorForm = JSX<DepositCalculatorProp>(
|
|
|
55
62
|
},
|
|
56
63
|
handleMonthsValue,
|
|
57
64
|
)}
|
|
65
|
+
<div className="mt-7 flex flex-col gap-y-7">
|
|
66
|
+
{renderInterestPayment({
|
|
67
|
+
isMonthlyInterestPayment,
|
|
68
|
+
callback: handleIsMonthlyInterestPayment,
|
|
69
|
+
title: 'Выплата процентов',
|
|
70
|
+
})}
|
|
71
|
+
{renderRegistrationType({
|
|
72
|
+
isRemoteRegistration,
|
|
73
|
+
callback: handleIsRemoteRegistration,
|
|
74
|
+
title: 'Оформление',
|
|
75
|
+
})}
|
|
76
|
+
</div>
|
|
58
77
|
</div>
|
|
59
|
-
<Rate rate={rate
|
|
78
|
+
<Rate rate={rate} rateBlockClassName="tracking-[-25px]" unit="%" />
|
|
60
79
|
<div className="w-full max-w-[350px]">
|
|
61
|
-
{income
|
|
62
|
-
|
|
63
|
-
) : null}
|
|
64
|
-
{finalSum ? (
|
|
65
|
-
<CalculatorValueBlock title="Сумма в конце срока" value={finalSum} postfix="₽" />
|
|
66
|
-
) : null}
|
|
67
|
-
{renderInterestPayment(isMonthlyInterestPayment, handleIsMonthlyInterestPayment)}
|
|
80
|
+
<CalculatorValueBlock title="Доход по вкладу" value={income} postfix="₽" prefix="+" />
|
|
81
|
+
<CalculatorValueBlock title="Сумма в конце срока" value={finalSum} postfix="₽" />
|
|
68
82
|
{renderButtonsSection(buttons, { className: 'mt-7', isVertical: true })}
|
|
69
83
|
{renderFootnote(footnote)}
|
|
70
84
|
</div>
|
|
@@ -3,8 +3,8 @@ import { BusinessDepositCalculatorSourceBookParams } from './useBusinessDepositC
|
|
|
3
3
|
import { CreditCalculatorSourceBookParams } from './useCreditCalculatorParams';
|
|
4
4
|
import { DepositCalculatorSourceBookParams } from './useDepositCalculatorParams';
|
|
5
5
|
|
|
6
|
-
export const DEFAULT_MIN_SUM =
|
|
7
|
-
export const DEFAULT_MAX_SUM =
|
|
6
|
+
export const DEFAULT_MIN_SUM = 30000;
|
|
7
|
+
export const DEFAULT_MAX_SUM = 5000000;
|
|
8
8
|
export const DEFAULT_SUM = (DEFAULT_MAX_SUM - DEFAULT_MIN_SUM) / 2;
|
|
9
9
|
export const DEFAULT_MIN_MONTHS = 13;
|
|
10
10
|
export const DEFAULT_MAX_MONTHS = 60;
|
|
@@ -25,12 +25,10 @@ export const DEFAULT_CREDIT_CALCULATOR_PARAMS: CreditCalculatorSourceBookParams
|
|
|
25
25
|
maxSum: DEFAULT_MAX_SUM,
|
|
26
26
|
minMonths: DEFAULT_MIN_MONTHS,
|
|
27
27
|
maxMonths: DEFAULT_MAX_MONTHS,
|
|
28
|
-
|
|
29
|
-
rateTopRange: 7,
|
|
28
|
+
rate: 0,
|
|
30
29
|
isSalaryClient: true,
|
|
31
30
|
isStateEmployee: true,
|
|
32
31
|
isInsurance: true,
|
|
33
|
-
sumBorder: 999999,
|
|
34
32
|
};
|
|
35
33
|
|
|
36
34
|
export const DEFAULT_TRAVEL_MIN_SUM = 6000;
|
|
@@ -54,8 +52,9 @@ export const DEFAULT_DEPOSIT_CALCULATOR_PARAMS: DepositCalculatorSourceBookParam
|
|
|
54
52
|
maxSum: 5000000,
|
|
55
53
|
minMonths: 2,
|
|
56
54
|
maxMonths: 120,
|
|
57
|
-
rate:
|
|
55
|
+
rate: 0,
|
|
58
56
|
isMonthlyInterestPayment: true,
|
|
57
|
+
isRemoteRegistration: true,
|
|
59
58
|
};
|
|
60
59
|
|
|
61
60
|
export const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS: BusinessDepositCalculatorSourceBookParams =
|
|
@@ -64,7 +63,7 @@ export const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS: BusinessDepositCalculat
|
|
|
64
63
|
maxSum: 500000,
|
|
65
64
|
minDays: BUSINESS_MIN_DAYS,
|
|
66
65
|
maxDays: BUSINESS_MAX_DAYS,
|
|
67
|
-
rate:
|
|
66
|
+
rate: 0,
|
|
68
67
|
isMonthlyInterestPayment: true,
|
|
69
68
|
isReplenished: false,
|
|
70
69
|
isPartialWithdrawal: false,
|
|
@@ -21,4 +21,4 @@ export const checkRangeByKeys = <
|
|
|
21
21
|
value: number,
|
|
22
22
|
[minKey, maxKey]: [MinKey, MaxKey],
|
|
23
23
|
sourceBookRow: T,
|
|
24
|
-
): boolean => value >= sourceBookRow[minKey] && value
|
|
24
|
+
): boolean => value >= sourceBookRow[minKey] && value <= sourceBookRow[maxKey];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ListOrientation } from '../../model/ListOrientation';
|
|
1
2
|
import { RadioButtonGroup } from '../../ui-kit/RadioButtonGroup/RadioButtonGroup';
|
|
2
3
|
import { Text } from '../../ui-kit/Text/Text';
|
|
3
4
|
|
|
@@ -15,21 +16,32 @@ const depositTypeItems = [
|
|
|
15
16
|
},
|
|
16
17
|
];
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
isMonthlyInterestPayment: boolean
|
|
20
|
-
callback?: (value: boolean) => void
|
|
21
|
-
title?: string
|
|
22
|
-
|
|
19
|
+
interface InterestPaymentProps {
|
|
20
|
+
isMonthlyInterestPayment: boolean;
|
|
21
|
+
callback?: (value: boolean) => void;
|
|
22
|
+
title?: string;
|
|
23
|
+
orientation?: ListOrientation;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function renderInterestPayment({
|
|
27
|
+
isMonthlyInterestPayment,
|
|
28
|
+
callback,
|
|
29
|
+
title,
|
|
30
|
+
orientation = 'horizontal',
|
|
31
|
+
}: InterestPaymentProps) {
|
|
23
32
|
return (
|
|
24
33
|
<div>
|
|
25
34
|
{title ? (
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
<div className="mb-3">
|
|
36
|
+
<Text color="text-secondary-text" font="font-light">
|
|
37
|
+
{title}
|
|
38
|
+
</Text>
|
|
39
|
+
</div>
|
|
29
40
|
) : null}
|
|
30
41
|
|
|
31
|
-
<div
|
|
42
|
+
<div>
|
|
32
43
|
<RadioButtonGroup
|
|
44
|
+
orientation={orientation}
|
|
33
45
|
items={depositTypeItems}
|
|
34
46
|
checkedItem={isMonthlyInterestPayment ? EVERY_MONTH : AT_END_TERM}
|
|
35
47
|
onChange={(text: string) => callback && callback(text === EVERY_MONTH)}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ListOrientation } from '../../model/ListOrientation';
|
|
2
|
+
import { RadioButtonGroup } from '../../ui-kit/RadioButtonGroup/RadioButtonGroup';
|
|
3
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
4
|
+
|
|
5
|
+
export const ANNUITY = 'annuity';
|
|
6
|
+
export const DIFFERENTIAL = 'differential';
|
|
7
|
+
|
|
8
|
+
const paymentTypeItems = [
|
|
9
|
+
{
|
|
10
|
+
id: ANNUITY,
|
|
11
|
+
text: 'Аннуитетный',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: DIFFERENTIAL,
|
|
15
|
+
text: 'Дифференцированный',
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
interface PaymentTypeProps {
|
|
20
|
+
isAnnuity: boolean;
|
|
21
|
+
callback?: (value: boolean) => void;
|
|
22
|
+
title?: string;
|
|
23
|
+
orientation?: ListOrientation;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function renderPaymentType({
|
|
27
|
+
isAnnuity,
|
|
28
|
+
callback,
|
|
29
|
+
title,
|
|
30
|
+
orientation = 'horizontal',
|
|
31
|
+
}: PaymentTypeProps) {
|
|
32
|
+
return (
|
|
33
|
+
<div>
|
|
34
|
+
{title ? (
|
|
35
|
+
<div className="mb-3">
|
|
36
|
+
<Text color="text-secondary-text" font="font-light">
|
|
37
|
+
{title}
|
|
38
|
+
</Text>
|
|
39
|
+
</div>
|
|
40
|
+
) : null}
|
|
41
|
+
<RadioButtonGroup
|
|
42
|
+
orientation={orientation}
|
|
43
|
+
items={paymentTypeItems}
|
|
44
|
+
checkedItem={isAnnuity ? ANNUITY : DIFFERENTIAL}
|
|
45
|
+
onChange={(text: string) => callback && callback(text === ANNUITY)}
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ListOrientation } from '../../model/ListOrientation';
|
|
2
|
+
import { RadioButtonGroup } from '../../ui-kit/RadioButtonGroup/RadioButtonGroup';
|
|
3
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
4
|
+
|
|
5
|
+
const REMOTE_REGISTRATION = 'remote';
|
|
6
|
+
const OFFICE_REGISTRATION = 'office';
|
|
7
|
+
|
|
8
|
+
const registrationTypeItems = [
|
|
9
|
+
{
|
|
10
|
+
id: OFFICE_REGISTRATION,
|
|
11
|
+
text: 'Офис Банка',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: REMOTE_REGISTRATION,
|
|
15
|
+
text: 'Дистанционно',
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
interface RegistrationTypeProps {
|
|
20
|
+
isRemoteRegistration: boolean;
|
|
21
|
+
callback?: (value: boolean) => void;
|
|
22
|
+
title?: string;
|
|
23
|
+
orientation?: ListOrientation;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function renderRegistrationType({
|
|
27
|
+
isRemoteRegistration,
|
|
28
|
+
callback,
|
|
29
|
+
title,
|
|
30
|
+
orientation = 'horizontal',
|
|
31
|
+
}: RegistrationTypeProps) {
|
|
32
|
+
return (
|
|
33
|
+
<div>
|
|
34
|
+
{title ? (
|
|
35
|
+
<div className="mb-3">
|
|
36
|
+
<Text color="text-secondary-text" font="font-light">
|
|
37
|
+
{title}
|
|
38
|
+
</Text>
|
|
39
|
+
</div>
|
|
40
|
+
) : null}
|
|
41
|
+
<div>
|
|
42
|
+
<RadioButtonGroup
|
|
43
|
+
orientation={orientation}
|
|
44
|
+
items={registrationTypeItems}
|
|
45
|
+
checkedItem={isRemoteRegistration ? REMOTE_REGISTRATION : OFFICE_REGISTRATION}
|
|
46
|
+
onChange={(text: string) => callback && callback(text === REMOTE_REGISTRATION)}
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
} from './constants';
|
|
8
8
|
import { checkRangeByKeys, getRangeByKeys } from './rangeHelpers';
|
|
9
9
|
import { useCalculatorParams } from './useCalculatorParams';
|
|
10
|
-
import type { CommonDepositParams } from './useDepositCalculatorParams';
|
|
11
10
|
|
|
12
|
-
export interface BusinessCommonDepositParams
|
|
11
|
+
export interface BusinessCommonDepositParams {
|
|
12
|
+
isMonthlyInterestPayment: boolean;
|
|
13
13
|
isReplenished: boolean;
|
|
14
14
|
isPartialWithdrawal: boolean;
|
|
15
15
|
isSmallBusiness: boolean;
|
|
@@ -34,6 +34,7 @@ export interface BusinessDepositCalculatorParams
|
|
|
34
34
|
income?: number;
|
|
35
35
|
finalSum?: number;
|
|
36
36
|
isDisabledOperatingDeposit?: boolean;
|
|
37
|
+
isShowUnknownRate?: boolean;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
export type BusinessDepositCalculatorData = {
|
|
@@ -65,7 +66,7 @@ export const useBusinessDepositCalculatorParams = (
|
|
|
65
66
|
...DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS,
|
|
66
67
|
...userInputParams,
|
|
67
68
|
isDisabledOperatingDeposit,
|
|
68
|
-
|
|
69
|
+
isShowUnknownRate: true,
|
|
69
70
|
};
|
|
70
71
|
}
|
|
71
72
|
const businessDepositCalculatorSourceBookParams =
|
|
@@ -13,9 +13,7 @@ export interface CreditCalculatorSourceBookParams extends CommonCreditParams {
|
|
|
13
13
|
maxSum: number;
|
|
14
14
|
minMonths: number;
|
|
15
15
|
maxMonths: number;
|
|
16
|
-
|
|
17
|
-
rateTopRange: number;
|
|
18
|
-
sumBorder: number;
|
|
16
|
+
rate: number;
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
export interface CreditCalculatorUserInputParams extends CommonCreditParams {
|
|
@@ -28,7 +26,6 @@ export interface CreditCalculatorParams
|
|
|
28
26
|
extends CreditCalculatorSourceBookParams,
|
|
29
27
|
CreditCalculatorUserInputParams {
|
|
30
28
|
monthlyPayment: number;
|
|
31
|
-
finalRate: number;
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
export type CreditCalculatorData = {
|
|
@@ -53,9 +50,8 @@ export const useCreditCalculatorParams = (
|
|
|
53
50
|
);
|
|
54
51
|
}) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
|
|
55
52
|
|
|
56
|
-
const {
|
|
57
|
-
const
|
|
58
|
-
const monthlyPayment = getMonthlyPayment(finalRate, userInputParams);
|
|
53
|
+
const { rate } = creditCalculatorSourceBookParams;
|
|
54
|
+
const monthlyPayment = getMonthlyPayment(rate, userInputParams);
|
|
59
55
|
const sourceBookRows = data?.rows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
|
|
60
56
|
|
|
61
57
|
return {
|
|
@@ -63,7 +59,6 @@ export const useCreditCalculatorParams = (
|
|
|
63
59
|
...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
|
|
64
60
|
...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
|
|
65
61
|
...userInputParams,
|
|
66
|
-
finalRate,
|
|
67
62
|
monthlyPayment,
|
|
68
63
|
};
|
|
69
64
|
};
|
|
@@ -4,6 +4,7 @@ import { useCalculatorParams } from './useCalculatorParams';
|
|
|
4
4
|
|
|
5
5
|
export interface CommonDepositParams {
|
|
6
6
|
isMonthlyInterestPayment: boolean;
|
|
7
|
+
isRemoteRegistration: boolean;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export interface DepositCalculatorSourceBookParams extends CommonDepositParams {
|
|
@@ -34,7 +35,8 @@ export const useDepositCalculatorParams = (
|
|
|
34
35
|
userInputParams: DepositCalculatorUserInputParams,
|
|
35
36
|
sourceBookDir?: string,
|
|
36
37
|
): DepositCalculatorParams => {
|
|
37
|
-
const { isMonthlyInterestPayment, moneyValue, monthsValue } =
|
|
38
|
+
const { isMonthlyInterestPayment, isRemoteRegistration, moneyValue, monthsValue } =
|
|
39
|
+
userInputParams;
|
|
38
40
|
|
|
39
41
|
const data = useCalculatorParams<DepositCalculatorData>(
|
|
40
42
|
sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR,
|
|
@@ -44,12 +46,12 @@ export const useDepositCalculatorParams = (
|
|
|
44
46
|
data?.rows?.find(
|
|
45
47
|
(_) =>
|
|
46
48
|
isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
|
|
49
|
+
isRemoteRegistration === _.isRemoteRegistration &&
|
|
47
50
|
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
48
51
|
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _),
|
|
49
52
|
) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
|
|
50
53
|
|
|
51
54
|
const { rate } = depositCalculatorSourceBookParams;
|
|
52
|
-
|
|
53
55
|
const income = getDepositIncome(rate, userInputParams);
|
|
54
56
|
const finalSum = moneyValue + income;
|
|
55
57
|
const sourceBookRows = data?.rows || [DEFAULT_DEPOSIT_CALCULATOR_PARAMS];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -15,7 +15,7 @@ export const Contacts = JSX<ContactsProps>(({ className = '', items, hasButton }
|
|
|
15
15
|
<Button
|
|
16
16
|
version="primary"
|
|
17
17
|
className="mb-6 w-full"
|
|
18
|
-
href="/"
|
|
18
|
+
href="https://www.rshb.ru/feedback/question/"
|
|
19
19
|
target="_blank"
|
|
20
20
|
ariaLabel="Обратная связь"
|
|
21
21
|
text="Обратная связь"
|
|
@@ -5,6 +5,7 @@ import type { LinkProps } from '../../model/LinkProps';
|
|
|
5
5
|
import { projectSettings } from '../../ProjectSettings';
|
|
6
6
|
import type { SitemapDataProps, TopMenuItem } from '../../services/sitemap/SitemapProps';
|
|
7
7
|
import { useSWRResource } from '../../services/sitemap/useSWRResource';
|
|
8
|
+
import { joinPath } from '../../utils/url';
|
|
8
9
|
|
|
9
10
|
export interface SitemapProps {
|
|
10
11
|
className?: string;
|
|
@@ -12,7 +13,7 @@ export interface SitemapProps {
|
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export const Sitemap = JSX<SitemapProps>(({ className = '', fallback }) => {
|
|
15
|
-
const link = useLink();
|
|
16
|
+
const link = useLink(true);
|
|
16
17
|
const sitemap = useSWRResource<SitemapDataProps>(projectSettings.SITEMAP || 'sitemap', fallback);
|
|
17
18
|
|
|
18
19
|
return (
|
|
@@ -36,24 +37,28 @@ const renderColumn = (menuItem: TopMenuItem & { onClick: () => void }, index: nu
|
|
|
36
37
|
{text || `Раздел ${index}`}
|
|
37
38
|
</a>
|
|
38
39
|
{items?.map((_, i) => (
|
|
39
|
-
<ColumnItem key={String(i)} {..._} index={i} />
|
|
40
|
+
<ColumnItem key={String(i)} {..._} basePath={href} index={i} />
|
|
40
41
|
))}
|
|
41
42
|
</div>
|
|
42
43
|
);
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
interface ColumnItemProps extends LinkProps {
|
|
47
|
+
basePath?: string;
|
|
46
48
|
index?: number;
|
|
47
49
|
}
|
|
48
50
|
|
|
49
|
-
const ColumnItem = JSX<ColumnItemProps>(({ text, index, ...rest }) => {
|
|
50
|
-
const
|
|
51
|
+
const ColumnItem = JSX<ColumnItemProps>(({ text, index, basePath, ...rest }) => {
|
|
52
|
+
const isAnotherPortal =
|
|
53
|
+
projectSettings.BASE_PATH && basePath ? !projectSettings.BASE_PATH.startsWith(basePath) : false;
|
|
54
|
+
|
|
55
|
+
const link = useLink(isAnotherPortal);
|
|
51
56
|
const { href, target, onClick } = link(rest);
|
|
52
57
|
|
|
53
58
|
return (
|
|
54
59
|
<a
|
|
55
60
|
className="block text-l-light text-secondary-text hover:text-primary-main no-underline"
|
|
56
|
-
href={href}
|
|
61
|
+
href={isAnotherPortal ? joinPath(basePath, href) : href}
|
|
57
62
|
target={target || '_self'}
|
|
58
63
|
onClick={onClick}
|
|
59
64
|
>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
"title": "Шаги",
|
|
5
5
|
"description": "Описание",
|
|
6
6
|
"showLines": true,
|
|
7
|
+
"size": "normal",
|
|
8
|
+
"stepVersion": "gray",
|
|
7
9
|
"steps": [
|
|
8
10
|
{
|
|
9
11
|
"label": "Шаг №1",
|
|
@@ -20,7 +22,7 @@
|
|
|
20
22
|
"text": "Кнопка",
|
|
21
23
|
"target": "_blank",
|
|
22
24
|
"version": "primary"
|
|
23
|
-
}
|
|
25
|
+
}
|
|
24
26
|
},
|
|
25
27
|
{
|
|
26
28
|
"label": "Шаг №2",
|
|
@@ -65,6 +65,7 @@ const BUTTONS: DefaultStep['button'][] = [
|
|
|
65
65
|
const STEPS_WITH_BUTTONS_AND_ICONS: Step[] = STEPS_WITH_ICONS.map((step, i) => ({
|
|
66
66
|
...step,
|
|
67
67
|
button: BUTTONS[i],
|
|
68
|
+
stepVersion: 'primary',
|
|
68
69
|
}));
|
|
69
70
|
|
|
70
71
|
const STEPS_WITH_LIST_PROPS: StepsBlockProps = {
|
|
@@ -75,6 +76,7 @@ const STEPS_WITH_LIST_PROPS: StepsBlockProps = {
|
|
|
75
76
|
const STEPS_WITH_LIST_AND_DESC_PROPS: StepsBlockProps = {
|
|
76
77
|
...COMMON_PROPS,
|
|
77
78
|
steps: STEPS_WITH_ICONS.map((step) => ({ ...step, items: ITEMS })),
|
|
79
|
+
stepVersion: 'secondary',
|
|
78
80
|
};
|
|
79
81
|
|
|
80
82
|
const STEPS_WITH_BUTTON_PROPS: StepsBlockProps = {
|
|
@@ -84,6 +86,8 @@ const STEPS_WITH_BUTTON_PROPS: StepsBlockProps = {
|
|
|
84
86
|
button: { text: 'Оформить' },
|
|
85
87
|
})),
|
|
86
88
|
title: TITLE,
|
|
89
|
+
stepVersion: 'primary',
|
|
90
|
+
size: 'small',
|
|
87
91
|
};
|
|
88
92
|
|
|
89
93
|
export default {
|
|
@@ -10,7 +10,7 @@ import { assertUnreachable } from '../../utils/assertUnreachable';
|
|
|
10
10
|
import { getIconWithVersion } from '../../utils/getIconWithVersion';
|
|
11
11
|
import { checkCanRenderIcon } from './checkCanRenderIcon';
|
|
12
12
|
import type { DefaultStep, Step, StepsBlockContent } from './StepsBlockContent';
|
|
13
|
-
import {
|
|
13
|
+
import { STEPS_BLOCK_STYLE } from './StepsBlockStyleMaps';
|
|
14
14
|
|
|
15
15
|
export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
|
|
16
16
|
|
|
@@ -24,6 +24,8 @@ const STEPS_TILE_DESCRIPTION_HEIGHT_MAP: Record<SizeVersion, string> = {
|
|
|
24
24
|
small: 'min-h-12',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
const styleMap = STEPS_BLOCK_STYLE;
|
|
28
|
+
|
|
27
29
|
export const StepsBlock = JSX<StepsBlockProps>(
|
|
28
30
|
({
|
|
29
31
|
className = '',
|
|
@@ -34,31 +36,27 @@ export const StepsBlock = JSX<StepsBlockProps>(
|
|
|
34
36
|
size = 'normal',
|
|
35
37
|
version = 'primary',
|
|
36
38
|
...rest
|
|
37
|
-
}) =>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<div className={`box-border py-0.5 mb-0.5 mt-5`}>
|
|
54
|
-
<div className="flex flex-col justify-between gap-x-[101px]">
|
|
55
|
-
{steps.map(renderStep(size, version, showLines))}
|
|
56
|
-
</div>
|
|
39
|
+
}) => (
|
|
40
|
+
<BlockWrapper
|
|
41
|
+
className={`box-border px-4 py-6 flex flex-col ${className}`}
|
|
42
|
+
version={version}
|
|
43
|
+
{...rest}
|
|
44
|
+
>
|
|
45
|
+
{title ? <Heading headingType="h3" className="text-center" title={title} /> : null}
|
|
46
|
+
{description ? (
|
|
47
|
+
<p className={`text-m-light text-center ${styleMap.description} ${title ? 'mt-2' : ''}`}>
|
|
48
|
+
{description}
|
|
49
|
+
</p>
|
|
50
|
+
) : null}
|
|
51
|
+
{steps?.length ? (
|
|
52
|
+
<div className={`box-border py-0.5 mb-0.5 mt-5`}>
|
|
53
|
+
<div className="flex flex-col justify-between gap-x-[101px]">
|
|
54
|
+
{steps.map(renderStep(size, version, showLines))}
|
|
57
55
|
</div>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
</div>
|
|
57
|
+
) : null}
|
|
58
|
+
</BlockWrapper>
|
|
59
|
+
),
|
|
62
60
|
);
|
|
63
61
|
|
|
64
62
|
// TODO: Create universal function for this case
|
|
@@ -88,7 +86,6 @@ const renderDefaultStep =
|
|
|
88
86
|
(step: DefaultStep, i: number, steps: Step[]) => {
|
|
89
87
|
const isLastStep = steps.length - 1 === i;
|
|
90
88
|
const margin = size === 'normal' ? 'ml-[34px]' : 'ml-6';
|
|
91
|
-
const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
|
|
92
89
|
|
|
93
90
|
return (
|
|
94
91
|
<div key={String(i)}>
|
|
@@ -119,7 +116,6 @@ const renderDefaultStep =
|
|
|
119
116
|
};
|
|
120
117
|
|
|
121
118
|
const renderIconArea = (size: SizeVersion, version: BlockVersion) => (step: Step, i: number) => {
|
|
122
|
-
const styleMap = STEPS_BLOCK_STYLE_MAPS[version];
|
|
123
119
|
const iconAreaSize = STEPS_SIZE_MAP[size];
|
|
124
120
|
|
|
125
121
|
const iconSize = size === 'normal' ? '38' : '27';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
-
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
4
2
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
|
-
import {
|
|
3
|
+
import { checkCanRenderIcon } from './checkCanRenderIcon';
|
|
4
|
+
import { getIconWithVersion } from '../../utils/getIconWithVersion';
|
|
6
5
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
7
6
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
|
-
import { getIconWithVersion } from '../../utils/getIconWithVersion';
|
|
9
7
|
import { joinList } from '../../utils/joinList';
|
|
10
|
-
import {
|
|
11
|
-
import { checkCanRenderIcon } from './checkCanRenderIcon';
|
|
8
|
+
import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
|
|
12
9
|
import { renderStep } from './renderStep';
|
|
10
|
+
import { STEPS_BLOCK_STYLE } from './StepsBlockStyleMaps';
|
|
11
|
+
import { style } from '../../utils/style';
|
|
12
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
13
13
|
import type { Step, StepsBlockContent } from './StepsBlockContent';
|
|
14
14
|
import type { StyleType } from './StepsBlockStyleMaps';
|
|
15
|
-
import {
|
|
15
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
16
16
|
|
|
17
17
|
export interface StepsBlockProps extends StepsBlockContent, UniBlockProps {}
|
|
18
18
|
|
|
@@ -26,13 +26,15 @@ export const StepsBlock = JSX<StepsBlockProps>(
|
|
|
26
26
|
showLines = true,
|
|
27
27
|
steps = [],
|
|
28
28
|
button,
|
|
29
|
+
size = 'normal',
|
|
29
30
|
version = 'primary',
|
|
31
|
+
stepVersion = 'gray',
|
|
30
32
|
title,
|
|
31
33
|
...rest
|
|
32
34
|
}) => {
|
|
33
35
|
const shortGaps = steps.length > 3;
|
|
34
36
|
|
|
35
|
-
const styleMap =
|
|
37
|
+
const styleMap = STEPS_BLOCK_STYLE;
|
|
36
38
|
|
|
37
39
|
const lineOpacity = getLineOpacity(showLines);
|
|
38
40
|
const paddingX = getPaddingX(steps.length);
|
|
@@ -49,14 +51,14 @@ export const StepsBlock = JSX<StepsBlockProps>(
|
|
|
49
51
|
{...rest}
|
|
50
52
|
>
|
|
51
53
|
{title ? (
|
|
52
|
-
<Heading headingType="
|
|
54
|
+
<Heading headingType="h4" className="max-w-[752px] text-center mb-9" title={title} />
|
|
53
55
|
) : null}
|
|
54
56
|
{steps?.length ? (
|
|
55
57
|
<div className="box-border">
|
|
56
58
|
<div className={style('flex items-center', paddingX)}>
|
|
57
|
-
{joinList(
|
|
58
|
-
|
|
59
|
-
)}
|
|
59
|
+
{joinList(
|
|
60
|
+
<div className={style('h-0.5 w-full bg-secondary-light flex-1', lineOpacity)} />,
|
|
61
|
+
)(steps.map(renderStepIcon(styleMap, size, stepVersion)))}
|
|
60
62
|
</div>
|
|
61
63
|
<div
|
|
62
64
|
className={style(
|
|
@@ -68,25 +70,30 @@ export const StepsBlock = JSX<StepsBlockProps>(
|
|
|
68
70
|
</div>
|
|
69
71
|
</div>
|
|
70
72
|
) : null}
|
|
71
|
-
{button?.text ?
|
|
73
|
+
{button?.text ? renderButtonsSection([button], { className: 'mt-8 min-w-60' }) : null}
|
|
72
74
|
</BlockWrapper>
|
|
73
75
|
);
|
|
74
76
|
},
|
|
75
77
|
);
|
|
76
78
|
|
|
77
79
|
const renderStepIcon =
|
|
78
|
-
(styleMap: StyleType,
|
|
79
|
-
({ icon }: Step, i: number) =>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
)}
|
|
90
|
-
|
|
91
|
-
|
|
80
|
+
(styleMap: StyleType, size: string, stepVersion: BlockVersion) =>
|
|
81
|
+
({ icon }: Step, i: number) => {
|
|
82
|
+
const styleStepIconSize = size === 'normal' ? 'h-[100px] w-[100px]' : 'h-[63px] w-[63px]';
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<BlockWrapper
|
|
86
|
+
key={String(i)}
|
|
87
|
+
className={`${styleStepIconSize} flex justify-center items-center text-center rounded-full p-[26px] box-border z-10`}
|
|
88
|
+
version={stepVersion}
|
|
89
|
+
>
|
|
90
|
+
{checkCanRenderIcon(icon) ? (
|
|
91
|
+
<Img image={getIconWithVersion(icon || {}, stepVersion)} width="48" height="48" asSVG />
|
|
92
|
+
) : (
|
|
93
|
+
<span className={`text-h4 group-data-transparent:${styleMap.iconText} text-primary-text`}>
|
|
94
|
+
{i + 1}
|
|
95
|
+
</span>
|
|
96
|
+
)}
|
|
97
|
+
</BlockWrapper>
|
|
92
98
|
);
|
|
99
|
+
};
|