@redneckz/wildless-cms-uni-blocks 0.9.14 → 0.9.16
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/bundle.umd.js +35 -24
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/constants.d.ts +3 -2
- package/bundle/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/bundle/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
- package/bundle/hooks/useLink.d.ts +5 -1
- package/bundle/services/sitemap/SitemapData.d.ts +2 -2
- package/bundle/ui-kit/SearchDialog/SearchDialog.d.ts +2 -2
- package/bundle/ui-kit/Sitemap/Sitemap.d.ts +2 -2
- package/bundle/utils/adjustHref.d.ts +1 -1
- package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/dist/components/Calculator/CreditCalculatorForm.js +1 -1
- package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/DepositCalculatorForm.js +6 -3
- package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/constants.d.ts +3 -2
- package/dist/components/Calculator/constants.js +7 -6
- package/dist/components/Calculator/constants.js.map +1 -1
- package/dist/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/dist/components/Calculator/useDepositCalculatorParams.js +6 -1
- package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/dist/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
- package/dist/components/Footer/TextInformationLink.js +1 -1
- package/dist/components/Footer/TextInformationLink.js.map +1 -1
- package/dist/components/LinkDocs/LinkDocsListItemBase.js +1 -1
- package/dist/components/LinkDocs/LinkDocsListItemBase.js.map +1 -1
- package/dist/components/TariffsTable/TableTileHeader.js +1 -1
- package/dist/components/TariffsTable/TableTileHeader.js.map +1 -1
- package/dist/components/TariffsTable/TariffsTableRow.js +1 -1
- package/dist/components/TariffsTable/TariffsTableRow.js.map +1 -1
- package/dist/hooks/useLink.d.ts +5 -1
- package/dist/hooks/useLink.js +3 -2
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/services/sitemap/SitemapData.d.ts +2 -2
- package/dist/ui-kit/SearchDialog/SearchDialog.d.ts +2 -2
- package/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/dist/ui-kit/Sitemap/Sitemap.d.ts +2 -2
- package/dist/ui-kit/Sitemap/Sitemap.js +3 -4
- package/dist/ui-kit/Sitemap/Sitemap.js.map +1 -1
- package/dist/ui-kit/TopItem/TopItem.js +1 -1
- package/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/dist/utils/adjustHref.d.ts +1 -1
- package/dist/utils/adjustHref.js +4 -3
- package/dist/utils/adjustHref.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/lib/components/Calculator/CreditCalculatorForm.js +2 -2
- package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/DepositCalculatorForm.js +8 -5
- package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/constants.d.ts +3 -2
- package/lib/components/Calculator/constants.js +6 -5
- package/lib/components/Calculator/constants.js.map +1 -1
- package/lib/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/lib/components/Calculator/useDepositCalculatorParams.js +6 -1
- package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/lib/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
- package/lib/components/Footer/TextInformationLink.js +1 -1
- package/lib/components/Footer/TextInformationLink.js.map +1 -1
- package/lib/components/LinkDocs/LinkDocsListItemBase.js +1 -1
- package/lib/components/LinkDocs/LinkDocsListItemBase.js.map +1 -1
- package/lib/components/TariffsTable/TableTileHeader.js +1 -1
- package/lib/components/TariffsTable/TableTileHeader.js.map +1 -1
- package/lib/components/TariffsTable/TariffsTableRow.js +1 -1
- package/lib/components/TariffsTable/TariffsTableRow.js.map +1 -1
- package/lib/hooks/useLink.d.ts +5 -1
- package/lib/hooks/useLink.js +3 -2
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/services/sitemap/SitemapData.d.ts +2 -2
- package/lib/ui-kit/SearchDialog/SearchDialog.d.ts +2 -2
- package/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/lib/ui-kit/Sitemap/Sitemap.d.ts +2 -2
- package/lib/ui-kit/Sitemap/Sitemap.js +3 -4
- package/lib/ui-kit/Sitemap/Sitemap.js.map +1 -1
- package/lib/ui-kit/TopItem/TopItem.js +1 -1
- package/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/lib/utils/adjustHref.d.ts +1 -1
- package/lib/utils/adjustHref.js +4 -3
- package/lib/utils/adjustHref.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +14 -12
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/constants.d.ts +3 -2
- package/mobile/bundle/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/mobile/bundle/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
- package/mobile/bundle/hooks/useLink.d.ts +5 -1
- package/mobile/bundle/services/sitemap/SitemapData.d.ts +2 -2
- package/mobile/bundle/ui-kit/SearchDialog/SearchDialog.d.ts +2 -2
- package/mobile/bundle/ui-kit/Sitemap/Sitemap.d.ts +2 -2
- package/mobile/bundle/utils/adjustHref.d.ts +1 -1
- package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js +1 -1
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js +6 -3
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/constants.d.ts +3 -2
- package/mobile/dist/components/Calculator/constants.js +7 -6
- package/mobile/dist/components/Calculator/constants.js.map +1 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +6 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
- package/mobile/dist/components/Footer/TextInformationLink.js +1 -1
- package/mobile/dist/components/Footer/TextInformationLink.js.map +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsListItemBase.js +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsListItemBase.js.map +1 -1
- package/mobile/dist/components/TariffsTable/TableTileHeader.js +1 -1
- package/mobile/dist/components/TariffsTable/TableTileHeader.js.map +1 -1
- package/mobile/dist/components/TariffsTable/TariffsTableRow.js +1 -1
- package/mobile/dist/components/TariffsTable/TariffsTableRow.js.map +1 -1
- package/mobile/dist/hooks/useLink.d.ts +5 -1
- package/mobile/dist/hooks/useLink.js +3 -2
- package/mobile/dist/hooks/useLink.js.map +1 -1
- package/mobile/dist/services/sitemap/SitemapData.d.ts +2 -2
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.d.ts +2 -2
- package/mobile/dist/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/mobile/dist/ui-kit/Sitemap/Sitemap.d.ts +2 -2
- package/mobile/dist/ui-kit/Sitemap/Sitemap.js +3 -4
- package/mobile/dist/ui-kit/Sitemap/Sitemap.js.map +1 -1
- package/mobile/dist/ui-kit/TopItem/TopItem.js +1 -1
- package/mobile/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/dist/utils/adjustHref.d.ts +1 -1
- package/mobile/dist/utils/adjustHref.js +4 -3
- package/mobile/dist/utils/adjustHref.js.map +1 -1
- package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js +2 -2
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js +8 -5
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/constants.d.ts +3 -2
- package/mobile/lib/components/Calculator/constants.js +6 -5
- package/mobile/lib/components/Calculator/constants.js.map +1 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.d.ts +1 -0
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +6 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/CarouselRichTextCard/CarouselRichTextCardContent.d.ts +1 -1
- package/mobile/lib/components/Footer/TextInformationLink.js +1 -1
- package/mobile/lib/components/Footer/TextInformationLink.js.map +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsListItemBase.js +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsListItemBase.js.map +1 -1
- package/mobile/lib/components/TariffsTable/TableTileHeader.js +1 -1
- package/mobile/lib/components/TariffsTable/TableTileHeader.js.map +1 -1
- package/mobile/lib/components/TariffsTable/TariffsTableRow.js +1 -1
- package/mobile/lib/components/TariffsTable/TariffsTableRow.js.map +1 -1
- package/mobile/lib/hooks/useLink.d.ts +5 -1
- package/mobile/lib/hooks/useLink.js +3 -2
- package/mobile/lib/hooks/useLink.js.map +1 -1
- package/mobile/lib/services/sitemap/SitemapData.d.ts +2 -2
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.d.ts +2 -2
- package/mobile/lib/ui-kit/SearchDialog/SearchDialog.js.map +1 -1
- package/mobile/lib/ui-kit/Sitemap/Sitemap.d.ts +2 -2
- package/mobile/lib/ui-kit/Sitemap/Sitemap.js +3 -4
- package/mobile/lib/ui-kit/Sitemap/Sitemap.js.map +1 -1
- package/mobile/lib/ui-kit/TopItem/TopItem.js +1 -1
- package/mobile/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/lib/utils/adjustHref.d.ts +1 -1
- package/mobile/lib/utils/adjustHref.js +4 -3
- package/mobile/lib/utils/adjustHref.js.map +1 -1
- package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +2 -2
- package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +2 -2
- package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +8 -5
- package/mobile/src/components/Calculator/constants.ts +6 -5
- package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +9 -1
- package/mobile/src/components/CarouselProgramsCard/CarouselProgramsCard.example.json +6 -6
- package/mobile/src/components/CarouselRichTextCard/CarouselRichTextCardContent.ts +1 -1
- package/mobile/src/components/Footer/TextInformationLink.tsx +1 -1
- package/mobile/src/components/LinkDocs/LinkDocsListItemBase.tsx +2 -2
- package/mobile/src/components/TariffsTable/TableTileHeader.tsx +1 -3
- package/mobile/src/components/TariffsTable/TariffsTableRow.tsx +3 -3
- package/mobile/src/hooks/useLink.ts +9 -2
- package/mobile/src/services/sitemap/SitemapData.ts +2 -2
- package/mobile/src/ui-kit/SearchDialog/SearchDialog.tsx +5 -5
- package/mobile/src/ui-kit/Sitemap/Sitemap.tsx +6 -7
- package/mobile/src/ui-kit/TopItem/TopItem.tsx +1 -1
- package/mobile/src/utils/adjustHref.ts +16 -11
- package/package.json +1 -1
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +2 -2
- package/src/components/Calculator/CreditCalculatorForm.tsx +2 -2
- package/src/components/Calculator/DepositCalculatorForm.tsx +8 -5
- package/src/components/Calculator/constants.ts +6 -5
- package/src/components/Calculator/useDepositCalculatorParams.ts +9 -1
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.example.json +6 -6
- package/src/components/CarouselRichTextCard/CarouselRichTextCardContent.ts +1 -1
- package/src/components/Footer/TextInformationLink.tsx +1 -1
- package/src/components/LinkDocs/LinkDocsListItemBase.tsx +2 -2
- package/src/components/TariffsTable/TableTileHeader.tsx +1 -3
- package/src/components/TariffsTable/TariffsTableRow.tsx +3 -3
- package/src/hooks/useLink.ts +9 -2
- package/src/services/sitemap/SitemapData.ts +2 -2
- package/src/ui-kit/SearchDialog/SearchDialog.tsx +5 -5
- package/src/ui-kit/Sitemap/Sitemap.tsx +6 -7
- package/src/ui-kit/TopItem/TopItem.tsx +1 -1
- package/src/utils/adjustHref.ts +16 -11
- package/bundle/components/Calculator/getDefaultSum.d.ts +0 -1
- package/dist/components/Calculator/getDefaultSum.d.ts +0 -1
- package/dist/components/Calculator/getDefaultSum.js +0 -6
- package/dist/components/Calculator/getDefaultSum.js.map +0 -1
- package/lib/components/Calculator/getDefaultSum.d.ts +0 -1
- package/lib/components/Calculator/getDefaultSum.js +0 -3
- package/lib/components/Calculator/getDefaultSum.js.map +0 -1
- package/mobile/bundle/components/Calculator/getDefaultSum.d.ts +0 -1
- package/mobile/dist/components/Calculator/getDefaultSum.d.ts +0 -1
- package/mobile/dist/components/Calculator/getDefaultSum.js +0 -6
- package/mobile/dist/components/Calculator/getDefaultSum.js.map +0 -1
- package/mobile/lib/components/Calculator/getDefaultSum.d.ts +0 -1
- package/mobile/lib/components/Calculator/getDefaultSum.js +0 -3
- package/mobile/lib/components/Calculator/getDefaultSum.js.map +0 -1
- package/mobile/src/components/Calculator/getDefaultSum.ts +0 -4
- package/src/components/Calculator/getDefaultSum.ts +0 -4
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"title": "Заголовок",
|
|
11
11
|
"list": [
|
|
12
12
|
{
|
|
13
|
-
"title": "
|
|
14
|
-
"description": "Описание 1
|
|
13
|
+
"title": "Заголовок 1",
|
|
14
|
+
"description": "Описание 1"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
"title": "
|
|
18
|
-
"description": "Описание
|
|
17
|
+
"title": "Заголовок 2",
|
|
18
|
+
"description": "Описание 2"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
"title": "
|
|
22
|
-
"description": "Описание
|
|
21
|
+
"title": "Заголовок 3",
|
|
22
|
+
"description": "Описание 3"
|
|
23
23
|
}
|
|
24
24
|
]
|
|
25
25
|
}
|
|
@@ -4,4 +4,4 @@ import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
|
4
4
|
/**
|
|
5
5
|
* @title Карточка c форматированным вводом
|
|
6
6
|
*/
|
|
7
|
-
export type CarouselRichTextCardContent = UniBlockContent & RichTextProps
|
|
7
|
+
export type CarouselRichTextCardContent = UniBlockContent & RichTextProps;
|
|
@@ -10,7 +10,7 @@ interface TextInformationLinkProps extends LinkProps {
|
|
|
10
10
|
|
|
11
11
|
export const TextInformationLink = JSX<Partial<TextInformationLinkProps>>(
|
|
12
12
|
({ className = '', index, ...rest }) => {
|
|
13
|
-
const link = useLink();
|
|
13
|
+
const link = useLink({ isRemote: true });
|
|
14
14
|
const { href, target, text, onClick } = link(rest);
|
|
15
15
|
|
|
16
16
|
return (
|
|
@@ -6,8 +6,6 @@ import type { TariffsTableRowHeader } from './TariffsTableContent';
|
|
|
6
6
|
export const TableTileHeader = JSX<TariffsTableRowHeader>(({ title, icon }) => (
|
|
7
7
|
<div className="flex gap-2.5 mb-2">
|
|
8
8
|
{title ? <Heading headingType="h3" className="font-medium" title={title} /> : null}
|
|
9
|
-
{icon ?
|
|
10
|
-
<Img className="ml-auto max-w-6 max-h-6" image={icon} width="24px" height="24px" />
|
|
11
|
-
) : null}
|
|
9
|
+
{icon ? <Img className="ml-auto min-w-6" image={icon} width="24" height="24" /> : null}
|
|
12
10
|
</div>
|
|
13
11
|
));
|
|
@@ -40,10 +40,10 @@ export const TariffsTableRow = JSX<TariffsTableRowProps>(
|
|
|
40
40
|
<div className="flex items-center text-primary-text" role="cell">
|
|
41
41
|
{header?.icon ? (
|
|
42
42
|
<Img
|
|
43
|
-
className="mr-3.5 max-w-6
|
|
43
|
+
className="mr-3.5 max-w-6"
|
|
44
44
|
image={getIconWithVersion(header.icon)}
|
|
45
|
-
width="
|
|
46
|
-
height="
|
|
45
|
+
width="24"
|
|
46
|
+
height="24"
|
|
47
47
|
asSVG
|
|
48
48
|
/>
|
|
49
49
|
) : null}
|
|
@@ -10,13 +10,20 @@ interface Clickable {
|
|
|
10
10
|
onClick(ev?: PreventableEvent): void;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
interface UseLinkParams {
|
|
14
|
+
isRemote?: boolean;
|
|
15
|
+
basePath?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function useLink(params: UseLinkParams = {}) {
|
|
19
|
+
const { isRemote, basePath } = params;
|
|
20
|
+
|
|
14
21
|
const router = useRouter();
|
|
15
22
|
const { close } = useDialog();
|
|
16
23
|
|
|
17
24
|
return <L extends Partial<LinkProps & Clickable>>(props: L): L & Clickable => ({
|
|
18
25
|
...props,
|
|
19
|
-
href: isRemote ? props.href : adjustHref(router)(props.href),
|
|
26
|
+
href: isRemote ? props.href : adjustHref(router)(props.href, basePath),
|
|
20
27
|
'aria-label': props.text,
|
|
21
28
|
onClick: handlerDecorator(handleHref(props), props),
|
|
22
29
|
});
|
|
@@ -6,7 +6,7 @@ import type { IconProps, Picture } from '../../model/Picture';
|
|
|
6
6
|
* @title Ссылка
|
|
7
7
|
* @required ["text", "href"]
|
|
8
8
|
*/
|
|
9
|
-
export interface
|
|
9
|
+
export interface TopMenuItemProps extends LinkProps {
|
|
10
10
|
/** @hidden */
|
|
11
11
|
items?: LinkProps[];
|
|
12
12
|
}
|
|
@@ -27,7 +27,7 @@ export interface DispositionItem extends LinkProps {
|
|
|
27
27
|
export type ForeignOffice = LinkProps & IconProps;
|
|
28
28
|
|
|
29
29
|
export interface SitemapData {
|
|
30
|
-
topItems?:
|
|
30
|
+
topItems?: TopMenuItemProps[];
|
|
31
31
|
dispositions?: DispositionItem[];
|
|
32
32
|
logo?: LogoType;
|
|
33
33
|
foreignOffices?: ForeignOffice[];
|
|
@@ -2,7 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import type { LinkProps } from '../../model/LinkProps';
|
|
4
4
|
import { useSearch, type SearchResult } from '../../services/search/useSearch';
|
|
5
|
-
import type {
|
|
5
|
+
import type { TopMenuItemProps } from '../../services/sitemap/SitemapData';
|
|
6
6
|
import { joinPath } from '../../utils/url';
|
|
7
7
|
import { zip } from '../../utils/zip';
|
|
8
8
|
import { Dialog } from '../Dialog/Dialog';
|
|
@@ -11,7 +11,7 @@ import { Sitemap } from '../Sitemap/Sitemap';
|
|
|
11
11
|
import { SearchInput } from './SearchInput';
|
|
12
12
|
|
|
13
13
|
export interface SearchDialogProps {
|
|
14
|
-
topItems?:
|
|
14
|
+
topItems?: TopMenuItemProps[];
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export const SEARCH_DIALOG_ID = 'search';
|
|
@@ -44,8 +44,8 @@ export const SearchDialog = JSX<SearchDialogProps>(({ topItems }) => {
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
const combineTopItemsAndSearchResult =
|
|
47
|
-
(topItems:
|
|
48
|
-
(searchResult: SearchResult | null | undefined):
|
|
47
|
+
(topItems: TopMenuItemProps[] | undefined) =>
|
|
48
|
+
(searchResult: SearchResult | null | undefined): TopMenuItemProps[] =>
|
|
49
49
|
topItems?.length && searchResult?.length
|
|
50
50
|
? zip(topItems, searchResult).map(([_, portalSearchResult]) => ({
|
|
51
51
|
..._,
|
|
@@ -56,7 +56,7 @@ const combineTopItemsAndSearchResult =
|
|
|
56
56
|
: [];
|
|
57
57
|
|
|
58
58
|
// Temp
|
|
59
|
-
function printSearchItems(topItems:
|
|
59
|
+
function printSearchItems(topItems: TopMenuItemProps[]) {
|
|
60
60
|
for (const _ of topItems.filter(({ items }) => items?.length)) {
|
|
61
61
|
console.group(_.text);
|
|
62
62
|
console.table(_.items, ['text', 'href']);
|
|
@@ -2,17 +2,16 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useLink } from '../../hooks/useLink';
|
|
3
3
|
import type { LinkProps } from '../../model/LinkProps';
|
|
4
4
|
import { projectSettings } from '../../ProjectSettings';
|
|
5
|
-
import type {
|
|
5
|
+
import type { TopMenuItemProps } from '../../services/sitemap/SitemapData';
|
|
6
6
|
import { style } from '../../utils/style';
|
|
7
|
-
import { joinPath } from '../../utils/url';
|
|
8
7
|
|
|
9
8
|
export interface SitemapProps {
|
|
10
9
|
className?: string;
|
|
11
|
-
topItems?:
|
|
10
|
+
topItems?: TopMenuItemProps[];
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
export const Sitemap = JSX<SitemapProps>(({ className, topItems }) => {
|
|
15
|
-
const link = useLink(true);
|
|
14
|
+
const link = useLink({ isRemote: true });
|
|
16
15
|
|
|
17
16
|
return (
|
|
18
17
|
<div className={style('flex items-start justify-between', className)}>
|
|
@@ -21,7 +20,7 @@ export const Sitemap = JSX<SitemapProps>(({ className, topItems }) => {
|
|
|
21
20
|
);
|
|
22
21
|
});
|
|
23
22
|
|
|
24
|
-
const renderColumn = (menuItem:
|
|
23
|
+
const renderColumn = (menuItem: TopMenuItemProps & { onClick: () => void }, index: number) => {
|
|
25
24
|
const { text, items, href, target, onClick } = menuItem;
|
|
26
25
|
|
|
27
26
|
return (
|
|
@@ -50,7 +49,7 @@ const ColumnItem = JSX<ColumnItemProps>(({ text, index, basePath, ...rest }) =>
|
|
|
50
49
|
const isAnotherPortal =
|
|
51
50
|
projectSettings.BASE_PATH && basePath ? !projectSettings.BASE_PATH.startsWith(basePath) : false;
|
|
52
51
|
|
|
53
|
-
const link = useLink(isAnotherPortal);
|
|
52
|
+
const link = useLink({ isRemote: isAnotherPortal });
|
|
54
53
|
const { href, target, onClick } = link(rest);
|
|
55
54
|
|
|
56
55
|
return (
|
|
@@ -59,7 +58,7 @@ const ColumnItem = JSX<ColumnItemProps>(({ text, index, basePath, ...rest }) =>
|
|
|
59
58
|
'text-l-light text-secondary-text hover:text-primary-main no-underline',
|
|
60
59
|
'overflow-x-hidden overflow-ellipsis whitespace-nowrap',
|
|
61
60
|
)}
|
|
62
|
-
href={
|
|
61
|
+
href={href}
|
|
63
62
|
target={target || '_self'}
|
|
64
63
|
onClick={onClick}
|
|
65
64
|
>
|
|
@@ -15,7 +15,7 @@ export interface TopItemProps extends TopItemContent {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export const TopItem = JSX<TopItemProps>(({ className = '', active, flat, children, ...rest }) => {
|
|
18
|
-
const link = useLink(true);
|
|
18
|
+
const link = useLink({ isRemote: true });
|
|
19
19
|
const { href, target, text, onClick } = link(rest);
|
|
20
20
|
|
|
21
21
|
return (
|
|
@@ -2,16 +2,21 @@ import { projectSettings } from '../ProjectSettings';
|
|
|
2
2
|
import { dirname } from './dirname';
|
|
3
3
|
import { isURL, joinPath } from './url';
|
|
4
4
|
|
|
5
|
-
export const adjustHref =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export const adjustHref =
|
|
6
|
+
(router: { pathname: string }) =>
|
|
7
|
+
(href: string | undefined, basePath = projectSettings.BASE_PATH) => {
|
|
8
|
+
if (!href || isURL(href) || hasPrefix(href, projectSettings.CDN)) {
|
|
9
|
+
return href;
|
|
10
|
+
}
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
const isRelativeToBase = href.startsWith('/');
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
14
|
+
return joinPath(
|
|
15
|
+
hasPrefix(href, basePath) ? '' : basePath,
|
|
16
|
+
isRelativeToBase ? '/' : dirname(router.pathname),
|
|
17
|
+
href,
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const hasPrefix = (href: string, prefix: string | undefined) =>
|
|
22
|
+
prefix && href && href.startsWith(prefix);
|
package/package.json
CHANGED
|
@@ -3,13 +3,13 @@ import { AlignText } from '../../model/AlignText';
|
|
|
3
3
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
4
4
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
5
|
import { Img } from '../../ui-kit/Img/Img';
|
|
6
|
+
import { style } from '../../utils/style';
|
|
6
7
|
import { Headline } from '../Headline/Headline';
|
|
7
8
|
import type {
|
|
8
9
|
BonusBenefit,
|
|
9
10
|
BonusBenefitsBlockContent,
|
|
10
11
|
ColumnsCount,
|
|
11
12
|
} from './BonusBenefitsBlockContent';
|
|
12
|
-
import { style } from '../../utils/style';
|
|
13
13
|
|
|
14
14
|
export interface BenefitsBlockProps extends BonusBenefitsBlockContent, UniBlockProps {}
|
|
15
15
|
|
|
@@ -49,7 +49,7 @@ const renderBonusBenefit = ({ icon, title, description }: BonusBenefit, i: numbe
|
|
|
49
49
|
)}
|
|
50
50
|
>
|
|
51
51
|
{title ? <span>{title}</span> : null}
|
|
52
|
-
{icon ? <Img image={icon} height="180"
|
|
52
|
+
{icon ? <Img image={icon} height="180" className="w-auto" /> : null}
|
|
53
53
|
{description ? <span>{description}</span> : null}
|
|
54
54
|
</div>
|
|
55
55
|
);
|
|
@@ -8,7 +8,7 @@ import type {
|
|
|
8
8
|
CreditCalculatorProps,
|
|
9
9
|
} from './CalculatorContent';
|
|
10
10
|
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
11
|
-
import {
|
|
11
|
+
import { CREDIT_DEFAULT_SUM, DEFAULT_MONTHS } from './constants';
|
|
12
12
|
import { Rate } from './Rate';
|
|
13
13
|
import { renderFootnote } from './renderFootnote';
|
|
14
14
|
import { renderMonthsInput } from './renderMonthsInput';
|
|
@@ -31,7 +31,7 @@ export const CreditCalculatorForm = JSX<CreditCalculatorProp>(
|
|
|
31
31
|
const handleIsPensionClient = useCallback((_: boolean) => toggleIsPensionClient(_), []);
|
|
32
32
|
const [isInsurance, toggleIsInsurance] = useState(true);
|
|
33
33
|
const handleIsInsurance = useCallback((_: boolean) => toggleIsInsurance(_), []);
|
|
34
|
-
const [moneyValue, setMoneyValue] = useState(
|
|
34
|
+
const [moneyValue, setMoneyValue] = useState(CREDIT_DEFAULT_SUM);
|
|
35
35
|
const handleMoneyValue = useCallback((_: number) => setMoneyValue(_), []);
|
|
36
36
|
const [monthsValue, setMonthsValue] = useState(DEFAULT_MONTHS);
|
|
37
37
|
const handleMonthsValue = useCallback((_: number) => setMonthsValue(_), []);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// TEMP
|
|
2
2
|
|
|
3
3
|
import { JSX } from '@redneckz/uni-jsx';
|
|
4
|
-
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
|
+
import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
5
5
|
import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
|
|
6
6
|
import { style } from '../../utils/style';
|
|
7
7
|
import { DepositCalculatorParamsViewSettings, DepositCalculatorProps } from './CalculatorContent';
|
|
8
8
|
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
9
|
-
import {
|
|
9
|
+
import { DEPOSIT_DEFAULT_SUM } from './constants';
|
|
10
10
|
import { Rate } from './Rate';
|
|
11
11
|
import { renderFootnote } from './renderFootnote';
|
|
12
12
|
import { renderInterestPayment } from './renderInterestPayment';
|
|
@@ -21,9 +21,9 @@ export interface DepositCalculatorProp extends DepositCalculatorProps {
|
|
|
21
21
|
|
|
22
22
|
export const DepositCalculatorForm = JSX<DepositCalculatorProp>(
|
|
23
23
|
({ className = '', sourceBookDir, buttons, footnote, paramsViewSettings }) => {
|
|
24
|
-
const [moneyValue, setMoneyValue] = useState(
|
|
24
|
+
const [moneyValue, setMoneyValue] = useState(DEPOSIT_DEFAULT_SUM);
|
|
25
25
|
const handleMoneyValue = useCallback((_: number) => setMoneyValue(_), []);
|
|
26
|
-
const [monthsValue, setMonthsValue] = useState(
|
|
26
|
+
const [monthsValue, setMonthsValue] = useState(0);
|
|
27
27
|
const [isMonthlyInterestPayment, toggleIsMonthlyInterestPayment] = useState(false);
|
|
28
28
|
const handleIsMonthlyInterestPayment = useCallback(
|
|
29
29
|
(_: boolean) => toggleIsMonthlyInterestPayment(_),
|
|
@@ -47,7 +47,10 @@ export const DepositCalculatorForm = JSX<DepositCalculatorProp>(
|
|
|
47
47
|
sourceBookDir,
|
|
48
48
|
paramsViewSettings,
|
|
49
49
|
);
|
|
50
|
-
const { income, finalSum, rate } = calculatorParams;
|
|
50
|
+
const { defaultMonth, income, finalSum, rate } = calculatorParams;
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
setMonthsValue(defaultMonth);
|
|
53
|
+
}, [defaultMonth]);
|
|
51
54
|
|
|
52
55
|
return (
|
|
53
56
|
<section className={style('flex justify-between', className)}>
|
|
@@ -3,9 +3,10 @@ import { BusinessDepositCalculatorSourceBookParams } from './useBusinessDepositC
|
|
|
3
3
|
import { CreditCalculatorSourceBookParams } from './useCreditCalculatorParams';
|
|
4
4
|
import { DepositCalculatorSourceBookParams } from './useDepositCalculatorParams';
|
|
5
5
|
|
|
6
|
-
export const DEFAULT_MIN_SUM =
|
|
6
|
+
export const DEFAULT_MIN_SUM = 10000;
|
|
7
7
|
export const DEFAULT_MAX_SUM = 5000000;
|
|
8
|
-
export const
|
|
8
|
+
export const CREDIT_DEFAULT_SUM = 200000;
|
|
9
|
+
export const DEPOSIT_DEFAULT_SUM = 20000;
|
|
9
10
|
export const DEFAULT_MIN_MONTHS = 13;
|
|
10
11
|
export const DEFAULT_MAX_MONTHS = 60;
|
|
11
12
|
export const DEFAULT_MONTHS = Math.round((DEFAULT_MAX_MONTHS - DEFAULT_MIN_MONTHS) / 2);
|
|
@@ -25,10 +26,10 @@ export const DEFAULT_CREDIT_CALCULATOR_PARAMS: CreditCalculatorSourceBookParams
|
|
|
25
26
|
maxSum: DEFAULT_MAX_SUM,
|
|
26
27
|
minMonths: DEFAULT_MIN_MONTHS,
|
|
27
28
|
maxMonths: DEFAULT_MAX_MONTHS,
|
|
28
|
-
rate:
|
|
29
|
-
isSalaryClient:
|
|
29
|
+
rate: 12.5,
|
|
30
|
+
isSalaryClient: false,
|
|
30
31
|
isPensionClient: false,
|
|
31
|
-
isStateEmployee:
|
|
32
|
+
isStateEmployee: false,
|
|
32
33
|
isInsurance: true,
|
|
33
34
|
};
|
|
34
35
|
|
|
@@ -27,6 +27,7 @@ export interface DepositCalculatorParams
|
|
|
27
27
|
extends DepositCalculatorSourceBookParams,
|
|
28
28
|
DepositCalculatorUserInputParams {
|
|
29
29
|
availableMonths: number[];
|
|
30
|
+
defaultMonth: number;
|
|
30
31
|
income: number;
|
|
31
32
|
finalSum: number;
|
|
32
33
|
}
|
|
@@ -44,6 +45,9 @@ export const useDepositCalculatorParams = (
|
|
|
44
45
|
const data = useCalculatorParams<DepositCalculatorData>(
|
|
45
46
|
sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR,
|
|
46
47
|
);
|
|
48
|
+
const defaultMonth = data?.rows[0]
|
|
49
|
+
? getMiddleMonth(data.rows[0].minMonths, data.rows[0].maxMonths)
|
|
50
|
+
: 1;
|
|
47
51
|
const isExcludeMonthlyInterestPayment = !paramsViewSettings?.isShowMonthlyInterestPayment;
|
|
48
52
|
const isExcludeRemoteRegistration = !paramsViewSettings?.isShowRemoteRegistration;
|
|
49
53
|
const depositCalculatorSourceBookParams =
|
|
@@ -62,7 +66,7 @@ export const useDepositCalculatorParams = (
|
|
|
62
66
|
isExclude: isExcludeRemoteRegistration,
|
|
63
67
|
}) &&
|
|
64
68
|
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], row) &&
|
|
65
|
-
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], row),
|
|
69
|
+
checkRangeByKeys(monthsValue || defaultMonth, ['minMonths', 'maxMonths'], row),
|
|
66
70
|
) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
|
|
67
71
|
|
|
68
72
|
const { rate } = depositCalculatorSourceBookParams;
|
|
@@ -78,6 +82,7 @@ export const useDepositCalculatorParams = (
|
|
|
78
82
|
sourceBookRows.map((row) => [row['minMonths'], row['maxMonths']]),
|
|
79
83
|
).flatMap(([start, end]) => arrayByRange(start, end)),
|
|
80
84
|
...userInputParams,
|
|
85
|
+
defaultMonth,
|
|
81
86
|
income,
|
|
82
87
|
finalSum,
|
|
83
88
|
};
|
|
@@ -105,3 +110,6 @@ interface CheckRowByParamProps {
|
|
|
105
110
|
|
|
106
111
|
const checkRowByParam = ({ row, userInputParams, paramKey, isExclude }: CheckRowByParamProps) =>
|
|
107
112
|
isExclude || userInputParams[paramKey] === row[paramKey];
|
|
113
|
+
|
|
114
|
+
const getMiddleMonth = (minMonths: number, maxMonths: number): number =>
|
|
115
|
+
minMonths + Math.round((maxMonths - minMonths) / 2);
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"title": "Заголовок",
|
|
11
11
|
"list": [
|
|
12
12
|
{
|
|
13
|
-
"title": "
|
|
14
|
-
"description": "Описание 1
|
|
13
|
+
"title": "Заголовок 1",
|
|
14
|
+
"description": "Описание 1"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
"title": "
|
|
18
|
-
"description": "Описание
|
|
17
|
+
"title": "Заголовок 2",
|
|
18
|
+
"description": "Описание 2"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
"title": "
|
|
22
|
-
"description": "Описание
|
|
21
|
+
"title": "Заголовок 3",
|
|
22
|
+
"description": "Описание 3"
|
|
23
23
|
}
|
|
24
24
|
]
|
|
25
25
|
}
|
|
@@ -4,4 +4,4 @@ import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
|
|
|
4
4
|
/**
|
|
5
5
|
* @title Карточка c форматированным вводом
|
|
6
6
|
*/
|
|
7
|
-
export type CarouselRichTextCardContent = UniBlockContent & RichTextProps
|
|
7
|
+
export type CarouselRichTextCardContent = UniBlockContent & RichTextProps;
|
|
@@ -10,7 +10,7 @@ interface TextInformationLinkProps extends LinkProps {
|
|
|
10
10
|
|
|
11
11
|
export const TextInformationLink = JSX<Partial<TextInformationLinkProps>>(
|
|
12
12
|
({ className = '', index, ...rest }) => {
|
|
13
|
-
const link = useLink();
|
|
13
|
+
const link = useLink({ isRemote: true });
|
|
14
14
|
const { href, target, text, onClick } = link(rest);
|
|
15
15
|
|
|
16
16
|
return (
|
|
@@ -6,8 +6,6 @@ import type { TariffsTableRowHeader } from './TariffsTableContent';
|
|
|
6
6
|
export const TableTileHeader = JSX<TariffsTableRowHeader>(({ title, icon }) => (
|
|
7
7
|
<div className="flex gap-2.5 mb-2">
|
|
8
8
|
{title ? <Heading headingType="h3" className="font-medium" title={title} /> : null}
|
|
9
|
-
{icon ?
|
|
10
|
-
<Img className="ml-auto max-w-6 max-h-6" image={icon} width="24px" height="24px" />
|
|
11
|
-
) : null}
|
|
9
|
+
{icon ? <Img className="ml-auto min-w-6" image={icon} width="24" height="24" /> : null}
|
|
12
10
|
</div>
|
|
13
11
|
));
|
|
@@ -40,10 +40,10 @@ export const TariffsTableRow = JSX<TariffsTableRowProps>(
|
|
|
40
40
|
<div className="flex items-center text-primary-text" role="cell">
|
|
41
41
|
{header?.icon ? (
|
|
42
42
|
<Img
|
|
43
|
-
className="mr-3.5 max-w-6
|
|
43
|
+
className="mr-3.5 max-w-6"
|
|
44
44
|
image={getIconWithVersion(header.icon)}
|
|
45
|
-
width="
|
|
46
|
-
height="
|
|
45
|
+
width="24"
|
|
46
|
+
height="24"
|
|
47
47
|
asSVG
|
|
48
48
|
/>
|
|
49
49
|
) : null}
|
package/src/hooks/useLink.ts
CHANGED
|
@@ -10,13 +10,20 @@ interface Clickable {
|
|
|
10
10
|
onClick(ev?: PreventableEvent): void;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
interface UseLinkParams {
|
|
14
|
+
isRemote?: boolean;
|
|
15
|
+
basePath?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function useLink(params: UseLinkParams = {}) {
|
|
19
|
+
const { isRemote, basePath } = params;
|
|
20
|
+
|
|
14
21
|
const router = useRouter();
|
|
15
22
|
const { close } = useDialog();
|
|
16
23
|
|
|
17
24
|
return <L extends Partial<LinkProps & Clickable>>(props: L): L & Clickable => ({
|
|
18
25
|
...props,
|
|
19
|
-
href: isRemote ? props.href : adjustHref(router)(props.href),
|
|
26
|
+
href: isRemote ? props.href : adjustHref(router)(props.href, basePath),
|
|
20
27
|
'aria-label': props.text,
|
|
21
28
|
onClick: handlerDecorator(handleHref(props), props),
|
|
22
29
|
});
|
|
@@ -6,7 +6,7 @@ import type { IconProps, Picture } from '../../model/Picture';
|
|
|
6
6
|
* @title Ссылка
|
|
7
7
|
* @required ["text", "href"]
|
|
8
8
|
*/
|
|
9
|
-
export interface
|
|
9
|
+
export interface TopMenuItemProps extends LinkProps {
|
|
10
10
|
/** @hidden */
|
|
11
11
|
items?: LinkProps[];
|
|
12
12
|
}
|
|
@@ -27,7 +27,7 @@ export interface DispositionItem extends LinkProps {
|
|
|
27
27
|
export type ForeignOffice = LinkProps & IconProps;
|
|
28
28
|
|
|
29
29
|
export interface SitemapData {
|
|
30
|
-
topItems?:
|
|
30
|
+
topItems?: TopMenuItemProps[];
|
|
31
31
|
dispositions?: DispositionItem[];
|
|
32
32
|
logo?: LogoType;
|
|
33
33
|
foreignOffices?: ForeignOffice[];
|
|
@@ -2,7 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import type { LinkProps } from '../../model/LinkProps';
|
|
4
4
|
import { useSearch, type SearchResult } from '../../services/search/useSearch';
|
|
5
|
-
import type {
|
|
5
|
+
import type { TopMenuItemProps } from '../../services/sitemap/SitemapData';
|
|
6
6
|
import { joinPath } from '../../utils/url';
|
|
7
7
|
import { zip } from '../../utils/zip';
|
|
8
8
|
import { Dialog } from '../Dialog/Dialog';
|
|
@@ -11,7 +11,7 @@ import { Sitemap } from '../Sitemap/Sitemap';
|
|
|
11
11
|
import { SearchInput } from './SearchInput';
|
|
12
12
|
|
|
13
13
|
export interface SearchDialogProps {
|
|
14
|
-
topItems?:
|
|
14
|
+
topItems?: TopMenuItemProps[];
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export const SEARCH_DIALOG_ID = 'search';
|
|
@@ -44,8 +44,8 @@ export const SearchDialog = JSX<SearchDialogProps>(({ topItems }) => {
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
const combineTopItemsAndSearchResult =
|
|
47
|
-
(topItems:
|
|
48
|
-
(searchResult: SearchResult | null | undefined):
|
|
47
|
+
(topItems: TopMenuItemProps[] | undefined) =>
|
|
48
|
+
(searchResult: SearchResult | null | undefined): TopMenuItemProps[] =>
|
|
49
49
|
topItems?.length && searchResult?.length
|
|
50
50
|
? zip(topItems, searchResult).map(([_, portalSearchResult]) => ({
|
|
51
51
|
..._,
|
|
@@ -56,7 +56,7 @@ const combineTopItemsAndSearchResult =
|
|
|
56
56
|
: [];
|
|
57
57
|
|
|
58
58
|
// Temp
|
|
59
|
-
function printSearchItems(topItems:
|
|
59
|
+
function printSearchItems(topItems: TopMenuItemProps[]) {
|
|
60
60
|
for (const _ of topItems.filter(({ items }) => items?.length)) {
|
|
61
61
|
console.group(_.text);
|
|
62
62
|
console.table(_.items, ['text', 'href']);
|
|
@@ -2,17 +2,16 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useLink } from '../../hooks/useLink';
|
|
3
3
|
import type { LinkProps } from '../../model/LinkProps';
|
|
4
4
|
import { projectSettings } from '../../ProjectSettings';
|
|
5
|
-
import type {
|
|
5
|
+
import type { TopMenuItemProps } from '../../services/sitemap/SitemapData';
|
|
6
6
|
import { style } from '../../utils/style';
|
|
7
|
-
import { joinPath } from '../../utils/url';
|
|
8
7
|
|
|
9
8
|
export interface SitemapProps {
|
|
10
9
|
className?: string;
|
|
11
|
-
topItems?:
|
|
10
|
+
topItems?: TopMenuItemProps[];
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
export const Sitemap = JSX<SitemapProps>(({ className, topItems }) => {
|
|
15
|
-
const link = useLink(true);
|
|
14
|
+
const link = useLink({ isRemote: true });
|
|
16
15
|
|
|
17
16
|
return (
|
|
18
17
|
<div className={style('flex items-start justify-between', className)}>
|
|
@@ -21,7 +20,7 @@ export const Sitemap = JSX<SitemapProps>(({ className, topItems }) => {
|
|
|
21
20
|
);
|
|
22
21
|
});
|
|
23
22
|
|
|
24
|
-
const renderColumn = (menuItem:
|
|
23
|
+
const renderColumn = (menuItem: TopMenuItemProps & { onClick: () => void }, index: number) => {
|
|
25
24
|
const { text, items, href, target, onClick } = menuItem;
|
|
26
25
|
|
|
27
26
|
return (
|
|
@@ -50,7 +49,7 @@ const ColumnItem = JSX<ColumnItemProps>(({ text, index, basePath, ...rest }) =>
|
|
|
50
49
|
const isAnotherPortal =
|
|
51
50
|
projectSettings.BASE_PATH && basePath ? !projectSettings.BASE_PATH.startsWith(basePath) : false;
|
|
52
51
|
|
|
53
|
-
const link = useLink(isAnotherPortal);
|
|
52
|
+
const link = useLink({ isRemote: isAnotherPortal });
|
|
54
53
|
const { href, target, onClick } = link(rest);
|
|
55
54
|
|
|
56
55
|
return (
|
|
@@ -59,7 +58,7 @@ const ColumnItem = JSX<ColumnItemProps>(({ text, index, basePath, ...rest }) =>
|
|
|
59
58
|
'text-l-light text-secondary-text hover:text-primary-main no-underline',
|
|
60
59
|
'overflow-x-hidden overflow-ellipsis whitespace-nowrap',
|
|
61
60
|
)}
|
|
62
|
-
href={
|
|
61
|
+
href={href}
|
|
63
62
|
target={target || '_self'}
|
|
64
63
|
onClick={onClick}
|
|
65
64
|
>
|
|
@@ -15,7 +15,7 @@ export interface TopItemProps extends TopItemContent {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export const TopItem = JSX<TopItemProps>(({ className = '', active, flat, children, ...rest }) => {
|
|
18
|
-
const link = useLink(true);
|
|
18
|
+
const link = useLink({ isRemote: true });
|
|
19
19
|
const { href, target, text, onClick } = link(rest);
|
|
20
20
|
|
|
21
21
|
return (
|