@redneckz/wildless-cms-uni-blocks 0.3.69 → 0.3.70
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 +84 -12
- package/bundle/bundle.umd.min.js +1 -1
- package/cosmos-static/icons/DoneIcon.svg +1 -0
- package/dist/components/BlockContent.d.ts +3 -1
- package/dist/components/Blocks.d.ts +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Insurance/Insurance.js +4 -6
- package/dist/components/Insurance/Insurance.js.map +1 -1
- package/dist/components/Insurance/InsuranceContent.d.ts +2 -5
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlock.d.ts +5 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlock.js +34 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlock.js.map +1 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockContent.d.ts +30 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockContent.js +2 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockContent.js.map +1 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.d.ts +5 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js +51 -0
- package/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -0
- package/dist/components/StepsBlock/StepsBlock.js +1 -1
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/icons/IconName.d.ts +4 -2
- package/dist/icons/IconName.js +2 -0
- package/dist/icons/IconName.js.map +1 -1
- package/dist/model/Insurance.d.ts +6 -0
- package/dist/model/Insurance.js +2 -0
- package/dist/model/Insurance.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/BlockContent.d.ts +3 -1
- package/lib/components/Blocks.d.ts +1 -0
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Insurance/Insurance.js +4 -6
- package/lib/components/Insurance/Insurance.js.map +1 -1
- package/lib/components/Insurance/InsuranceContent.d.ts +2 -5
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlock.d.ts +5 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlock.fixture.d.ts +4 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlock.js +32 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlock.js.map +1 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockContent.d.ts +30 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockContent.js +2 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockContent.js.map +1 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.d.ts +5 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js +49 -0
- package/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -0
- package/lib/components/StepsBlock/StepsBlock.js +1 -1
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/icons/IconName.d.ts +4 -2
- package/lib/icons/IconName.js +2 -0
- package/lib/icons/IconName.js.map +1 -1
- package/lib/model/Insurance.d.ts +6 -0
- package/lib/model/Insurance.js +2 -0
- package/lib/model/Insurance.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +2 -0
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/BlockContent.d.ts +3 -1
- package/mobile/dist/components/Insurance/Insurance.js +4 -6
- package/mobile/dist/components/Insurance/Insurance.js.map +1 -1
- package/mobile/dist/components/Insurance/InsuranceContent.d.ts +2 -5
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlock.d.ts +5 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlock.js +34 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlock.js.map +1 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockContent.d.ts +30 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockContent.js +2 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockContent.js.map +1 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.d.ts +5 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js +51 -0
- package/mobile/dist/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -0
- package/mobile/dist/icons/IconName.d.ts +4 -2
- package/mobile/dist/icons/IconName.js +2 -0
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/model/Insurance.d.ts +6 -0
- package/mobile/dist/model/Insurance.js +2 -0
- package/mobile/dist/model/Insurance.js.map +1 -0
- package/mobile/lib/components/BlockContent.d.ts +3 -1
- package/mobile/lib/components/Insurance/Insurance.js +4 -6
- package/mobile/lib/components/Insurance/Insurance.js.map +1 -1
- package/mobile/lib/components/Insurance/InsuranceContent.d.ts +2 -5
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlock.d.ts +5 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlock.js +32 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlock.js.map +1 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockContent.d.ts +30 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockContent.js +2 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockContent.js.map +1 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.d.ts +5 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js +49 -0
- package/mobile/lib/components/InsuranceAmountBlock/InsuranceAmountBlockInner.js.map +1 -0
- package/mobile/lib/icons/IconName.d.ts +4 -2
- package/mobile/lib/icons/IconName.js +2 -0
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/model/Insurance.d.ts +6 -0
- package/mobile/lib/model/Insurance.js +2 -0
- package/mobile/lib/model/Insurance.js.map +1 -0
- package/mobile/src/components/BlockContent.ts +5 -1
- package/mobile/src/components/ContentPage/ContentPage.page.json +50 -1
- package/mobile/src/components/Insurance/Insurance.example.json +21 -0
- package/mobile/src/components/Insurance/Insurance.tsx +10 -9
- package/mobile/src/components/Insurance/InsuranceContent.ts +9 -11
- package/mobile/src/components/InsuranceAmountBlock/InsuranceAmountBlock.example.json +44 -0
- package/mobile/src/components/InsuranceAmountBlock/InsuranceAmountBlock.tsx +84 -0
- package/mobile/src/components/InsuranceAmountBlock/InsuranceAmountBlockContent.ts +33 -0
- package/mobile/src/components/InsuranceAmountBlock/InsuranceAmountBlockInner.tsx +157 -0
- package/mobile/src/icons/DoneIcon.svg +4 -0
- package/mobile/src/icons/IconName.ts +4 -4
- package/mobile/src/model/Insurance.ts +6 -0
- package/package.json +2 -2
- package/src/components/BlockContent.ts +5 -1
- package/src/components/Blocks.ts +2 -0
- package/src/components/ContentPage/ContentPage.page.json +50 -1
- package/src/components/Insurance/Insurance.example.json +21 -0
- package/src/components/Insurance/Insurance.fixture.tsx +5 -4
- package/src/components/Insurance/Insurance.tsx +10 -9
- package/src/components/Insurance/InsuranceContent.ts +9 -11
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlock.example.json +44 -0
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlock.fixture.tsx +52 -0
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlock.tsx +84 -0
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlockContent.ts +33 -0
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlockInner.tsx +157 -0
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +3 -3
- package/src/components/StepsBlock/StepsBlock.tsx +1 -1
- package/src/icons/DoneIcon.svg +4 -0
- package/src/icons/IconName.ts +4 -1
- package/src/model/Insurance.ts +6 -0
- package/mobile/src/components/Insurance/Insuranse.example.json +0 -36
- package/src/components/Insurance/Insuranse.example.json +0 -36
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import type { Picture } from '../../model/Picture';
|
|
2
2
|
import type { BenefitsBlockContent } from '../BenefitsBlock/BenefitsBlockContent';
|
|
3
|
+
import type { InsuranceProps } from '../../model/Insurance';
|
|
3
4
|
|
|
4
|
-
export type InsuranceContent = BenefitsBlockContent &
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
insuranceSum?: number;
|
|
13
|
-
image?: Picture;
|
|
14
|
-
};
|
|
5
|
+
export type InsuranceContent = BenefitsBlockContent &
|
|
6
|
+
InsuranceProps & {
|
|
7
|
+
/** @title Заголовок */
|
|
8
|
+
title?: string;
|
|
9
|
+
/** @title Описание */
|
|
10
|
+
description?: string;
|
|
11
|
+
image?: Picture;
|
|
12
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Заголовок",
|
|
3
|
+
"button": {
|
|
4
|
+
"href": "https://rshb.ru",
|
|
5
|
+
"text": "Текст кнопки"
|
|
6
|
+
},
|
|
7
|
+
"insuranceTabs": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Описание",
|
|
10
|
+
"card": [
|
|
11
|
+
{
|
|
12
|
+
"sum": 200000,
|
|
13
|
+
"fee": 2100,
|
|
14
|
+
"icon": { "icon": "ActualBalanceIcon" }
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"sum": 200000,
|
|
18
|
+
"fee": 2100,
|
|
19
|
+
"icon": { "icon": "ActualBalanceIcon" }
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"title": "Описание",
|
|
25
|
+
"card": [
|
|
26
|
+
{
|
|
27
|
+
"sum": 200000,
|
|
28
|
+
"fee": 2100,
|
|
29
|
+
"icon": { "icon": "ActualBalanceIcon" }
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"sum": 200000,
|
|
33
|
+
"fee": 2100,
|
|
34
|
+
"icon": { "icon": "ActualBalanceIcon" }
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"sum": 200000,
|
|
38
|
+
"fee": 2100,
|
|
39
|
+
"icon": { "icon": "ActualBalanceIcon" }
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { context } from '../../setup-fixture';
|
|
2
|
+
import { InsuranceAmountBlock } from './InsuranceAmountBlock';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
default: (
|
|
6
|
+
<div className="container grid grid-cols-12">
|
|
7
|
+
<InsuranceAmountBlock
|
|
8
|
+
className="col-span-12"
|
|
9
|
+
context={context}
|
|
10
|
+
title="Выбор страховой суммы"
|
|
11
|
+
button={{ href: 'https://rshb.ru', text: 'Выбрать программу' }}
|
|
12
|
+
insuranceTabs={[
|
|
13
|
+
{
|
|
14
|
+
title: 'Индивидуальный',
|
|
15
|
+
cards: [
|
|
16
|
+
{
|
|
17
|
+
sum: 200000,
|
|
18
|
+
fee: 2100,
|
|
19
|
+
icon: { icon: 'ActualBalanceIcon' },
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
sum: 200000,
|
|
23
|
+
fee: 2100,
|
|
24
|
+
icon: { icon: 'ActualBalanceIcon' },
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
sum: 200000,
|
|
28
|
+
fee: 2100,
|
|
29
|
+
icon: { icon: 'ActualBalanceIcon' },
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
title: 'Семейный',
|
|
35
|
+
cards: [
|
|
36
|
+
{
|
|
37
|
+
sum: 400000,
|
|
38
|
+
fee: 3600,
|
|
39
|
+
icon: { icon: 'ActualBalanceIcon' },
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
sum: 600000,
|
|
43
|
+
fee: 3600,
|
|
44
|
+
icon: { icon: 'MoneyInsuranceIcon' },
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
]}
|
|
49
|
+
/>
|
|
50
|
+
</div>
|
|
51
|
+
),
|
|
52
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { UniBlockProps } from '../../types';
|
|
3
|
+
import type { InsuranceAmountBlockContent } from './InsuranceAmountBlockContent';
|
|
4
|
+
import { InsuranceAmountBlockInner } from './InsuranceAmountBlockInner';
|
|
5
|
+
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
6
|
+
import { Button } from '../../ui-kit/Button/Button';
|
|
7
|
+
|
|
8
|
+
export interface InsuranceAmountBlockProps extends InsuranceAmountBlockContent, UniBlockProps {}
|
|
9
|
+
|
|
10
|
+
export const InsuranceAmountBlock = JSX<InsuranceAmountBlockProps>(
|
|
11
|
+
({ className = '', context, title, insuranceTabs = [], button, anchor = null }) => {
|
|
12
|
+
const insuranceGalleries = insuranceTabs.map((_) => _.cards);
|
|
13
|
+
const [activeSlideIndex, setActiveSlideIndex] = context.useState(0);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<section
|
|
17
|
+
id={anchor}
|
|
18
|
+
className={`box-border py-[50px] overflow-hidden relative font-sans w-100 bg-white ${className}`}
|
|
19
|
+
>
|
|
20
|
+
{title ? <Heading className="text-center" title={title} headingType="h3" /> : null}
|
|
21
|
+
<div className="p-1.5 bg-secondary-light w-fit m-auto rounded-md mt-[34px]">
|
|
22
|
+
{insuranceTabs.map((item, i) =>
|
|
23
|
+
renderNavButton({
|
|
24
|
+
title: item?.title,
|
|
25
|
+
i,
|
|
26
|
+
activeSlideIndex,
|
|
27
|
+
onClick: () => setActiveSlideIndex(i),
|
|
28
|
+
}),
|
|
29
|
+
)}
|
|
30
|
+
</div>
|
|
31
|
+
<div
|
|
32
|
+
className="flex"
|
|
33
|
+
style={{ transform: `translateX(-${activeSlideIndex}00%)` }}
|
|
34
|
+
role="list"
|
|
35
|
+
>
|
|
36
|
+
{renderInsuranceGalleries({
|
|
37
|
+
context,
|
|
38
|
+
className,
|
|
39
|
+
insuranceGalleries,
|
|
40
|
+
})}
|
|
41
|
+
</div>
|
|
42
|
+
{button?.text ? (
|
|
43
|
+
<div className="flex justify-center">
|
|
44
|
+
<Button
|
|
45
|
+
className="box-border p-4 h-14 w-full max-w-[240px]"
|
|
46
|
+
version={button?.version || 'primary'}
|
|
47
|
+
href={button.href}
|
|
48
|
+
>
|
|
49
|
+
{button.text}
|
|
50
|
+
</Button>
|
|
51
|
+
</div>
|
|
52
|
+
) : null}
|
|
53
|
+
</section>
|
|
54
|
+
);
|
|
55
|
+
},
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const renderInsuranceGalleries = ({ insuranceGalleries, context, className }: any) => {
|
|
59
|
+
return insuranceGalleries?.length
|
|
60
|
+
? insuranceGalleries.map((cards) => (
|
|
61
|
+
<InsuranceAmountBlockInner context={context} className={className} cards={cards} />
|
|
62
|
+
))
|
|
63
|
+
: null;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
function renderNavButton({ title, i, activeSlideIndex, onClick }) {
|
|
67
|
+
const isActiveBtn = i === activeSlideIndex;
|
|
68
|
+
|
|
69
|
+
const btnClassName = isActiveBtn
|
|
70
|
+
? 'bg-primary-main text-white rounded-md'
|
|
71
|
+
: `text-secondary-text`;
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<button
|
|
75
|
+
type="button"
|
|
76
|
+
key={String(i)}
|
|
77
|
+
onClick={onClick}
|
|
78
|
+
aria-label={title}
|
|
79
|
+
className={`box-border px-4 py-3 text-m-md ${btnClassName}`}
|
|
80
|
+
>
|
|
81
|
+
{title}
|
|
82
|
+
</button>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Picture } from '../../model/Picture';
|
|
2
|
+
import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
|
|
3
|
+
import type { InsuranceProps } from '../../model/Insurance';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @title Кнопка выбора программы
|
|
7
|
+
*/
|
|
8
|
+
export type cardItem = InsuranceProps & {
|
|
9
|
+
icon?: Picture;
|
|
10
|
+
/** @title Страховой взнос */
|
|
11
|
+
fee?: number;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @title Вкладка
|
|
16
|
+
*/
|
|
17
|
+
export interface InsuranceAmountBlockTabs {
|
|
18
|
+
/** @title Заголовок вкладки */
|
|
19
|
+
title?: string;
|
|
20
|
+
/** @title Содержимое вкладки */
|
|
21
|
+
cards?: cardItem[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @title Страховые суммы
|
|
26
|
+
*/
|
|
27
|
+
export interface InsuranceAmountBlockContent {
|
|
28
|
+
/** @title Заголовок */
|
|
29
|
+
title?: string;
|
|
30
|
+
/** @title Список вкладок */
|
|
31
|
+
insuranceTabs?: InsuranceAmountBlockTabs[];
|
|
32
|
+
button?: ButtonProps;
|
|
33
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { UniBlockProps, FuncReturnVoid } from '../../types';
|
|
3
|
+
import type { InsuranceAmountBlockTabs, cardItem } from './InsuranceAmountBlockContent';
|
|
4
|
+
import { ArrowButton } from '../../ui-kit/Button/ArrowButton';
|
|
5
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
6
|
+
import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
|
|
7
|
+
|
|
8
|
+
export interface InsuranceAmountBlockInnerProps extends InsuranceAmountBlockTabs, UniBlockProps {}
|
|
9
|
+
|
|
10
|
+
type InsuranceGalleryProps = {
|
|
11
|
+
tabsShift: number;
|
|
12
|
+
cards: cardItem[];
|
|
13
|
+
activeSlideIndex: number;
|
|
14
|
+
isLastShift: boolean;
|
|
15
|
+
setActiveSlideIndex: FuncReturnVoid<number>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type InsuranceSlideProps = {
|
|
19
|
+
slide: cardItem;
|
|
20
|
+
i: number;
|
|
21
|
+
activeSlideIndex: number;
|
|
22
|
+
onClick: FuncReturnVoid<MouseEvent>;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const arrowBtnStyle =
|
|
26
|
+
'absolute w-12 h-12 min-h-12 max-h-12 top-1 z-10 mt-[25px] bg-white rounded-full text-primary-text';
|
|
27
|
+
|
|
28
|
+
export const InsuranceAmountBlockInner = JSX<InsuranceAmountBlockInnerProps>(
|
|
29
|
+
({ className = '', context, cards = [], anchor = null }) => {
|
|
30
|
+
const [activeSlideIndex, setActiveSlideIndex] = context.useState(0);
|
|
31
|
+
const [tabsShift, setTabsShift] = context.useState(0);
|
|
32
|
+
|
|
33
|
+
const handleNextClick = () => setTabsShift(tabsShift + 1);
|
|
34
|
+
const handlePrevClick = () => setTabsShift(tabsShift - 1);
|
|
35
|
+
|
|
36
|
+
const galleryLength = cards?.length;
|
|
37
|
+
|
|
38
|
+
const isGalleryScrollAvailable = cards?.length > 2;
|
|
39
|
+
const showNextButton = isGalleryScrollAvailable && galleryLength > tabsShift + 2;
|
|
40
|
+
const isLastShift = galleryLength === tabsShift + 2;
|
|
41
|
+
const showPrevButton = tabsShift > 0;
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<section id={anchor} className={`min-w-full ${className}`}>
|
|
45
|
+
<div className="relative mt-7 overflow-hidden">
|
|
46
|
+
{galleryLength > 1
|
|
47
|
+
? renderGallery({
|
|
48
|
+
tabsShift,
|
|
49
|
+
cards,
|
|
50
|
+
activeSlideIndex,
|
|
51
|
+
isLastShift,
|
|
52
|
+
setActiveSlideIndex,
|
|
53
|
+
})
|
|
54
|
+
: null}
|
|
55
|
+
{showPrevButton ? (
|
|
56
|
+
<div>
|
|
57
|
+
<ArrowButton
|
|
58
|
+
className={`${arrowBtnStyle} left-0 top-9`}
|
|
59
|
+
onClick={handlePrevClick}
|
|
60
|
+
ariaLabel="Пролистать влево"
|
|
61
|
+
data-block-control="scroll-left"
|
|
62
|
+
/>
|
|
63
|
+
<div className="absolute top-0 left-0 h-[168px] w-[84px] bg-opacity-from-white" />
|
|
64
|
+
</div>
|
|
65
|
+
) : null}
|
|
66
|
+
{showNextButton ? (
|
|
67
|
+
<div>
|
|
68
|
+
<ArrowButton
|
|
69
|
+
className={`${arrowBtnStyle} right-0 top-9 rotate-180`}
|
|
70
|
+
onClick={handleNextClick}
|
|
71
|
+
ariaLabel="Пролистать вправо"
|
|
72
|
+
data-block-control="scroll-right"
|
|
73
|
+
/>
|
|
74
|
+
<div className="absolute top-0 right-0 h-[168px] w-[100px] bg-opacity-to-white" />
|
|
75
|
+
</div>
|
|
76
|
+
) : null}
|
|
77
|
+
</div>
|
|
78
|
+
</section>
|
|
79
|
+
);
|
|
80
|
+
},
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
function renderGallery({
|
|
84
|
+
tabsShift,
|
|
85
|
+
cards,
|
|
86
|
+
activeSlideIndex,
|
|
87
|
+
isLastShift,
|
|
88
|
+
setActiveSlideIndex,
|
|
89
|
+
}: InsuranceGalleryProps) {
|
|
90
|
+
const tabsShiftWidth = isLastShift ? tabsShift * 460 - 240 : tabsShift * 460;
|
|
91
|
+
return (
|
|
92
|
+
<div style={{ transform: `translateX(-${tabsShiftWidth}px)` }} className="duration-1000">
|
|
93
|
+
<div className="w-full flex flex-nowrap gap-3.5 pb-[38px] px-[50px]">
|
|
94
|
+
{cards.map((slide, i) =>
|
|
95
|
+
renderSlide({
|
|
96
|
+
slide,
|
|
97
|
+
i,
|
|
98
|
+
activeSlideIndex,
|
|
99
|
+
onClick: () => setActiveSlideIndex(i),
|
|
100
|
+
}),
|
|
101
|
+
)}
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function renderSlide({ slide, i, activeSlideIndex, onClick }: InsuranceSlideProps) {
|
|
108
|
+
const isActiveBtn = i === activeSlideIndex;
|
|
109
|
+
|
|
110
|
+
const btnClassName = isActiveBtn
|
|
111
|
+
? 'shadow-dark-blue/42 border-primary-main'
|
|
112
|
+
: `ease-in duration-300 border-main-stroke`;
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<button
|
|
116
|
+
type="button"
|
|
117
|
+
key={String(i)}
|
|
118
|
+
onClick={onClick}
|
|
119
|
+
className={`p-[30px] min-w-[460px] flex items-center bg-white border-solid border relative ${btnClassName}`}
|
|
120
|
+
>
|
|
121
|
+
{slide?.icon ? (
|
|
122
|
+
<Img
|
|
123
|
+
className={`h-[108px] w-[108px] p-3 rounded-full bg-secondary-light mr-[30px]`}
|
|
124
|
+
image={slide.icon}
|
|
125
|
+
width="24"
|
|
126
|
+
height="24"
|
|
127
|
+
/>
|
|
128
|
+
) : null}
|
|
129
|
+
|
|
130
|
+
<div className="flex gap-3.5">
|
|
131
|
+
{slide?.sum ? renderValueBlock('страховая сумма', slide.sum) : null}
|
|
132
|
+
{slide?.fee ? renderValueBlock('страховой взнос', slide.fee) : null}
|
|
133
|
+
</div>
|
|
134
|
+
{renderDoneIcon(isActiveBtn)}
|
|
135
|
+
</button>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function renderValueBlock(title, sum) {
|
|
140
|
+
return (
|
|
141
|
+
<div className="flex flex-col text-left">
|
|
142
|
+
<span className="whitespace-pre text-title-2xs">{addSpacesBetweenNumbers(sum)} ₽</span>
|
|
143
|
+
<span className="whitespace-pre text-secondary-text font-light text-base mt-1">{title}</span>
|
|
144
|
+
</div>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function renderDoneIcon(isActive) {
|
|
149
|
+
return isActive ? (
|
|
150
|
+
<Img
|
|
151
|
+
className={`h-[24px] w-[24px] min-w-[24px] min-h-[24px] absolute right-4 top-4`}
|
|
152
|
+
image="DoneIcon"
|
|
153
|
+
width="24"
|
|
154
|
+
height="24"
|
|
155
|
+
/>
|
|
156
|
+
) : null;
|
|
157
|
+
}
|
|
@@ -43,19 +43,19 @@ export default {
|
|
|
43
43
|
label: 'В мобильном приложении или интернет-банке',
|
|
44
44
|
description: 'Для всех клиентов Россельхозбанка',
|
|
45
45
|
icon: { icon: 'SignDocsIcon' },
|
|
46
|
-
button: { text: 'Войти в интернет-банк' },
|
|
46
|
+
button: { text: 'Войти в интернет-банк', href: 'https://www.rshb.ru/' },
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
label: 'Через Госуслуги',
|
|
50
50
|
description: 'При наличии данных в Единой биометрической системе',
|
|
51
51
|
icon: { icon: 'ClockIcon' },
|
|
52
|
-
button: { text: 'Оформить' },
|
|
52
|
+
button: { text: 'Оформить', href: 'https://www.rshb.ru/' },
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
label: 'В офисах Россельхозбанка',
|
|
56
56
|
description: 'Откройте вклад',
|
|
57
57
|
icon: { icon: 'ComfortableCompIcon' },
|
|
58
|
-
button: { text: 'Офисы на карте' },
|
|
58
|
+
button: { text: 'Офисы на карте', href: 'https://www.rshb.ru/' },
|
|
59
59
|
},
|
|
60
60
|
]}
|
|
61
61
|
/>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg title="Зелёная 'галочка'" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="24" height="24" rx="12" fill="#42AB44"/>
|
|
3
|
+
<path d="M7 13.0047L9.7242 16L17 8" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
</svg>
|
package/src/icons/IconName.ts
CHANGED
|
@@ -32,6 +32,7 @@ export enum IconMap {
|
|
|
32
32
|
DocsIcon = 'DocsIcon',
|
|
33
33
|
DocumentTextIcon = 'DocumentTextIcon',
|
|
34
34
|
DollarIcon = 'DollarIcon',
|
|
35
|
+
DoneIcon = 'DoneIcon',
|
|
35
36
|
EarthIcon = 'EarthIcon',
|
|
36
37
|
EmptyWalletChangeIcon = 'EmptyWalletChangeIcon',
|
|
37
38
|
EmptyWalletIcon = 'EmptyWalletIcon',
|
|
@@ -113,6 +114,7 @@ export enum IconTitleMap {
|
|
|
113
114
|
DocsIcon = 'Документы',
|
|
114
115
|
DocumentTextIcon = 'Документ с текстом',
|
|
115
116
|
DollarIcon = 'Доллар',
|
|
117
|
+
DoneIcon = "Зелёная 'галочка'",
|
|
116
118
|
EarthIcon = 'Земля',
|
|
117
119
|
EmptyWalletChangeIcon = 'Пустой кошелёк с возвратом',
|
|
118
120
|
EmptyWalletIcon = 'Пустой кошелёк',
|
|
@@ -168,7 +170,7 @@ export enum IconTitleMap {
|
|
|
168
170
|
* @title Иконка
|
|
169
171
|
* @enumNames [
|
|
170
172
|
* "",
|
|
171
|
-
* 'Деньги', 'Самолет', 'Лого «Apple»', 'Стрелка \'Вниз\'', 'Стрелка', 'Стрелка вверх', 'Банкомат', 'Банк', 'Бургер', 'Календарь 2', 'Скруглённый календарь', 'Календарь', 'Календарь с галочкой', 'Кред. карта', 'Кред. карта под наклоном', 'Кред. карта с галочкой', 'Карта с драгоценностями', 'Машина', 'Деньги внутри кошелька', 'Кино', 'Часы', 'Крестик', 'Кресло', 'Кредитные карты', 'Скидка', 'Документ', 'Документ (одноцветный)', 'Документы', 'Документ с текстом', 'Доллар', 'Земля', 'Пустой кошелёк с возвратом', 'Пустой кошелёк', 'Евро', 'Геолокация', 'Зеркало', 'Глобус', 'Gps', 'Сетка (белая)', 'Диаграмма роста', 'Скидка', 'JCB', 'Лупа', 'MasterCard', 'Минус', 'МИР', 'Деньги', 'Денежное страхование', 'Монитор и мобильный', 'Новый документ', 'Офис', 'Лого «Одноклассники»', 'Бизнес', 'Проценты (круг.)', 'Проценты', 'Персональная карта', 'Лого «PlayMarket»', 'Плюс', 'Щит', 'Профиль, 2 персоны', 'Профиль', 'Тыква', 'Рубль (круг.)', 'Сейф', 'Безопасность', 'Подписанные документы', 'Маленькие часы', 'Звук', 'Лого «Telegram»', 'UnionPay', 'Пользователь', 'Visa', 'Лого «VK»', 'Пополнение карты', 'Кошелёк с плюсом', 'Кошелёк', 'Кошелёк с деньгами', 'Добавить продукт'
|
|
173
|
+
* 'Деньги', 'Самолет', 'Лого «Apple»', 'Стрелка \'Вниз\'', 'Стрелка', 'Стрелка вверх', 'Банкомат', 'Банк', 'Бургер', 'Календарь 2', 'Скруглённый календарь', 'Календарь', 'Календарь с галочкой', 'Кред. карта', 'Кред. карта под наклоном', 'Кред. карта с галочкой', 'Карта с драгоценностями', 'Машина', 'Деньги внутри кошелька', 'Кино', 'Часы', 'Крестик', 'Кресло', 'Кредитные карты', 'Скидка', 'Документ', 'Документ (одноцветный)', 'Документы', 'Документ с текстом', 'Доллар', 'Зелёная \'галочка\'', 'Земля', 'Пустой кошелёк с возвратом', 'Пустой кошелёк', 'Евро', 'Геолокация', 'Зеркало', 'Глобус', 'Gps', 'Сетка (белая)', 'Диаграмма роста', 'Скидка', 'JCB', 'Лупа', 'MasterCard', 'Минус', 'МИР', 'Деньги', 'Денежное страхование', 'Монитор и мобильный', 'Новый документ', 'Офис', 'Лого «Одноклассники»', 'Бизнес', 'Проценты (круг.)', 'Проценты', 'Персональная карта', 'Лого «PlayMarket»', 'Плюс', 'Щит', 'Профиль, 2 персоны', 'Профиль', 'Тыква', 'Рубль (круг.)', 'Сейф', 'Безопасность', 'Подписанные документы', 'Маленькие часы', 'Звук', 'Лого «Telegram»', 'UnionPay', 'Пользователь', 'Visa', 'Лого «VK»', 'Пополнение карты', 'Кошелёк с плюсом', 'Кошелёк', 'Кошелёк с деньгами', 'Добавить продукт'
|
|
172
174
|
* ]
|
|
173
175
|
*/
|
|
174
176
|
export type IconName =
|
|
@@ -203,6 +205,7 @@ export type IconName =
|
|
|
203
205
|
| 'DocsIcon'
|
|
204
206
|
| 'DocumentTextIcon'
|
|
205
207
|
| 'DollarIcon'
|
|
208
|
+
| 'DoneIcon'
|
|
206
209
|
| 'EarthIcon'
|
|
207
210
|
| 'EmptyWalletChangeIcon'
|
|
208
211
|
| 'EmptyWalletIcon'
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "Страховые риски и продукты",
|
|
3
|
-
"description": "Описание",
|
|
4
|
-
"insurance": 500000,
|
|
5
|
-
"limit": null,
|
|
6
|
-
"image": {
|
|
7
|
-
"src": "insurance.png",
|
|
8
|
-
"title": "страхование",
|
|
9
|
-
"format": "webp",
|
|
10
|
-
"alt": "страхование",
|
|
11
|
-
"size": {
|
|
12
|
-
"width": 400,
|
|
13
|
-
"height": 300
|
|
14
|
-
},
|
|
15
|
-
"sources": [
|
|
16
|
-
{
|
|
17
|
-
"src": "insurance.png 1x, insurance-2x.png 2x",
|
|
18
|
-
"format": "png"
|
|
19
|
-
}
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
"benefits": [
|
|
23
|
-
{
|
|
24
|
-
"label": "Пункт 1",
|
|
25
|
-
"icon": {
|
|
26
|
-
"icon": "ShieldTickIcon"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"label": "Пункт 2",
|
|
31
|
-
"icon": {
|
|
32
|
-
"icon": "ShieldTickIcon"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "Страховые риски и продукты",
|
|
3
|
-
"description": "Описание",
|
|
4
|
-
"insurance": 500000,
|
|
5
|
-
"limit": null,
|
|
6
|
-
"image": {
|
|
7
|
-
"src": "insurance.png",
|
|
8
|
-
"title": "страхование",
|
|
9
|
-
"format": "webp",
|
|
10
|
-
"alt": "страхование",
|
|
11
|
-
"size": {
|
|
12
|
-
"width": 400,
|
|
13
|
-
"height": 300
|
|
14
|
-
},
|
|
15
|
-
"sources": [
|
|
16
|
-
{
|
|
17
|
-
"src": "insurance.png 1x, insurance-2x.png 2x",
|
|
18
|
-
"format": "png"
|
|
19
|
-
}
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
"benefits": [
|
|
23
|
-
{
|
|
24
|
-
"label": "Пункт 1",
|
|
25
|
-
"icon": {
|
|
26
|
-
"icon": "ShieldTickIcon"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"label": "Пункт 2",
|
|
31
|
-
"icon": {
|
|
32
|
-
"icon": "ShieldTickIcon"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
}
|