@redneckz/wildless-cms-uni-blocks 0.2.46 → 0.2.49
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/README.md +3 -0
- package/dist/BenefitsBlock.d.ts +2 -2
- package/dist/Blocks.d.ts +15 -0
- package/dist/Blocks.js +13 -7
- package/dist/Blocks.js.map +1 -1
- package/dist/ContentPage.d.ts +2 -2
- package/dist/ContentPage.js +3 -3
- package/dist/ContentPage.js.map +1 -1
- package/dist/ContentPageContext.d.ts +6 -3
- package/dist/ExchangeRateTile.d.ts +7 -0
- package/dist/ExchangeRateTile.js +32 -0
- package/dist/ExchangeRateTile.js.map +1 -0
- package/dist/Footer/Contacts.d.ts +2 -2
- package/dist/Footer/Footer.d.ts +3 -4
- package/dist/Footer/Footer.js.map +1 -1
- package/dist/Footer/FooterLink.d.ts +2 -2
- package/dist/Footer/Sitemap.d.ts +2 -2
- package/dist/Footer/Sitemap.js +8 -5
- package/dist/Footer/Sitemap.js.map +1 -1
- package/dist/Footer/SocialMedia.d.ts +2 -2
- package/dist/Footer/SocialMedia.js +5 -5
- package/dist/Footer/SocialMedia.js.map +1 -1
- package/dist/Footer/index.d.ts +1 -1
- package/dist/Header/Header.d.ts +2 -2
- package/dist/Header/Header.js +3 -2
- package/dist/Header/Header.js.map +1 -1
- package/dist/Icons/DollarIcon.d.ts +1 -0
- package/dist/Icons/DollarIcon.js +6 -0
- package/dist/Icons/DollarIcon.js.map +1 -0
- package/dist/Icons/EuroIcon.d.ts +1 -0
- package/dist/Icons/EuroIcon.js +6 -0
- package/dist/Icons/EuroIcon.js.map +1 -0
- package/dist/Icons/index.d.ts +17 -16
- package/dist/Icons/index.js +26 -22
- package/dist/Icons/index.js.map +1 -1
- package/dist/Img.js +1 -1
- package/dist/Img.js.map +1 -1
- package/dist/LikeControl.d.ts +2 -2
- package/dist/LikeControl.js.map +1 -1
- package/dist/MobileAppTile.d.ts +8 -0
- package/dist/MobileAppTile.js +9 -0
- package/dist/MobileAppTile.js.map +1 -0
- package/dist/Placeholder.d.ts +3 -1
- package/dist/Placeholder.js +9 -2
- package/dist/Placeholder.js.map +1 -1
- package/dist/ProductBlock.d.ts +2 -2
- package/dist/ProductBlockInner.d.ts +2 -2
- package/dist/ProductBlockInner.js +2 -1
- package/dist/ProductBlockInner.js.map +1 -1
- package/dist/ProductGallery.d.ts +2 -2
- package/dist/ProductGallery.js +3 -3
- package/dist/ProductGallery.js.map +1 -1
- package/dist/ProductTile.d.ts +17 -0
- package/dist/ProductTile.js +27 -0
- package/dist/ProductTile.js.map +1 -0
- package/dist/ProjectSettings.d.ts +18 -0
- package/dist/ProjectSettings.js +30 -0
- package/dist/ProjectSettings.js.map +1 -0
- package/dist/StepsBlock.d.ts +2 -2
- package/dist/StepsBlock.js +7 -3
- package/dist/StepsBlock.js.map +1 -1
- package/dist/Tile.d.ts +2 -2
- package/dist/Tile.js +15 -7
- package/dist/Tile.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +3 -10
- package/dist/ui-kit/SearchBar.d.ts +2 -2
- package/dist/ui-kit/SearchBar.js.map +1 -1
- package/dist/useSitemap.d.ts +3 -0
- package/dist/useSitemap.js +16 -0
- package/dist/useSitemap.js.map +1 -0
- package/dist/utils/joinList.d.ts +1 -0
- package/dist/utils/joinList.js +7 -0
- package/dist/utils/joinList.js.map +1 -0
- package/lib/BenefitsBlock.d.ts +2 -2
- package/lib/Blocks.d.ts +15 -0
- package/lib/Blocks.js +10 -4
- package/lib/Blocks.js.map +1 -1
- package/lib/ContentPage.d.ts +2 -2
- package/lib/ContentPage.js +3 -3
- package/lib/ContentPage.js.map +1 -1
- package/lib/ContentPageContext.d.ts +6 -3
- package/lib/ExchangeRateTile.d.ts +7 -0
- package/lib/ExchangeRateTile.js +30 -0
- package/lib/ExchangeRateTile.js.map +1 -0
- package/lib/Footer/Contacts.d.ts +2 -2
- package/lib/Footer/Footer.d.ts +3 -4
- package/lib/Footer/Footer.js.map +1 -1
- package/lib/Footer/FooterLink.d.ts +2 -2
- package/lib/Footer/Sitemap.d.ts +2 -2
- package/lib/Footer/Sitemap.js +8 -5
- package/lib/Footer/Sitemap.js.map +1 -1
- package/lib/Footer/SocialMedia.d.ts +2 -2
- package/lib/Footer/SocialMedia.js +5 -5
- package/lib/Footer/SocialMedia.js.map +1 -1
- package/lib/Footer/index.d.ts +1 -1
- package/lib/Header/Header.d.ts +2 -2
- package/lib/Header/Header.js +3 -2
- package/lib/Header/Header.js.map +1 -1
- package/lib/Icons/DollarIcon.d.ts +1 -0
- package/lib/Icons/DollarIcon.js +3 -0
- package/lib/Icons/DollarIcon.js.map +1 -0
- package/lib/Icons/EuroIcon.d.ts +1 -0
- package/lib/Icons/EuroIcon.js +3 -0
- package/lib/Icons/EuroIcon.js.map +1 -0
- package/lib/Icons/index.d.ts +17 -16
- package/lib/Icons/index.js +17 -16
- package/lib/Icons/index.js.map +1 -1
- package/lib/Img.js +1 -1
- package/lib/Img.js.map +1 -1
- package/lib/LikeControl.d.ts +2 -2
- package/lib/LikeControl.js.map +1 -1
- package/lib/MobileAppTile.d.ts +8 -0
- package/lib/MobileAppTile.js +7 -0
- package/lib/MobileAppTile.js.map +1 -0
- package/lib/Placeholder.d.ts +3 -1
- package/lib/Placeholder.js +9 -2
- package/lib/Placeholder.js.map +1 -1
- package/lib/ProductBlock.d.ts +2 -2
- package/lib/ProductBlockInner.d.ts +2 -2
- package/lib/ProductBlockInner.js +2 -1
- package/lib/ProductBlockInner.js.map +1 -1
- package/lib/ProductGallery.d.ts +2 -2
- package/lib/ProductGallery.js +3 -3
- package/lib/ProductGallery.js.map +1 -1
- package/lib/ProductTile.d.ts +17 -0
- package/lib/ProductTile.js +25 -0
- package/lib/ProductTile.js.map +1 -0
- package/lib/ProjectSettings.d.ts +18 -0
- package/lib/ProjectSettings.js +28 -0
- package/lib/ProjectSettings.js.map +1 -0
- package/lib/StepsBlock.d.ts +2 -2
- package/lib/StepsBlock.js +7 -3
- package/lib/StepsBlock.js.map +1 -1
- package/lib/Tile.d.ts +2 -2
- package/lib/Tile.js +15 -7
- package/lib/Tile.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/index.d.ts +6 -3
- package/lib/index.js +4 -2
- package/lib/index.js.map +1 -1
- package/lib/types.d.ts +3 -10
- package/lib/ui-kit/SearchBar.d.ts +2 -2
- package/lib/ui-kit/SearchBar.js.map +1 -1
- package/lib/useSitemap.d.ts +3 -0
- package/lib/useSitemap.js +13 -0
- package/lib/useSitemap.js.map +1 -0
- package/lib/utils/joinList.d.ts +1 -0
- package/lib/utils/joinList.js +4 -0
- package/lib/utils/joinList.js.map +1 -0
- package/package.json +3 -2
- package/src/BenefitsBlock.fixture.tsx +34 -0
- package/src/BenefitsBlock.tsx +45 -0
- package/src/Blocks.ts +39 -0
- package/src/ContentPage.fixture.tsx +38 -0
- package/src/ContentPage.page.json +680 -0
- package/src/ContentPage.tsx +83 -0
- package/src/ContentPageContext.tsx +34 -0
- package/src/ContentPageHead.tsx +26 -0
- package/src/ExchangeRateTile.fixture.tsx +11 -0
- package/src/ExchangeRateTile.tsx +80 -0
- package/src/Footer/Contacts.tsx +71 -0
- package/src/Footer/Footer.fixture.tsx +265 -0
- package/src/Footer/Footer.tsx +47 -0
- package/src/Footer/FooterLink.ts +6 -0
- package/src/Footer/HorizontalNavigation.tsx +46 -0
- package/src/Footer/Sitemap.tsx +57 -0
- package/src/Footer/SocialMedia.tsx +46 -0
- package/src/Footer/TextInformation.tsx +50 -0
- package/src/Footer/index.ts +2 -0
- package/src/Header/Header.fixture.tsx +21 -0
- package/src/Header/Header.tsx +55 -0
- package/src/Header/HeaderContent.ts +6 -0
- package/src/Header/HeaderSecondaryMenu.tsx +42 -0
- package/src/Header/HeaderSecondaryMenuButton.tsx +21 -0
- package/src/Header/index.ts +3 -0
- package/src/Header/isSubItemActive.ts +9 -0
- package/src/Header/isTopItemActive.ts +13 -0
- package/src/Icons/ActualBalanceIcon.tsx +202 -0
- package/src/Icons/CalendarIcon.tsx +19 -0
- package/src/Icons/ClockIcon.tsx +212 -0
- package/src/Icons/ComfortableCompIcon.tsx +379 -0
- package/src/Icons/DollarIcon.tsx +12 -0
- package/src/Icons/EmptyWalletIcon.tsx +25 -0
- package/src/Icons/EuroIcon.tsx +12 -0
- package/src/Icons/GridIcon.tsx +9 -0
- package/src/Icons/LoupeIcon.tsx +11 -0
- package/src/Icons/NewDocIcon.tsx +262 -0
- package/src/Icons/OkIcon.tsx +8 -0
- package/src/Icons/PassSendIcon.tsx +250 -0
- package/src/Icons/PercentageSquareIcon.tsx +18 -0
- package/src/Icons/ProfileIcon.tsx +18 -0
- package/src/Icons/SignDocsIcon.tsx +295 -0
- package/src/Icons/TelegramIcon.tsx +8 -0
- package/src/Icons/VKIcon.tsx +10 -0
- package/src/Icons/index.ts +17 -0
- package/src/Img.tsx +22 -0
- package/src/LikeControl.fixture.tsx +5 -0
- package/src/LikeControl.tsx +23 -0
- package/src/MobileAppTile.fixture.tsx +15 -0
- package/src/MobileAppTile.tsx +34 -0
- package/src/Placeholder.fixture.tsx +5 -0
- package/src/Placeholder.tsx +33 -0
- package/src/ProductBlock.fixture.tsx +95 -0
- package/src/ProductBlock.tsx +15 -0
- package/src/ProductBlockInner.tsx +111 -0
- package/src/ProductGallery.fixture.tsx +138 -0
- package/src/ProductGallery.tsx +88 -0
- package/src/ProductTile.fixture.tsx +147 -0
- package/src/ProductTile.tsx +95 -0
- package/src/ProjectSettings.ts +38 -0
- package/src/StepsBlock.fixture.tsx +23 -0
- package/src/StepsBlock.tsx +65 -0
- package/src/Tile.fixture.tsx +124 -0
- package/src/Tile.tsx +89 -0
- package/src/api/LikeAPI.ts +141 -0
- package/src/common.css +39 -0
- package/src/content-page-repository/ContentPageRepository.ts +38 -0
- package/src/content-page-repository/TransformationOptions.ts +4 -0
- package/src/content-page-repository/index.ts +1 -0
- package/src/content-page-repository/mapJSON.spec.ts +28 -0
- package/src/content-page-repository/mapJSON.ts +23 -0
- package/src/content-page-repository/transformContentPage.ts +26 -0
- package/src/content-page-repository/transformMarkdown.ts +10 -0
- package/src/content-page-repository/transformPicture.ts +61 -0
- package/src/cosmos.decorator.tsx +19 -0
- package/src/index.ts +20 -0
- package/src/mergeTopItems.spec.ts +20 -0
- package/src/mergeTopItems.ts +13 -0
- package/src/setup-fixture.ts +49 -0
- package/src/types.ts +94 -0
- package/src/ui-kit/BlockItem.fixture.tsx +5 -0
- package/src/ui-kit/BlockItem.tsx +36 -0
- package/src/ui-kit/Breadcrumb.tsx +26 -0
- package/src/ui-kit/Button.fixture.tsx +113 -0
- package/src/ui-kit/Button.tsx +66 -0
- package/src/ui-kit/HeaderItem.fixture.tsx +8 -0
- package/src/ui-kit/HeaderItem.tsx +25 -0
- package/src/ui-kit/LikeButton.fixture.tsx +6 -0
- package/src/ui-kit/LikeButton.tsx +41 -0
- package/src/ui-kit/Logo.fixture.tsx +5 -0
- package/src/ui-kit/Logo.tsx +35 -0
- package/src/ui-kit/SVG.tsx +32 -0
- package/src/ui-kit/SearchBar.tsx +33 -0
- package/src/ui-kit/TopItem.fixture.tsx +8 -0
- package/src/ui-kit/TopItem.tsx +37 -0
- package/src/useLink.ts +28 -0
- package/src/useSitemap.ts +17 -0
- package/src/utils/joinList.ts +7 -0
- package/src/utils/url.ts +22 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { Router, HandlerDecorator } from '../ContentPageContext';
|
|
3
|
+
import { mergeTopItems } from '../mergeTopItems';
|
|
4
|
+
import type { LinkContent, TopMenuItem, UniBlockProps } from '../types';
|
|
5
|
+
import { useLink } from '../useLink';
|
|
6
|
+
import { useSitemap } from '../useSitemap';
|
|
7
|
+
export interface SitemapProps extends UniBlockProps {
|
|
8
|
+
items?: TopMenuItem[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const Sitemap = JSX<SitemapProps>(({ className, items, context }) => {
|
|
12
|
+
const sitemap = useSitemap(context.useAsyncData);
|
|
13
|
+
const mergedItems = mergeTopItems(sitemap.topItems, items);
|
|
14
|
+
const linkParams = {
|
|
15
|
+
router: context.useRouter(),
|
|
16
|
+
handlerDecorator: context.handlerDecorator,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div className={`flex items-start justify-start gap-11 xl:gap-5 ${className || ''}`}>
|
|
21
|
+
{mergedItems?.map((_, i) => renderColumn(_, i, linkParams))}
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const renderColumn = (c: TopMenuItem, index: number, { router, handlerDecorator }) => {
|
|
27
|
+
const { text, href, items, target } = c;
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div key={String(index)} className="flex flex-col w-[235px] gap-[14px]">
|
|
31
|
+
<a
|
|
32
|
+
className="block font-sans font-medium text-base text-primary-text no-underline"
|
|
33
|
+
href={href}
|
|
34
|
+
target={target || '_self'}
|
|
35
|
+
>
|
|
36
|
+
{text || `Раздел ${index}`}
|
|
37
|
+
</a>
|
|
38
|
+
{items?.map((_, i) => (
|
|
39
|
+
<ColumnItem key={String(i)} {...useLink({ router, handlerDecorator }, _)} />
|
|
40
|
+
))}
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
interface ColumnItemProps extends LinkContent {
|
|
46
|
+
index?: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const ColumnItem = JSX<ColumnItemProps>(({ text, href, target, index }) => (
|
|
50
|
+
<a
|
|
51
|
+
className="block font-sans font-normal text-base text-secondary-text hover:text-primary-text no-underline"
|
|
52
|
+
href={href}
|
|
53
|
+
target={target || '_self'}
|
|
54
|
+
>
|
|
55
|
+
{text || `Раздел ${index}`}
|
|
56
|
+
</a>
|
|
57
|
+
));
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { LinkContent, UniBlockProps } from '../types';
|
|
3
|
+
import { TelegramIcon, VKIcon, OkIcon } from '../Icons/index';
|
|
4
|
+
import { useLink } from '../useLink';
|
|
5
|
+
|
|
6
|
+
const ICONS_MAP = [
|
|
7
|
+
{ origins: ['t.me', 'telegram.org'], icon: TelegramIcon, label: 'Телеграм' },
|
|
8
|
+
{ origins: ['vk.com'], icon: VKIcon, label: 'ВКонтакте' },
|
|
9
|
+
{ origins: ['ok.ru'], icon: OkIcon, label: 'Одноклассники' },
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
export interface SocialMediaProps extends UniBlockProps {
|
|
13
|
+
media?: Omit<LinkContent, 'text'>[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const SocialMedia = JSX<SocialMediaProps>(({ className, media, context }) => {
|
|
17
|
+
const router = context.useRouter();
|
|
18
|
+
const { handlerDecorator } = context;
|
|
19
|
+
return (
|
|
20
|
+
<div className={`flex items-end justify-end gap-2 py-6 ${className || ''}`}>
|
|
21
|
+
{media?.map((_, index) => (
|
|
22
|
+
<MediaButton key={String(index)} {...useLink({ router, handlerDecorator }, _)} />
|
|
23
|
+
))}
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
interface MediaButtonProps {
|
|
29
|
+
href?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const MediaButton = JSX<MediaButtonProps>(({ href }) => {
|
|
33
|
+
const { icon: Icon, label } =
|
|
34
|
+
ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
|
|
35
|
+
return (
|
|
36
|
+
<a
|
|
37
|
+
className="flex items-center justify-center border-solid border-1 border-main-divider rounded-full no-underline outline-none w-8 h-8"
|
|
38
|
+
href={href}
|
|
39
|
+
target="_blank"
|
|
40
|
+
rel="noopener noreferrer"
|
|
41
|
+
aria-label={label}
|
|
42
|
+
>
|
|
43
|
+
{Icon && <Icon className="block" />}
|
|
44
|
+
</a>
|
|
45
|
+
);
|
|
46
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { LinkContent } from '../types';
|
|
3
|
+
import { useLink } from '../useLink';
|
|
4
|
+
import { FooterLink } from './FooterLink';
|
|
5
|
+
|
|
6
|
+
export const TextInformation = JSX<FooterLink>(({ className, links, context }) => {
|
|
7
|
+
const router = context.useRouter();
|
|
8
|
+
const { handlerDecorator } = context;
|
|
9
|
+
return (
|
|
10
|
+
<div className={`${className || ''}`}>
|
|
11
|
+
<div className="py-[5px]">
|
|
12
|
+
<span className="font-sans font-normal text-xs text-secondary-text">
|
|
13
|
+
{`\u00a9\u00A02000-${new Date().getFullYear()}\u00A0АО \u00AB;Россельхозбанк\u00BB Генеральная лицензия Банка России \u2116\u00A03349 от\u00A012.08.2015\u00A0г.`}
|
|
14
|
+
</span>
|
|
15
|
+
</div>
|
|
16
|
+
{links?.length ? (
|
|
17
|
+
<div className="flex justify-start items-start gap-5 pt-[5px]">
|
|
18
|
+
{links.map((_, i) => (
|
|
19
|
+
<TextInformationLink
|
|
20
|
+
key={String(i)}
|
|
21
|
+
index={i}
|
|
22
|
+
{...useLink({ router, handlerDecorator }, _)}
|
|
23
|
+
/>
|
|
24
|
+
))}
|
|
25
|
+
</div>
|
|
26
|
+
) : null}
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
interface TextInformationLinkProps extends LinkContent {
|
|
32
|
+
className: string;
|
|
33
|
+
index: number;
|
|
34
|
+
onClick: (ev: MouseEvent) => any;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const TextInformationLink = JSX<Partial<TextInformationLinkProps>>(
|
|
38
|
+
({ className, index, text, href, target, onClick }) => (
|
|
39
|
+
<a
|
|
40
|
+
className={`font-sans font-normal text-xs text-secondary-text visited:text-secondary-text hover:text-primary-text inline-block no-underline max-w-[292px] ${
|
|
41
|
+
className || ''
|
|
42
|
+
}`}
|
|
43
|
+
href={href}
|
|
44
|
+
target={target}
|
|
45
|
+
onClick={onClick}
|
|
46
|
+
>
|
|
47
|
+
{text || `Документ ${index}`}
|
|
48
|
+
</a>
|
|
49
|
+
),
|
|
50
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { context } from '../setup-fixture';
|
|
2
|
+
import { Header } from './Header';
|
|
3
|
+
|
|
4
|
+
export default (
|
|
5
|
+
<Header
|
|
6
|
+
context={context}
|
|
7
|
+
location="Москва"
|
|
8
|
+
topItems={[
|
|
9
|
+
{
|
|
10
|
+
href: 'https://rshb.ru/',
|
|
11
|
+
text: 'Бизнес клиентам',
|
|
12
|
+
target: '_blank',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
href: 'https://rshb.ru/',
|
|
16
|
+
text: 'Частным клиентам',
|
|
17
|
+
target: '_blank',
|
|
18
|
+
},
|
|
19
|
+
]}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { mergeTopItems } from '../mergeTopItems';
|
|
3
|
+
import type { UniBlockProps } from '../types';
|
|
4
|
+
import { HeaderItem } from '../ui-kit/HeaderItem';
|
|
5
|
+
import { Logo } from '../ui-kit/Logo';
|
|
6
|
+
import { TopItem } from '../ui-kit/TopItem';
|
|
7
|
+
import { useLink } from '../useLink';
|
|
8
|
+
import { useSitemap } from '../useSitemap';
|
|
9
|
+
import type { HeaderContent } from './HeaderContent';
|
|
10
|
+
import { HeaderSecondaryMenu } from './HeaderSecondaryMenu';
|
|
11
|
+
import { isSubItemActive } from './isSubItemActive';
|
|
12
|
+
import { isTopItemActive } from './isTopItemActive';
|
|
13
|
+
|
|
14
|
+
export interface HeaderProps extends HeaderContent, UniBlockProps {}
|
|
15
|
+
|
|
16
|
+
export const Header = JSX<HeaderProps>(({ className, location, context, topItems }) => {
|
|
17
|
+
const router = context.useRouter();
|
|
18
|
+
const sitemap = useSitemap(context.useAsyncData);
|
|
19
|
+
const { handlerDecorator } = context;
|
|
20
|
+
|
|
21
|
+
const mergedItems = mergeTopItems(sitemap.topItems, topItems);
|
|
22
|
+
const activeTopItem = mergedItems.find(isTopItemActive(router));
|
|
23
|
+
const subItems = activeTopItem?.items;
|
|
24
|
+
const activeSubItem = subItems?.find(isSubItemActive(router));
|
|
25
|
+
|
|
26
|
+
const topMenu = mergedItems.map((_, i) => (
|
|
27
|
+
<TopItem
|
|
28
|
+
key={String(i)}
|
|
29
|
+
active={_ === activeTopItem}
|
|
30
|
+
{...useLink({ router, handlerDecorator }, _)}
|
|
31
|
+
ariaLabel={_.text}
|
|
32
|
+
/>
|
|
33
|
+
));
|
|
34
|
+
|
|
35
|
+
const subMenu = subItems?.map((_) => (
|
|
36
|
+
<HeaderItem
|
|
37
|
+
key={_.href}
|
|
38
|
+
className="mr-8"
|
|
39
|
+
active={_ === activeSubItem}
|
|
40
|
+
{...useLink({ router, handlerDecorator }, _)}
|
|
41
|
+
/>
|
|
42
|
+
));
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<header className={`pt-5 pb-8 px-20 bg-white rounded-bl-3xl rounded-br-3xl ${className || ''}`}>
|
|
46
|
+
<div className="flex items-center">
|
|
47
|
+
<Logo className="mr-8" />
|
|
48
|
+
{topMenu}
|
|
49
|
+
<HeaderSecondaryMenu location={location} className="ml-auto" />
|
|
50
|
+
</div>
|
|
51
|
+
<div className="mt-5 h-[1px] bg-main-divider" />
|
|
52
|
+
<nav className="mt-5">{subMenu}</nav>
|
|
53
|
+
</header>
|
|
54
|
+
);
|
|
55
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { GridIcon, LoupeIcon, ProfileIcon } from '../Icons/index';
|
|
3
|
+
import { TopItem } from '../ui-kit/TopItem';
|
|
4
|
+
import { HeaderSecondaryMenuButton } from './HeaderSecondaryMenuButton';
|
|
5
|
+
|
|
6
|
+
interface HeaderSecondaryMenuProps {
|
|
7
|
+
location?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(({ location, className }) => {
|
|
12
|
+
return (
|
|
13
|
+
<div className={`flex items-center ${className || ''}`}>
|
|
14
|
+
<TopItem className="mr-5" flat={true} href="#" text={location} ariaLabel="Местоположение" />
|
|
15
|
+
<TopItem
|
|
16
|
+
className="mr-7"
|
|
17
|
+
flat={true}
|
|
18
|
+
href="#"
|
|
19
|
+
text="Офисы и банкоматы"
|
|
20
|
+
ariaLabel="Список всех доступных офисов и банкоматов"
|
|
21
|
+
/>
|
|
22
|
+
<HeaderSecondaryMenuButton
|
|
23
|
+
className="mr-5 text-primary-text hover:text-primary-main"
|
|
24
|
+
ariaLabel="Поиск по сайту"
|
|
25
|
+
>
|
|
26
|
+
{LoupeIcon({ 'aria-hidden': true })}
|
|
27
|
+
</HeaderSecondaryMenuButton>
|
|
28
|
+
<HeaderSecondaryMenuButton
|
|
29
|
+
className="mr-5 text-primary-text hover:text-primary-main"
|
|
30
|
+
ariaLabel="Профиль"
|
|
31
|
+
>
|
|
32
|
+
{ProfileIcon({ 'aria-hidden': true })}
|
|
33
|
+
</HeaderSecondaryMenuButton>
|
|
34
|
+
<HeaderSecondaryMenuButton
|
|
35
|
+
className="mr-5 text-main hover:text-secondary-hover min-w-[32px] min-h-[32px]"
|
|
36
|
+
ariaLabel="Дополнительные ссылки"
|
|
37
|
+
>
|
|
38
|
+
{GridIcon({ 'aria-hidden': true })}
|
|
39
|
+
</HeaderSecondaryMenuButton>
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
|
|
3
|
+
interface HeaderSecondaryMenuButtonProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const HeaderSecondaryMenuButton = JSX<HeaderSecondaryMenuButtonProps>(
|
|
9
|
+
({ className, children, ariaLabel }) => (
|
|
10
|
+
<button
|
|
11
|
+
type="button"
|
|
12
|
+
className={`border-0 p-0 w-[24px] flex items-center bg-inherit cursor-pointer ${
|
|
13
|
+
className || ''
|
|
14
|
+
}`}
|
|
15
|
+
disabled={true}
|
|
16
|
+
aria-label={ariaLabel}
|
|
17
|
+
>
|
|
18
|
+
{children}
|
|
19
|
+
</button>
|
|
20
|
+
),
|
|
21
|
+
);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Router } from '../ContentPageContext';
|
|
2
|
+
import type { LinkContent } from '../types';
|
|
3
|
+
import { isURL, withoutQuery } from '../utils/url';
|
|
4
|
+
|
|
5
|
+
export function isSubItemActive({ href, pathname }: Router) {
|
|
6
|
+
return (item: LinkContent): boolean => {
|
|
7
|
+
return withoutQuery(item.href) === (isURL(item.href) ? withoutQuery(href) : pathname);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Router } from '../ContentPageContext';
|
|
2
|
+
import type { LinkContent } from '../types';
|
|
3
|
+
import { isURL, withoutQuery } from '../utils/url';
|
|
4
|
+
|
|
5
|
+
export function isTopItemActive({ href, pathname }: Router) {
|
|
6
|
+
return (item: LinkContent): boolean => {
|
|
7
|
+
const itemHref = withoutQuery(item.href);
|
|
8
|
+
if (isURL(itemHref)) {
|
|
9
|
+
return Boolean(href && href.startsWith(itemHref));
|
|
10
|
+
}
|
|
11
|
+
return Boolean(itemHref && pathname.startsWith(itemHref));
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
export const ActualBalanceIcon = (props?: Record<string, any>) => (
|
|
2
|
+
<svg
|
|
3
|
+
width={70}
|
|
4
|
+
height={70}
|
|
5
|
+
viewBox="0 0 70 70"
|
|
6
|
+
fill="none"
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
{...props}
|
|
9
|
+
>
|
|
10
|
+
<mask
|
|
11
|
+
id="mask0_2530_3510"
|
|
12
|
+
style={{
|
|
13
|
+
maskType: 'alpha',
|
|
14
|
+
}}
|
|
15
|
+
maskUnits="userSpaceOnUse"
|
|
16
|
+
x={2}
|
|
17
|
+
y={4}
|
|
18
|
+
width={55}
|
|
19
|
+
height={61}
|
|
20
|
+
>
|
|
21
|
+
<path d="M35.058 4.24L2.116 48.392l21.841 16.296L56.9 20.536 35.058 4.24z" fill="#fff" />
|
|
22
|
+
</mask>
|
|
23
|
+
<g mask="url(#mask0_2530_3510)">
|
|
24
|
+
<path
|
|
25
|
+
d="M35.058 4.24L2.116 48.392l21.841 16.296L56.9 20.536 35.058 4.24z"
|
|
26
|
+
fill="url(#paint0_linear_2530_3510)"
|
|
27
|
+
/>
|
|
28
|
+
<path
|
|
29
|
+
d="M35.058 4.24L2.116 48.392l21.841 16.296L56.9 20.536 35.058 4.24z"
|
|
30
|
+
fill="url(#paint1_linear_2530_3510)"
|
|
31
|
+
/>
|
|
32
|
+
<path
|
|
33
|
+
d="M49.367 12.968l-33.47 21.717 2.132 1.616 38.285-18.808-6.947-4.525z"
|
|
34
|
+
fill="#FA552D"
|
|
35
|
+
/>
|
|
36
|
+
<path
|
|
37
|
+
d="M49.367 12.968l-33.47 21.717 2.132 1.616 38.285-18.808-6.947-4.525z"
|
|
38
|
+
fill="url(#paint2_linear_2530_3510)"
|
|
39
|
+
/>
|
|
40
|
+
<path
|
|
41
|
+
d="M49.367 12.968l-33.47 21.717 2.132 1.616 38.285-18.808-6.947-4.525z"
|
|
42
|
+
fill="url(#paint3_linear_2530_3510)"
|
|
43
|
+
/>
|
|
44
|
+
<path fill="#42AB44" d="M0.908203 41.4221H12.851203V56.5531H0.908203z" />
|
|
45
|
+
</g>
|
|
46
|
+
<mask
|
|
47
|
+
id="mask1_2530_3510"
|
|
48
|
+
style={{
|
|
49
|
+
maskType: 'alpha',
|
|
50
|
+
}}
|
|
51
|
+
maskUnits="userSpaceOnUse"
|
|
52
|
+
x={6}
|
|
53
|
+
y={14}
|
|
54
|
+
width={62}
|
|
55
|
+
height={50}
|
|
56
|
+
>
|
|
57
|
+
<path d="M55.187 14.567L6.004 39.377l12.274 24.33 49.183-24.81-12.274-24.33z" fill="#fff" />
|
|
58
|
+
</mask>
|
|
59
|
+
<g mask="url(#mask1_2530_3510)">
|
|
60
|
+
<path
|
|
61
|
+
d="M55.187 14.567L6.004 39.377l12.274 24.33 49.183-24.81-12.274-24.33z"
|
|
62
|
+
fill="#FFCDBD"
|
|
63
|
+
/>
|
|
64
|
+
<path
|
|
65
|
+
d="M55.187 14.567L6.004 39.377l12.274 24.33 49.183-24.81-12.274-24.33z"
|
|
66
|
+
fill="url(#paint4_linear_2530_3510)"
|
|
67
|
+
/>
|
|
68
|
+
<path d="M67.462 33.264l-54.495 8.05 3.982 26.958 54.495-8.05-3.982-26.958z" fill="#42AB44" />
|
|
69
|
+
</g>
|
|
70
|
+
<mask
|
|
71
|
+
id="mask2_2530_3510"
|
|
72
|
+
style={{
|
|
73
|
+
maskType: 'alpha',
|
|
74
|
+
}}
|
|
75
|
+
maskUnits="userSpaceOnUse"
|
|
76
|
+
x={4}
|
|
77
|
+
y={30}
|
|
78
|
+
width={59}
|
|
79
|
+
height={36}
|
|
80
|
+
>
|
|
81
|
+
<path d="M58.603 30.767l-54.496 8.05L8.09 65.775l54.496-8.05-3.982-26.958z" fill="#fff" />
|
|
82
|
+
</mask>
|
|
83
|
+
<g mask="url(#mask2_2530_3510)">
|
|
84
|
+
<path
|
|
85
|
+
d="M58.603 30.767l-54.496 8.05L8.09 65.775l54.496-8.05-3.982-26.958z"
|
|
86
|
+
fill="url(#paint5_linear_2530_3510)"
|
|
87
|
+
/>
|
|
88
|
+
<path
|
|
89
|
+
fillRule="evenodd"
|
|
90
|
+
clipRule="evenodd"
|
|
91
|
+
d="M58.603 30.765L4.107 38.814l.54 3.652 13.994-2.067 2.902 19.65-13.99 2.066.54 3.652 13.99-2.066v.007l22.709-3.355-.001-.006 17.798-2.63-.54-3.651-17.797 2.629-2.903-19.65 17.793-2.629-.539-3.651z"
|
|
92
|
+
fill="url(#paint6_linear_2530_3510)"
|
|
93
|
+
/>
|
|
94
|
+
<path
|
|
95
|
+
fillRule="evenodd"
|
|
96
|
+
clipRule="evenodd"
|
|
97
|
+
d="M58.603 30.765L4.107 38.814l.54 3.652 13.994-2.067 2.902 19.65-13.99 2.066.54 3.652 13.99-2.066v.007l22.709-3.355-.001-.006 17.798-2.63-.54-3.651-17.797 2.629-2.903-19.65 17.793-2.629-.539-3.651z"
|
|
98
|
+
fill="url(#paint7_linear_2530_3510)"
|
|
99
|
+
/>
|
|
100
|
+
<path
|
|
101
|
+
d="M48.36 32.281l-7.541 1.114L44.8 60.353l7.543-1.114-3.982-26.958zM56.743 38.907l-4.241.627a1.308 1.308 0 01-.382-2.587l4.241-.627a1.308 1.308 0 01.382 2.587z"
|
|
102
|
+
fill="#42AB44"
|
|
103
|
+
/>
|
|
104
|
+
<path
|
|
105
|
+
d="M31.702 55.28l-2.33.344-.802-5.428-1.724.254-.166-1.128 1.724-.255-1.101-7.45 4.67-.69c.965-.142 1.822-.085 2.572.17.751.256 1.362.681 1.836 1.276.471.596.773 1.329.903 2.206.131.89.048 1.681-.252 2.376-.3.695-.787 1.26-1.462 1.7-.675.44-1.5.73-2.47.874l-2.196.324.802 5.427h-.004zm2.631-3.974l.167 1.128-7.204 1.064-.166-1.128 7.203-1.064zm-2.205-3.512a6.002 6.002 0 001.552-.43c.452-.2.795-.492 1.023-.88.229-.386.296-.905.2-1.556-.082-.554-.264-.993-.545-1.314a2.099 2.099 0 00-1.092-.651c-.446-.114-.965-.125-1.553-.038l-1.805.267.712 4.823 1.508-.223v.002z"
|
|
106
|
+
fill="#fff"
|
|
107
|
+
/>
|
|
108
|
+
</g>
|
|
109
|
+
<defs>
|
|
110
|
+
<linearGradient
|
|
111
|
+
id="paint0_linear_2530_3510"
|
|
112
|
+
x1={14.7502}
|
|
113
|
+
y1={4.23757}
|
|
114
|
+
x2={26.9602}
|
|
115
|
+
y2={26.3432}
|
|
116
|
+
gradientUnits="userSpaceOnUse"
|
|
117
|
+
>
|
|
118
|
+
<stop stopColor="#FEFFCF" />
|
|
119
|
+
<stop offset={1} stopColor="#FFE7DA" />
|
|
120
|
+
</linearGradient>
|
|
121
|
+
<linearGradient
|
|
122
|
+
id="paint1_linear_2530_3510"
|
|
123
|
+
x1={18.587}
|
|
124
|
+
y1={26.316}
|
|
125
|
+
x2={32.8984}
|
|
126
|
+
y2={36.8759}
|
|
127
|
+
gradientUnits="userSpaceOnUse"
|
|
128
|
+
>
|
|
129
|
+
<stop stopColor="#DCFFE5" />
|
|
130
|
+
<stop offset={1} stopColor="#EBE78C" />
|
|
131
|
+
</linearGradient>
|
|
132
|
+
<linearGradient
|
|
133
|
+
id="paint2_linear_2530_3510"
|
|
134
|
+
x1={50.4489}
|
|
135
|
+
y1={15.511}
|
|
136
|
+
x2={26.7341}
|
|
137
|
+
y2={29.0153}
|
|
138
|
+
gradientUnits="userSpaceOnUse"
|
|
139
|
+
>
|
|
140
|
+
<stop stopColor="#FFA183" />
|
|
141
|
+
<stop offset={1} stopColor="#FFA183" stopOpacity={0} />
|
|
142
|
+
</linearGradient>
|
|
143
|
+
<linearGradient
|
|
144
|
+
id="paint3_linear_2530_3510"
|
|
145
|
+
x1={49.3436}
|
|
146
|
+
y1={-56.8124}
|
|
147
|
+
x2={-1.00392}
|
|
148
|
+
y2={-52.0477}
|
|
149
|
+
gradientUnits="userSpaceOnUse"
|
|
150
|
+
>
|
|
151
|
+
<stop stopColor="#42AB44" />
|
|
152
|
+
<stop offset={1} stopColor="#201B37" />
|
|
153
|
+
</linearGradient>
|
|
154
|
+
<linearGradient
|
|
155
|
+
id="paint4_linear_2530_3510"
|
|
156
|
+
x1={30.5957}
|
|
157
|
+
y1={26.9721}
|
|
158
|
+
x2={38.6904}
|
|
159
|
+
y2={42.8088}
|
|
160
|
+
gradientUnits="userSpaceOnUse"
|
|
161
|
+
>
|
|
162
|
+
<stop stopColor="#DCFFE5" />
|
|
163
|
+
<stop offset={1} stopColor="#EBE78C" />
|
|
164
|
+
</linearGradient>
|
|
165
|
+
<linearGradient
|
|
166
|
+
id="paint5_linear_2530_3510"
|
|
167
|
+
x1={4.59823}
|
|
168
|
+
y1={42.1396}
|
|
169
|
+
x2={53.0558}
|
|
170
|
+
y2={55.1262}
|
|
171
|
+
gradientUnits="userSpaceOnUse"
|
|
172
|
+
>
|
|
173
|
+
<stop stopColor="#FFF7F4" />
|
|
174
|
+
<stop offset={0.34234} stopColor="#FEFFCF" />
|
|
175
|
+
<stop offset={1} stopColor="#FFE7DA" />
|
|
176
|
+
<stop offset={1} stopColor="#FFE7DA" />
|
|
177
|
+
</linearGradient>
|
|
178
|
+
<linearGradient
|
|
179
|
+
id="paint6_linear_2530_3510"
|
|
180
|
+
x1={19.1708}
|
|
181
|
+
y1={32.1466}
|
|
182
|
+
x2={29.8454}
|
|
183
|
+
y2={57.3534}
|
|
184
|
+
gradientUnits="userSpaceOnUse"
|
|
185
|
+
>
|
|
186
|
+
<stop stopColor="#FFCA42" />
|
|
187
|
+
<stop offset={1} stopColor="#FFA183" />
|
|
188
|
+
</linearGradient>
|
|
189
|
+
<linearGradient
|
|
190
|
+
id="paint7_linear_2530_3510"
|
|
191
|
+
x1={20.2683}
|
|
192
|
+
y1={42.9389}
|
|
193
|
+
x2={26.6235}
|
|
194
|
+
y2={64.3382}
|
|
195
|
+
gradientUnits="userSpaceOnUse"
|
|
196
|
+
>
|
|
197
|
+
<stop stopColor="#7DC15D" />
|
|
198
|
+
<stop offset={1} stopColor="#FEE54F" />
|
|
199
|
+
</linearGradient>
|
|
200
|
+
</defs>
|
|
201
|
+
</svg>
|
|
202
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const CalendarIcon = (props?: Record<string, any>) => (
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" {...props}>
|
|
3
|
+
<path
|
|
4
|
+
stroke="#1C1C1C"
|
|
5
|
+
strokeLinecap="round"
|
|
6
|
+
strokeLinejoin="round"
|
|
7
|
+
strokeMiterlimit="10"
|
|
8
|
+
strokeWidth="2"
|
|
9
|
+
d="M8 2v3M16 2v3M3.5 9.09h17M3 13.01V8.5c0-3 1.5-5 5-5h8c3.5 0 5 2 5 5V17c0 3-1.5 5-5 5H8c-3.5 0-5-2-5-5"
|
|
10
|
+
/>
|
|
11
|
+
<path
|
|
12
|
+
stroke="#42AB44"
|
|
13
|
+
strokeLinecap="round"
|
|
14
|
+
strokeLinejoin="round"
|
|
15
|
+
strokeWidth="3"
|
|
16
|
+
d="M15.991 13h.018M15.991 17.006h.018M11.991 13h.018M11.991 17.006h.018M7.991 13h.018M7.991 17.006h.018"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
);
|