@redneckz/wildless-cms-uni-blocks 0.2.93 → 0.2.97
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 +134 -78
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Accordion/AccordionBlocks.d.ts +1 -2
- package/dist/components/Accordion/AccordionBlocks.js +2 -2
- package/dist/components/Accordion/AccordionBlocks.js.map +1 -1
- package/dist/components/Accordion/AccordionItem.js +3 -6
- package/dist/components/Accordion/AccordionItem.js.map +1 -1
- package/dist/components/BaseTile/BaseTile.js +9 -4
- package/dist/components/BaseTile/BaseTile.js.map +1 -1
- package/dist/components/ComparisonTable/ComparisonTableContent.d.ts +2 -3
- package/dist/components/ContentPage/ContentPage.d.ts +9 -1
- package/dist/components/ContentPage/ContentPage.js +20 -17
- package/dist/components/ContentPage/ContentPage.js.map +1 -1
- package/dist/components/ContentPage/toMobilePage.js +13 -2
- package/dist/components/ContentPage/toMobilePage.js.map +1 -1
- package/dist/components/CreditCalculator/CreditCalculator.js +3 -3
- package/dist/components/CreditCalculator/CreditCalculator.js.map +1 -1
- package/dist/components/Footer/Footer.js +1 -1
- package/dist/components/Footer/Footer.js.map +1 -1
- package/dist/components/Footer/Sitemap.js +1 -1
- package/dist/components/Footer/Sitemap.js.map +1 -1
- package/dist/components/Gallery/Gallery.mobile.js +1 -1
- package/dist/components/Gallery/Gallery.mobile.js.map +1 -1
- package/dist/components/Gallery/GalleryCardInner.d.ts +2 -0
- package/dist/components/Gallery/GalleryCardInner.js +19 -0
- package/dist/components/Gallery/GalleryCardInner.js.map +1 -0
- package/dist/components/Gallery/GalleryContainer.d.ts +13 -0
- package/dist/components/Gallery/GalleryContainer.js +16 -0
- package/dist/components/Gallery/GalleryContainer.js.map +1 -0
- package/dist/components/Gallery/GalleryContent.d.ts +8 -2
- package/dist/components/Gallery/GalleryInner.d.ts +1 -1
- package/dist/components/Gallery/GalleryInner.js +8 -36
- package/dist/components/Gallery/GalleryInner.js.map +1 -1
- package/dist/components/Gallery/constants.d.ts +6 -0
- package/dist/components/Gallery/constants.js +19 -0
- package/dist/components/Gallery/constants.js.map +1 -0
- package/dist/components/Header/Header.js +3 -3
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocs.js +3 -3
- package/dist/components/LinkDocs/LinkDocs.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocsContent.d.ts +3 -3
- package/dist/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/dist/components/ProductBlock/ProductBlock.js +12 -4
- package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +13 -2
- package/dist/components/ProductBlock/ProductBlockInner.js +16 -4
- package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +2 -2
- package/dist/components/TariffsTable/TariffsTableContent.d.ts +5 -1
- package/dist/components/TextBlock/TextBlockContent.d.ts +1 -0
- package/dist/components/Tile/TileContent.d.ts +1 -1
- package/dist/model/ButtonVersion.d.ts +1 -0
- package/dist/model/LinkProps.d.ts +2 -1
- package/dist/types.d.ts +8 -0
- package/dist/ui-kit/BlockItem/BlockItem.js +4 -4
- package/dist/ui-kit/BlockItem/BlockItem.js.map +1 -1
- package/dist/ui-kit/Button/ButtonProps.d.ts +6 -1
- package/dist/ui-kit/Checkbox/Checkbox.js +2 -2
- package/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
- package/dist/ui-kit/Icon/Icon.js +1 -1
- package/dist/ui-kit/Icon/Icon.js.map +1 -1
- package/dist/ui-kit/Icon/IconProps.d.ts +49 -41
- package/dist/ui-kit/Icon/IconProps.js +45 -41
- package/dist/ui-kit/Icon/IconProps.js.map +1 -1
- package/dist/ui-kit/Img.js +9 -3
- package/dist/ui-kit/Img.js.map +1 -1
- package/dist/ui-kit/InputRange/InputRange.js +2 -1
- package/dist/ui-kit/InputRange/InputRange.js.map +1 -1
- package/dist/ui-kit/SearchBar.js +1 -1
- package/dist/ui-kit/SearchBar.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Accordion/AccordionBlocks.d.ts +1 -2
- package/lib/components/Accordion/AccordionBlocks.js +1 -2
- package/lib/components/Accordion/AccordionBlocks.js.map +1 -1
- package/lib/components/Accordion/AccordionItem.js +1 -1
- package/lib/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/components/BaseTile/BaseTile.js +9 -4
- package/lib/components/BaseTile/BaseTile.js.map +1 -1
- package/lib/components/ComparisonTable/ComparisonTableContent.d.ts +2 -3
- package/lib/components/ContentPage/ContentPage.d.ts +9 -1
- package/lib/components/ContentPage/ContentPage.js +20 -17
- package/lib/components/ContentPage/ContentPage.js.map +1 -1
- package/lib/components/ContentPage/toMobilePage.js +13 -2
- package/lib/components/ContentPage/toMobilePage.js.map +1 -1
- package/lib/components/CreditCalculator/CreditCalculator.js +3 -3
- package/lib/components/CreditCalculator/CreditCalculator.js.map +1 -1
- package/lib/components/Footer/Footer.js +1 -1
- package/lib/components/Footer/Footer.js.map +1 -1
- package/lib/components/Footer/Sitemap.js +1 -1
- package/lib/components/Footer/Sitemap.js.map +1 -1
- package/lib/components/Gallery/Gallery.mobile.js +1 -1
- package/lib/components/Gallery/Gallery.mobile.js.map +1 -1
- package/lib/components/Gallery/GalleryCardInner.d.ts +2 -0
- package/lib/components/Gallery/GalleryCardInner.js +17 -0
- package/lib/components/Gallery/GalleryCardInner.js.map +1 -0
- package/lib/components/Gallery/GalleryContainer.d.ts +13 -0
- package/lib/components/Gallery/GalleryContainer.js +14 -0
- package/lib/components/Gallery/GalleryContainer.js.map +1 -0
- package/lib/components/Gallery/GalleryContent.d.ts +8 -2
- package/lib/components/Gallery/GalleryInner.d.ts +1 -1
- package/lib/components/Gallery/GalleryInner.js +6 -34
- package/lib/components/Gallery/GalleryInner.js.map +1 -1
- package/lib/components/Gallery/constants.d.ts +6 -0
- package/lib/components/Gallery/constants.js +17 -0
- package/lib/components/Gallery/constants.js.map +1 -0
- package/lib/components/Header/Header.js +3 -3
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocs.fixture.d.ts +3 -3
- package/lib/components/LinkDocs/LinkDocs.js +3 -3
- package/lib/components/LinkDocs/LinkDocs.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocsContent.d.ts +3 -3
- package/lib/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/lib/components/ProductBlock/ProductBlock.fixture.d.ts +1 -0
- package/lib/components/ProductBlock/ProductBlock.js +12 -4
- package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +13 -2
- package/lib/components/ProductBlock/ProductBlockInner.js +16 -4
- package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +2 -2
- package/lib/components/TariffsTable/TariffsTableContent.d.ts +5 -1
- package/lib/components/TextBlock/TextBlockContent.d.ts +1 -0
- package/lib/components/Tile/TileContent.d.ts +1 -1
- package/lib/model/ButtonVersion.d.ts +1 -0
- package/lib/model/LinkProps.d.ts +2 -1
- package/lib/types.d.ts +8 -0
- package/lib/ui-kit/BlockItem/BlockItem.js +4 -4
- package/lib/ui-kit/BlockItem/BlockItem.js.map +1 -1
- package/lib/ui-kit/Button/ButtonProps.d.ts +6 -1
- package/lib/ui-kit/Checkbox/Checkbox.js +2 -2
- package/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
- package/lib/ui-kit/Icon/Icon.js +1 -1
- package/lib/ui-kit/Icon/Icon.js.map +1 -1
- package/lib/ui-kit/Icon/IconProps.d.ts +49 -41
- package/lib/ui-kit/Icon/IconProps.js +45 -41
- package/lib/ui-kit/Icon/IconProps.js.map +1 -1
- package/lib/ui-kit/Img.js +9 -3
- package/lib/ui-kit/Img.js.map +1 -1
- package/lib/ui-kit/InputRange/InputRange.js +2 -1
- package/lib/ui-kit/InputRange/InputRange.js.map +1 -1
- package/lib/ui-kit/SearchBar.js +1 -1
- package/lib/ui-kit/SearchBar.js.map +1 -1
- package/package.json +6 -4
- package/src/components/Accordion/Accordion.example.json +4 -4
- package/src/components/Accordion/Accordion.fixture.tsx +5 -1
- package/src/components/Accordion/AccordionBlocks.tsx +1 -3
- package/src/components/Accordion/AccordionItem.tsx +1 -1
- package/src/components/BaseTile/BaseTile.tsx +14 -5
- package/src/components/BenefitsBlock/BenefitsBlock.fixture.tsx +31 -28
- package/src/components/ComparisonTable/ComparisonTable.example.json +1 -1
- package/src/components/ComparisonTable/ComparisonTable.fixture.tsx +43 -53
- package/src/components/ComparisonTable/ComparisonTableContent.ts +2 -3
- package/src/components/ContentPage/ContentPage.page.json +31 -49
- package/src/components/ContentPage/ContentPage.tsx +71 -36
- package/src/components/ContentPage/toMobilePage.ts +19 -2
- package/src/components/CreditCalculator/CreditCalculator.fixture.tsx +9 -1
- package/src/components/CreditCalculator/CreditCalculator.tsx +11 -8
- package/src/components/ExchangeRateTile/ExchangeRateTile.fixture.tsx +1 -1
- package/src/components/Footer/Footer.fixture.tsx +265 -258
- package/src/components/Footer/Footer.tsx +3 -3
- package/src/components/Footer/Sitemap.tsx +1 -1
- package/src/components/Gallery/Gallery.fixture.tsx +52 -48
- package/src/components/Gallery/Gallery.mobile.tsx +1 -3
- package/src/components/Gallery/GalleryCardInner.tsx +53 -0
- package/src/components/Gallery/GalleryContainer.tsx +58 -0
- package/src/components/Gallery/GalleryContent.ts +8 -2
- package/src/components/Gallery/GalleryInner.tsx +15 -94
- package/src/components/Gallery/constants.ts +22 -0
- package/src/components/Header/Header.tsx +14 -12
- package/src/components/Headline/Headline.fixture.tsx +25 -3
- package/src/components/LikeControl/LikeControl.fixture.tsx +5 -1
- package/src/components/LinkDocs/LinkDocs.example.json +26 -0
- package/src/components/LinkDocs/LinkDocs.fixture.tsx +23 -6
- package/src/components/LinkDocs/LinkDocs.tsx +3 -3
- package/src/components/LinkDocs/LinkDocsContent.ts +3 -3
- package/src/components/MiniGallery/MiniGallery.fixture.tsx +12 -22
- package/src/components/MobileAppTile/MobileAppTile.fixture.tsx +3 -1
- package/src/components/PictureText/PictureText.example.json +1 -1
- package/src/components/PictureText/PictureText.fixture.tsx +5 -1
- package/src/components/Placeholder/Placeholder.fixture.tsx +5 -1
- package/src/components/ProductBlock/ProductBlock.example.json +1 -1
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +141 -77
- package/src/components/ProductBlock/ProductBlock.tsx +20 -7
- package/src/components/ProductBlock/ProductBlockContent.ts +14 -2
- package/src/components/ProductBlock/ProductBlockInner.tsx +39 -7
- package/src/components/ProductGallery/ProductGallery.fixture.tsx +96 -93
- package/src/components/ProductTile/ProductTile.example.json +1 -1
- package/src/components/ProductTile/ProductTile.fixture.tsx +4 -4
- package/src/components/ProductTile/ProductTileContent.ts +2 -2
- package/src/components/PromoTile/PromoTile.fixture.tsx +1 -1
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +21 -18
- package/src/components/TariffsTable/TariffsTable.fixture.tsx +5 -16
- package/src/components/TariffsTable/TariffsTableContent.ts +5 -1
- package/src/components/TextBlock/TextBlock.fixture.tsx +62 -45
- package/src/components/TextBlock/TextBlockContent.ts +1 -0
- package/src/components/Tile/Tile.example.json +1 -1
- package/src/components/Tile/Tile.fixture.tsx +11 -8
- package/src/components/Tile/TileContent.ts +1 -1
- package/src/icons/AppleIcon.svg +1 -1
- package/src/icons/CalendarWhiteIcon.svg +17 -0
- package/src/icons/EmptyWalletWhiteIcon.svg +16 -0
- package/src/icons/GridIcon.svg +2 -2
- package/src/icons/PercentageSquareWhiteIcon.svg +16 -0
- package/src/icons/PlayMarketIcon.svg +1 -1
- package/src/model/ButtonVersion.ts +1 -0
- package/src/model/LinkProps.ts +2 -1
- package/src/setup-fixture.ts +1 -2
- package/src/types.ts +11 -1
- package/src/ui-kit/BlockItem/BlockItem.tsx +4 -4
- package/src/ui-kit/Button/ButtonProps.ts +6 -1
- package/src/ui-kit/Checkbox/Checkbox.tsx +7 -3
- package/src/ui-kit/Icon/Icon.tsx +1 -1
- package/src/ui-kit/Icon/IconProps.ts +8 -0
- package/src/ui-kit/Img.tsx +23 -10
- package/src/ui-kit/InputRange/InputRange.tsx +7 -6
- package/src/ui-kit/SearchBar.tsx +3 -4
|
@@ -3,6 +3,7 @@ import type { BlockDef, ContentPageDef, UniBlockProps } from '../../types';
|
|
|
3
3
|
import type { BlockContent } from '../BlockContent';
|
|
4
4
|
import { LikeControl } from '../LikeControl/LikeControl';
|
|
5
5
|
import { Placeholder } from '../Placeholder/Placeholder';
|
|
6
|
+
import { ContentPageContext } from './ContentPageContext';
|
|
6
7
|
|
|
7
8
|
interface BlockDecoratorProps<VNode> {
|
|
8
9
|
blockClassName: string;
|
|
@@ -20,12 +21,21 @@ export type JSXBlock = (
|
|
|
20
21
|
context?: any,
|
|
21
22
|
) => any;
|
|
22
23
|
|
|
24
|
+
export type BlocksRegistry = Record<string, JSXBlock>;
|
|
25
|
+
|
|
23
26
|
export interface ContentPageProps extends UniBlockProps {
|
|
24
|
-
blocksRegistry:
|
|
27
|
+
blocksRegistry: BlocksRegistry;
|
|
25
28
|
data: ContentPageDef;
|
|
26
29
|
blockDecorator?: BlockDecorator;
|
|
27
30
|
}
|
|
28
31
|
|
|
32
|
+
export interface RenderBlockFunc {
|
|
33
|
+
block: BlockDef;
|
|
34
|
+
blockDecorator: BlockDecorator;
|
|
35
|
+
blocksRegistry: BlocksRegistry;
|
|
36
|
+
context: ContentPageContext;
|
|
37
|
+
}
|
|
38
|
+
|
|
29
39
|
const defaultBlockDecorator: BlockDecorator = ({ blockClassName, block, render }) =>
|
|
30
40
|
render({ blockClassName, block });
|
|
31
41
|
|
|
@@ -34,14 +44,32 @@ export const ContentPage = JSX<ContentPageProps>(
|
|
|
34
44
|
className,
|
|
35
45
|
context,
|
|
36
46
|
blocksRegistry,
|
|
37
|
-
data: { style: pageStyle, blocks, likeControl, colorPalette = 'pc' },
|
|
47
|
+
data: { style: pageStyle, blocks, slots = {}, likeControl, colorPalette = 'pc' },
|
|
38
48
|
blockDecorator = defaultBlockDecorator,
|
|
39
49
|
}) => {
|
|
50
|
+
const { header } = slots;
|
|
51
|
+
|
|
40
52
|
return (
|
|
41
|
-
<section
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
53
|
+
<section
|
|
54
|
+
className={`relative ${style2className(pageStyle)} ${className || ''}`}
|
|
55
|
+
data-theme={colorPalette}
|
|
56
|
+
>
|
|
57
|
+
{header?.blocks?.length ? (
|
|
58
|
+
<div className={`${style2className(header?.style)}`}>
|
|
59
|
+
{header.blocks.map((block, i) =>
|
|
60
|
+
renderBlock({ block, blockDecorator, blocksRegistry, context }, i),
|
|
61
|
+
)}
|
|
62
|
+
</div>
|
|
63
|
+
) : null}
|
|
64
|
+
|
|
65
|
+
{blocks?.length ? (
|
|
66
|
+
<div className="container grid grid-cols-12 gap-1">
|
|
67
|
+
{blocks.map((block, i) =>
|
|
68
|
+
renderBlock({ block, blockDecorator, blocksRegistry, context }, i),
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
) : null}
|
|
72
|
+
|
|
45
73
|
{likeControl && (
|
|
46
74
|
<div className="flex items-end absolute bottom-0 right-0 h-full pointer-events-none">
|
|
47
75
|
<LikeControl
|
|
@@ -52,39 +80,46 @@ export const ContentPage = JSX<ContentPageProps>(
|
|
|
52
80
|
)}
|
|
53
81
|
</section>
|
|
54
82
|
);
|
|
55
|
-
|
|
56
|
-
function renderBlock(block: BlockDef, i: number) {
|
|
57
|
-
const { type } = block;
|
|
58
|
-
if (!(type in blocksRegistry)) {
|
|
59
|
-
console.warn(`No block with "${type}" is registered`);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const BlockComponent = blocksRegistry[type] || Placeholder;
|
|
63
|
-
return blockDecorator(
|
|
64
|
-
{
|
|
65
|
-
blockClassName: style2className(block.style),
|
|
66
|
-
block,
|
|
67
|
-
render: (props) => {
|
|
68
|
-
const { version, content, blocks } = props.block;
|
|
69
|
-
return (
|
|
70
|
-
<BlockComponent
|
|
71
|
-
key={`${type}-${i}`}
|
|
72
|
-
className={props.blockClassName}
|
|
73
|
-
version={version}
|
|
74
|
-
context={context}
|
|
75
|
-
{...content}
|
|
76
|
-
>
|
|
77
|
-
{blocks?.length ? blocks.map(renderBlock) : null}
|
|
78
|
-
</BlockComponent>
|
|
79
|
-
);
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
`block-${i}`,
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
83
|
},
|
|
86
84
|
);
|
|
87
85
|
|
|
86
|
+
function renderBlock(
|
|
87
|
+
{ block, blockDecorator, blocksRegistry, context }: RenderBlockFunc,
|
|
88
|
+
i: number,
|
|
89
|
+
) {
|
|
90
|
+
const { type } = block;
|
|
91
|
+
if (!(type in blocksRegistry)) {
|
|
92
|
+
console.warn(`No block with "${type}" is registered`);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const BlockComponent = blocksRegistry[type] || Placeholder;
|
|
96
|
+
return blockDecorator(
|
|
97
|
+
{
|
|
98
|
+
blockClassName: style2className(block.style),
|
|
99
|
+
block,
|
|
100
|
+
render: (props) => {
|
|
101
|
+
const { version, content, blocks } = props.block;
|
|
102
|
+
return (
|
|
103
|
+
<BlockComponent
|
|
104
|
+
key={`${type}-${i}`}
|
|
105
|
+
className={props.blockClassName}
|
|
106
|
+
version={version}
|
|
107
|
+
context={context}
|
|
108
|
+
{...content}
|
|
109
|
+
>
|
|
110
|
+
{blocks?.length
|
|
111
|
+
? blocks.map((block, i) =>
|
|
112
|
+
renderBlock({ block, blockDecorator, blocksRegistry, context }, i),
|
|
113
|
+
)
|
|
114
|
+
: null}
|
|
115
|
+
</BlockComponent>
|
|
116
|
+
);
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
`block-${i}`,
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
88
123
|
function style2className(style: string[] | undefined | null): string {
|
|
89
124
|
return style ? style.join(' ') : '';
|
|
90
125
|
}
|
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
import type { BlockDef, ContentPageDef } from '../../types';
|
|
2
2
|
|
|
3
3
|
export function toMobilePage(contentPage: ContentPageDef): ContentPageDef {
|
|
4
|
-
const
|
|
4
|
+
const { blocks, slots } = contentPage;
|
|
5
|
+
|
|
5
6
|
return {
|
|
6
7
|
...contentPage,
|
|
7
|
-
blocks,
|
|
8
|
+
blocks: getMobileBlocks(blocks),
|
|
9
|
+
slots:
|
|
10
|
+
slots &&
|
|
11
|
+
Object.keys(slots).reduce(
|
|
12
|
+
(res, key) => ({
|
|
13
|
+
...res,
|
|
14
|
+
[key]: {
|
|
15
|
+
...slots[key],
|
|
16
|
+
blocks: getMobileBlocks(slots[key].blocks),
|
|
17
|
+
},
|
|
18
|
+
}),
|
|
19
|
+
{},
|
|
20
|
+
),
|
|
8
21
|
};
|
|
9
22
|
}
|
|
10
23
|
|
|
24
|
+
function getMobileBlocks(blocks?: BlockDef[]) {
|
|
25
|
+
return blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
|
|
26
|
+
}
|
|
27
|
+
|
|
11
28
|
function toMobileBlock(block: BlockDef): BlockDef {
|
|
12
29
|
const { mobile } = block;
|
|
13
30
|
if (mobile) {
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { CreditCalculator } from './CreditCalculator';
|
|
2
2
|
import { context } from '../../setup-fixture';
|
|
3
3
|
|
|
4
|
-
export default
|
|
4
|
+
export default (
|
|
5
|
+
<div className="container grid grid-cols-12">
|
|
6
|
+
<CreditCalculator
|
|
7
|
+
className="col-span-12"
|
|
8
|
+
context={context}
|
|
9
|
+
directoryName="credit-calculator-data"
|
|
10
|
+
/>
|
|
11
|
+
</div>
|
|
12
|
+
);
|
|
@@ -27,7 +27,7 @@ const STEP_MONEY = 1000;
|
|
|
27
27
|
const STEP_MONTHS = 1;
|
|
28
28
|
const DEFAULT_PAYMENT_TYPE = 'annuity';
|
|
29
29
|
|
|
30
|
-
const borderStyle = 'border-solid border-
|
|
30
|
+
const borderStyle = 'border-solid border-[3px] border-primary-main rounded-md';
|
|
31
31
|
|
|
32
32
|
export const CreditCalculator = JSX<CreditCalculatorProps>(
|
|
33
33
|
({ context, className, directoryName }) => {
|
|
@@ -72,10 +72,12 @@ export const CreditCalculator = JSX<CreditCalculatorProps>(
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
return (
|
|
75
|
-
<section className={`font-sans text-primary-text bg-white p-4 ${className}`}>
|
|
76
|
-
<div
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
<section className={`font-sans text-primary-text bg-white p-4 w-[847px] ${className || ''}`}>
|
|
76
|
+
<div
|
|
77
|
+
className={`box-border p-[49px] pr-[53px] flex flex-col justify-between ${borderStyle}`}
|
|
78
|
+
>
|
|
79
|
+
<div className="flex justify-between ">
|
|
80
|
+
<div className="grow mr-[42px] w-[465px]">
|
|
79
81
|
<InputRange
|
|
80
82
|
title="Желаемая сумма кредита, ₽"
|
|
81
83
|
items={[
|
|
@@ -89,6 +91,7 @@ export const CreditCalculator = JSX<CreditCalculatorProps>(
|
|
|
89
91
|
onChange={setMoneyValue}
|
|
90
92
|
/>
|
|
91
93
|
<InputRange
|
|
94
|
+
className="mt-[23px]"
|
|
92
95
|
title="Срок кредита, месяцев"
|
|
93
96
|
items={['Или выберите из предложенных вариантов ниже']}
|
|
94
97
|
min={minMonths}
|
|
@@ -106,14 +109,14 @@ export const CreditCalculator = JSX<CreditCalculatorProps>(
|
|
|
106
109
|
onChange={setIsAnnuityChecked}
|
|
107
110
|
/>
|
|
108
111
|
<Checkbox
|
|
109
|
-
className="mb-
|
|
112
|
+
className="mt-3 mb-7"
|
|
110
113
|
text="Комплексная страховая защита"
|
|
111
114
|
checked={isInsuranceChecked}
|
|
112
115
|
onChange={setIsInsuranceChecked}
|
|
113
116
|
/>
|
|
114
117
|
</div>
|
|
115
|
-
<div className="p-9 bg-primary-main rounded-md text-white">
|
|
116
|
-
<div className="text-base mb-
|
|
118
|
+
<div className="basis-[226px] shrink-0 box-border h-fit p-9 bg-primary-main rounded-md text-white">
|
|
119
|
+
<div className="text-base mb-[18px]">Наше предложение</div>
|
|
117
120
|
<div className="text-sm opacity-60">Ежемесячный платёж</div>
|
|
118
121
|
<div className="text-lg mb-3">
|
|
119
122
|
{addSpacesBetweenNumbers(Math.round(montlyPayment))} ₽
|