@redneckz/wildless-cms-uni-blocks 0.13.13 → 0.13.14
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 +17 -7
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +18 -15
- package/bundle/components/StickyBottomMenu/ActiveSubMenu.d.ts +1 -0
- package/bundle/components/StickyBottomMenu/ActiveSubMenuItem.d.ts +1 -1
- package/bundle/components/StickyBottomMenu/BurgerMenuDialog.d.ts +1 -1
- package/bundle/components/StickyBottomMenu/RenderItem.d.ts +1 -3
- package/bundle/components/StickyBottomMenu/TopItemMobile.d.ts +3 -2
- package/bundle/hooks/useSWRResource.d.ts +7 -1
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +18 -15
- package/dist/components/Footer/Footer.js +4 -2
- package/dist/components/Footer/Footer.js.map +1 -1
- package/dist/components/Footer/Footer.mobile.js +3 -3
- package/dist/components/Footer/Footer.mobile.js.map +1 -1
- package/dist/components/Header/Header.js +1 -1
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/StickyBottomMenu/ActiveSubMenu.d.ts +1 -0
- package/dist/components/StickyBottomMenu/ActiveSubMenu.js +2 -2
- package/dist/components/StickyBottomMenu/ActiveSubMenu.js.map +1 -1
- package/dist/components/StickyBottomMenu/ActiveSubMenuItem.d.ts +1 -1
- package/dist/components/StickyBottomMenu/ActiveSubMenuItem.js +5 -3
- package/dist/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
- package/dist/components/StickyBottomMenu/BurgerMenuDialog.d.ts +1 -1
- package/dist/components/StickyBottomMenu/BurgerMenuDialog.js +17 -12
- package/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/dist/components/StickyBottomMenu/RenderItem.d.ts +1 -3
- package/dist/components/StickyBottomMenu/RenderItem.js +11 -7
- package/dist/components/StickyBottomMenu/RenderItem.js.map +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/dist/components/StickyBottomMenu/TopItemMobile.d.ts +3 -2
- package/dist/components/StickyBottomMenu/TopItemMobile.js +1 -6
- package/dist/components/StickyBottomMenu/TopItemMobile.js.map +1 -1
- package/dist/components/StickyBottomMenu/renderMenuItems.js +1 -1
- package/dist/components/StickyBottomMenu/renderMenuItems.js.map +1 -1
- package/dist/hooks/useSWRResource.d.ts +7 -1
- package/dist/hooks/useSWRResource.js +8 -2
- package/dist/hooks/useSWRResource.js.map +1 -1
- package/dist/services/sitemap/useSitemap.js +1 -1
- package/dist/services/sitemap/useSitemap.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/useSwipeListScroll.js +5 -1
- package/dist/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +18 -15
- package/lib/components/Footer/Footer.js +4 -2
- package/lib/components/Footer/Footer.js.map +1 -1
- package/lib/components/Footer/Footer.mobile.js +3 -3
- package/lib/components/Footer/Footer.mobile.js.map +1 -1
- package/lib/components/Header/Header.js +1 -1
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/StickyBottomMenu/ActiveSubMenu.d.ts +1 -0
- package/lib/components/StickyBottomMenu/ActiveSubMenu.js +2 -2
- package/lib/components/StickyBottomMenu/ActiveSubMenu.js.map +1 -1
- package/lib/components/StickyBottomMenu/ActiveSubMenuItem.d.ts +1 -1
- package/lib/components/StickyBottomMenu/ActiveSubMenuItem.js +5 -3
- package/lib/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
- package/lib/components/StickyBottomMenu/BurgerMenuDialog.d.ts +1 -1
- package/lib/components/StickyBottomMenu/BurgerMenuDialog.js +17 -12
- package/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/lib/components/StickyBottomMenu/RenderItem.d.ts +1 -3
- package/lib/components/StickyBottomMenu/RenderItem.js +11 -7
- package/lib/components/StickyBottomMenu/RenderItem.js.map +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/lib/components/StickyBottomMenu/TopItemMobile.d.ts +3 -2
- package/lib/components/StickyBottomMenu/TopItemMobile.js +1 -6
- package/lib/components/StickyBottomMenu/TopItemMobile.js.map +1 -1
- package/lib/components/StickyBottomMenu/renderMenuItems.js +1 -1
- package/lib/components/StickyBottomMenu/renderMenuItems.js.map +1 -1
- package/lib/hooks/useSWRResource.d.ts +7 -1
- package/lib/hooks/useSWRResource.js +8 -2
- package/lib/hooks/useSWRResource.js.map +1 -1
- package/lib/services/sitemap/useSitemap.js +1 -1
- package/lib/services/sitemap/useSitemap.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/useSwipeListScroll.js +5 -1
- package/lib/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +124 -111
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +18 -15
- package/mobile/bundle/components/StickyBottomMenu/ActiveSubMenu.d.ts +1 -0
- package/mobile/bundle/components/StickyBottomMenu/ActiveSubMenuItem.d.ts +1 -1
- package/mobile/bundle/components/StickyBottomMenu/BurgerMenuDialog.d.ts +1 -1
- package/mobile/bundle/components/StickyBottomMenu/RenderItem.d.ts +1 -3
- package/mobile/bundle/components/StickyBottomMenu/TopItemMobile.d.ts +3 -2
- package/mobile/bundle/hooks/useSWRResource.d.ts +7 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +18 -15
- package/mobile/dist/components/Footer/Footer.js +3 -3
- package/mobile/dist/components/Footer/Footer.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/ActiveSubMenu.d.ts +1 -0
- package/mobile/dist/components/StickyBottomMenu/ActiveSubMenu.js +2 -2
- package/mobile/dist/components/StickyBottomMenu/ActiveSubMenu.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/ActiveSubMenuItem.d.ts +1 -1
- package/mobile/dist/components/StickyBottomMenu/ActiveSubMenuItem.js +5 -3
- package/mobile/dist/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.d.ts +1 -1
- package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js +17 -12
- package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/RenderItem.d.ts +1 -3
- package/mobile/dist/components/StickyBottomMenu/RenderItem.js +11 -7
- package/mobile/dist/components/StickyBottomMenu/RenderItem.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/TopItemMobile.d.ts +3 -2
- package/mobile/dist/components/StickyBottomMenu/TopItemMobile.js +1 -6
- package/mobile/dist/components/StickyBottomMenu/TopItemMobile.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/renderMenuItems.js +1 -1
- package/mobile/dist/components/StickyBottomMenu/renderMenuItems.js.map +1 -1
- package/mobile/dist/hooks/useSWRResource.d.ts +7 -1
- package/mobile/dist/hooks/useSWRResource.js +8 -2
- package/mobile/dist/hooks/useSWRResource.js.map +1 -1
- package/mobile/dist/services/sitemap/useSitemap.js +1 -1
- package/mobile/dist/services/sitemap/useSitemap.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/useSwipeListScroll.js +5 -1
- package/mobile/dist/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +18 -15
- package/mobile/lib/components/Footer/Footer.js +3 -3
- package/mobile/lib/components/Footer/Footer.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/ActiveSubMenu.d.ts +1 -0
- package/mobile/lib/components/StickyBottomMenu/ActiveSubMenu.js +2 -2
- package/mobile/lib/components/StickyBottomMenu/ActiveSubMenu.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/ActiveSubMenuItem.d.ts +1 -1
- package/mobile/lib/components/StickyBottomMenu/ActiveSubMenuItem.js +5 -3
- package/mobile/lib/components/StickyBottomMenu/ActiveSubMenuItem.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.d.ts +1 -1
- package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js +17 -12
- package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/RenderItem.d.ts +1 -3
- package/mobile/lib/components/StickyBottomMenu/RenderItem.js +11 -7
- package/mobile/lib/components/StickyBottomMenu/RenderItem.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/TopItemMobile.d.ts +3 -2
- package/mobile/lib/components/StickyBottomMenu/TopItemMobile.js +1 -6
- package/mobile/lib/components/StickyBottomMenu/TopItemMobile.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/renderMenuItems.js +1 -1
- package/mobile/lib/components/StickyBottomMenu/renderMenuItems.js.map +1 -1
- package/mobile/lib/hooks/useSWRResource.d.ts +7 -1
- package/mobile/lib/hooks/useSWRResource.js +8 -2
- package/mobile/lib/hooks/useSWRResource.js.map +1 -1
- package/mobile/lib/services/sitemap/useSitemap.js +1 -1
- package/mobile/lib/services/sitemap/useSitemap.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/useSwipeListScroll.js +5 -1
- package/mobile/lib/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +6 -3
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +40 -32
- package/mobile/src/components/Footer/Footer.tsx +3 -3
- package/mobile/src/components/StickyBottomMenu/ActiveSubMenu.tsx +3 -2
- package/mobile/src/components/StickyBottomMenu/ActiveSubMenuItem.tsx +8 -5
- package/mobile/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +27 -15
- package/mobile/src/components/StickyBottomMenu/RenderItem.tsx +14 -11
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenu.tsx +1 -2
- package/mobile/src/components/StickyBottomMenu/TopItemMobile.tsx +12 -24
- package/mobile/src/components/StickyBottomMenu/renderMenuItems.tsx +1 -1
- package/mobile/src/hooks/useSWRResource.ts +19 -6
- package/mobile/src/services/sitemap/useSitemap.ts +1 -1
- package/mobile/src/ui-kit/SwipeListControl/useSwipeListScroll.ts +6 -2
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationForm.example.json +6 -3
- package/src/components/ApplicationForm/ApplicationFormContent.ts +40 -32
- package/src/components/Footer/Footer.mobile.tsx +3 -3
- package/src/components/Footer/Footer.tsx +4 -5
- package/src/components/Header/Header.tsx +1 -2
- package/src/components/StickyBottomMenu/ActiveSubMenu.tsx +3 -2
- package/src/components/StickyBottomMenu/ActiveSubMenuItem.tsx +8 -5
- package/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +27 -15
- package/src/components/StickyBottomMenu/RenderItem.tsx +14 -11
- package/src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx +1 -2
- package/src/components/StickyBottomMenu/TopItemMobile.tsx +12 -24
- package/src/components/StickyBottomMenu/renderMenuItems.tsx +1 -1
- package/src/hooks/useSWRResource.ts +19 -6
- package/src/icons/IconName.ts +2 -2
- package/src/services/sitemap/useSitemap.ts +1 -1
- package/src/ui-kit/SwipeListControl/useSwipeListScroll.ts +6 -2
|
@@ -28,8 +28,7 @@ export const Header = JSX<HeaderProps>(
|
|
|
28
28
|
|
|
29
29
|
const { internetBankUrl } = useSWRResource<SitemapData>(
|
|
30
30
|
projectSettings.PORTAL_DATA || 'portal-data',
|
|
31
|
-
{},
|
|
32
|
-
'portal-resources',
|
|
31
|
+
{ folderName: 'portal-resources', setBasePath: true },
|
|
33
32
|
);
|
|
34
33
|
|
|
35
34
|
return (
|
|
@@ -4,12 +4,13 @@ import { ActiveSubMenuItem } from './ActiveSubMenuItem';
|
|
|
4
4
|
|
|
5
5
|
interface ActiveSubMenuProps {
|
|
6
6
|
activeMenuSubItems?: LinkProps[];
|
|
7
|
+
basePath?: string;
|
|
7
8
|
}
|
|
8
|
-
export const ActiveSubMenu = JSX<ActiveSubMenuProps>(({ activeMenuSubItems }) => {
|
|
9
|
+
export const ActiveSubMenu = JSX<ActiveSubMenuProps>(({ activeMenuSubItems, basePath }) => {
|
|
9
10
|
return activeMenuSubItems ? (
|
|
10
11
|
<div className="mb-5">
|
|
11
12
|
{activeMenuSubItems.map((_, i) => (
|
|
12
|
-
<ActiveSubMenuItem item={_}
|
|
13
|
+
<ActiveSubMenuItem item={_} key={String(i)} basePath={basePath} />
|
|
13
14
|
))}
|
|
14
15
|
</div>
|
|
15
16
|
) : null;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import
|
|
2
|
+
import { projectSettings } from '../../ProjectSettings';
|
|
3
3
|
import { useLink } from '../../hooks/useLink';
|
|
4
|
+
import type { LinkProps } from '../../model/LinkProps';
|
|
4
5
|
import { Img } from '../../ui-kit/Img/Img';
|
|
5
6
|
|
|
6
7
|
interface ActiveSubMenuItemProps {
|
|
7
8
|
item: LinkProps;
|
|
8
|
-
|
|
9
|
+
basePath?: string;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
export const ActiveSubMenuItem = JSX<ActiveSubMenuItemProps>(({ item,
|
|
12
|
-
const
|
|
12
|
+
export const ActiveSubMenuItem = JSX<ActiveSubMenuItemProps>(({ item, basePath }) => {
|
|
13
|
+
const isAnotherPortal =
|
|
14
|
+
projectSettings.BASE_PATH && basePath ? !projectSettings.BASE_PATH.startsWith(basePath) : false;
|
|
15
|
+
|
|
16
|
+
const link = useLink({ isRemote: isAnotherPortal, basePath });
|
|
13
17
|
const { href, target, onClick } = link(item);
|
|
14
18
|
|
|
15
19
|
return (
|
|
16
20
|
<a
|
|
17
|
-
key={`subItems-${String(i)}`}
|
|
18
21
|
className="py-3 text-h5 font-light flex justify-between cursor-pointer"
|
|
19
22
|
href={href}
|
|
20
23
|
target={target}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback, useEffect, useMemo, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import type { RefObject } from 'react';
|
|
4
|
+
import { useActiveRoute } from '../../hooks/useActiveRoute';
|
|
2
5
|
import { useLocation } from '../../hooks/useLocation';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useCallback, useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
6
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
7
|
+
import { useSitemap } from '../../services/sitemap/useSitemap';
|
|
8
|
+
import { Dialog } from '../../ui-kit/DialogManager/Dialog';
|
|
7
9
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
10
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
8
11
|
import { useLocationDialog } from '../../ui-kit/LocationDialog/useLocationDialog';
|
|
12
|
+
import { SearchBar } from '../../ui-kit/SearchBar/SearchBar';
|
|
9
13
|
import { SwipeListContainer } from '../../ui-kit/SwipeListControl/SwipeListContainer';
|
|
10
14
|
import { useSwipeListScroll } from '../../ui-kit/SwipeListControl/useSwipeListScroll';
|
|
11
|
-
import {
|
|
12
|
-
import { TopItemMobile } from './TopItemMobile';
|
|
15
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
13
16
|
import { ActiveSubMenu } from './ActiveSubMenu';
|
|
14
|
-
import {
|
|
15
|
-
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
16
|
-
import type { RefObject } from 'react';
|
|
17
|
-
import { useActiveRoute } from '../../hooks/useActiveRoute';
|
|
17
|
+
import { TopItemMobile } from './TopItemMobile';
|
|
18
18
|
|
|
19
19
|
interface BurgerMenuDialogProps extends UniBlockProps {
|
|
20
20
|
containerRef?: RefObject<HTMLDivElement>;
|
|
@@ -25,19 +25,26 @@ export const BurgerMenuDialog = JSX<BurgerMenuDialogProps>((props) => {
|
|
|
25
25
|
const [location] = useLocation(defaultLocation);
|
|
26
26
|
const locationDialog = useLocationDialog();
|
|
27
27
|
const openLocationDialog = useCallback(() => locationDialog.open(), []);
|
|
28
|
-
const itemCount = Array.isArray(topItems) ? topItems.length : 0;
|
|
29
28
|
const [containerRef, scroll] = useSwipeListScroll<HTMLDivElement>({
|
|
30
|
-
itemCount,
|
|
29
|
+
itemCount: topItems?.length ?? 0,
|
|
31
30
|
});
|
|
32
|
-
const [
|
|
31
|
+
const [activeIndex] = useActiveRoute(topItems);
|
|
32
|
+
const [activeTopItemIndex, setActiveTopItemIndex] = useState(activeIndex);
|
|
33
|
+
const activeRoute = useMemo(() => topItems?.[activeTopItemIndex], [topItems, activeTopItemIndex]);
|
|
33
34
|
const activeMenuSubItems = activeRoute?.items || [];
|
|
34
35
|
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
setActiveTopItemIndex(activeIndex);
|
|
38
|
+
}, [activeIndex]);
|
|
39
|
+
|
|
35
40
|
useEffect(() => {
|
|
36
41
|
if (activeTopItemIndex > 0) {
|
|
37
42
|
scroll.scrollTo(activeTopItemIndex);
|
|
38
43
|
}
|
|
39
44
|
}, [activeTopItemIndex, scroll]);
|
|
40
45
|
|
|
46
|
+
const handleTopItemClick = useCallback((idx: number) => setActiveTopItemIndex(idx), []);
|
|
47
|
+
|
|
41
48
|
return (
|
|
42
49
|
<Dialog
|
|
43
50
|
head={
|
|
@@ -55,12 +62,17 @@ export const BurgerMenuDialog = JSX<BurgerMenuDialogProps>((props) => {
|
|
|
55
62
|
className="pb-3"
|
|
56
63
|
>
|
|
57
64
|
{topItems?.map((item, i) => (
|
|
58
|
-
<TopItemMobile
|
|
65
|
+
<TopItemMobile
|
|
66
|
+
item={item}
|
|
67
|
+
key={String(i)}
|
|
68
|
+
isActive={activeTopItemIndex === i}
|
|
69
|
+
onClick={() => handleTopItemClick(i)}
|
|
70
|
+
/>
|
|
59
71
|
))}
|
|
60
72
|
</SwipeListContainer>
|
|
61
73
|
</div>
|
|
62
74
|
<div className="relative grow overflow-auto">
|
|
63
|
-
<ActiveSubMenu activeMenuSubItems={activeMenuSubItems} />
|
|
75
|
+
<ActiveSubMenu activeMenuSubItems={activeMenuSubItems} basePath={activeRoute?.href} />
|
|
64
76
|
<SearchBar className="grow mb-5" />
|
|
65
77
|
{renderOfficeLink(officesLink)}
|
|
66
78
|
<div className="flex items-center text-s cursor-pointer" onClick={openLocationDialog}>
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import
|
|
3
|
-
import { style } from '../../utils/style';
|
|
4
|
-
import { Img } from '../../ui-kit/Img/Img';
|
|
2
|
+
import { projectSettings } from '../../ProjectSettings';
|
|
5
3
|
import { useLink } from '../../hooks/useLink';
|
|
6
|
-
import
|
|
4
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
5
|
+
import { style } from '../../utils/style';
|
|
6
|
+
import type { MenuItemProps } from './StickyBottomMenuProps';
|
|
7
7
|
|
|
8
|
-
interface RenderItemProps
|
|
8
|
+
interface RenderItemProps {
|
|
9
9
|
item: MenuItemProps;
|
|
10
|
-
idx: number;
|
|
11
10
|
onClick?: () => void;
|
|
12
11
|
}
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
|
|
13
|
+
export const RenderItem = JSX<RenderItemProps>(({ item, onClick }) => {
|
|
14
|
+
const isAnotherPortal = projectSettings?.BASE_PATH
|
|
15
|
+
? !item.url?.startsWith(projectSettings?.BASE_PATH)
|
|
16
|
+
: true;
|
|
17
|
+
|
|
18
|
+
const link = useLink({ isRemote: isAnotherPortal });
|
|
15
19
|
const {
|
|
16
20
|
href,
|
|
17
21
|
target,
|
|
@@ -23,7 +27,6 @@ export const RenderItem = JSX<RenderItemProps>(({ item, idx, onClick }) => {
|
|
|
23
27
|
|
|
24
28
|
return (
|
|
25
29
|
<a
|
|
26
|
-
key={`menuItems-${String(idx)}`}
|
|
27
30
|
className={style(
|
|
28
31
|
item.isActive ? 'text-primary-main' : 'text-primary-text',
|
|
29
32
|
`w-10 m-4 flex justify-center items-center flex-col text-[10px] cursor-pointer`,
|
|
@@ -35,8 +38,8 @@ export const RenderItem = JSX<RenderItemProps>(({ item, idx, onClick }) => {
|
|
|
35
38
|
<Img
|
|
36
39
|
className="w-6 h-6"
|
|
37
40
|
image={{
|
|
38
|
-
icon: item
|
|
39
|
-
iconVersion: item
|
|
41
|
+
icon: item?.icon?.icon,
|
|
42
|
+
iconVersion: item?.icon?.iconVersion || 'black',
|
|
40
43
|
}}
|
|
41
44
|
/>
|
|
42
45
|
{item.title}
|
|
@@ -10,8 +10,7 @@ import { useBurgerMenuDialog } from './useBurgerMenuDialog';
|
|
|
10
10
|
export const StickyBottomMenu = JSX<StickyBottomMenuProps>(({ ...rest }) => {
|
|
11
11
|
const { menuItems = [] } = useSWRResource<StickyBottomMenuProps>(
|
|
12
12
|
projectSettings.STICKY_MOBILE_MENU || 'sticky-mobile-menu',
|
|
13
|
-
rest.options?.page?.fallback,
|
|
14
|
-
'portal-resources',
|
|
13
|
+
{ fallback: rest.options?.page?.fallback, folderName: 'portal-resources', setBasePath: true },
|
|
15
14
|
);
|
|
16
15
|
|
|
17
16
|
const [isBurgerMenuDialogOpen, { toggle }] = useBurgerMenuDialog();
|
|
@@ -1,32 +1,20 @@
|
|
|
1
1
|
import type { TopMenuItemProps } from '../../services/sitemap/SitemapData';
|
|
2
|
+
import { PreventableEvent } from '../../ui-kit/PreventableEvent';
|
|
2
3
|
import { style } from '../../utils/style';
|
|
3
|
-
import { useLink } from '../../hooks/useLink';
|
|
4
4
|
|
|
5
5
|
interface TopItemProps {
|
|
6
6
|
item: TopMenuItemProps;
|
|
7
|
-
i: number;
|
|
8
7
|
isActive: boolean;
|
|
8
|
+
onClick: (ev?: PreventableEvent) => void;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const TopItemMobile = ({ item,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
className="relative"
|
|
22
|
-
aria-label={item.text}
|
|
23
|
-
>
|
|
24
|
-
<span className={style('whitespace-nowrap', isActive ? 'text-primary-main' : '')}>
|
|
25
|
-
{item.text}
|
|
26
|
-
</span>
|
|
27
|
-
{isActive ? (
|
|
28
|
-
<div className="absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent" />
|
|
29
|
-
) : null}
|
|
30
|
-
</a>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
11
|
+
export const TopItemMobile = ({ item, isActive, onClick }: TopItemProps) => (
|
|
12
|
+
<button type="button" onClick={onClick}>
|
|
13
|
+
<span className={style('whitespace-nowrap', isActive ? 'text-primary-main' : '')}>
|
|
14
|
+
{item.text}
|
|
15
|
+
</span>
|
|
16
|
+
{isActive ? (
|
|
17
|
+
<div className="absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent" />
|
|
18
|
+
) : null}
|
|
19
|
+
</button>
|
|
20
|
+
);
|
|
@@ -6,7 +6,7 @@ export const renderMenuItems = (menuItems: MenuItemProps[], onClick?: () => void
|
|
|
6
6
|
<BlockWrapper className="sticky bottom-0 left-0 right-0 bg-transparent z-[100]" padding="p-0">
|
|
7
7
|
<div className="ml-auto container bg-white flex justify-center shadow-blue-gray">
|
|
8
8
|
{menuItems.map((_, i) => (
|
|
9
|
-
<RenderItem item={_}
|
|
9
|
+
<RenderItem item={_} key={String(i)} onClick={onClick} />
|
|
10
10
|
))}
|
|
11
11
|
</div>
|
|
12
12
|
</BlockWrapper>
|
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
2
|
+
import { projectSettings } from '../ProjectSettings';
|
|
2
3
|
import type { Fallback } from '../model/Fallback';
|
|
3
4
|
import { fetchJSONUnsafe } from '../utils/fetchJSON';
|
|
5
|
+
import { joinPath } from '../utils/url';
|
|
4
6
|
|
|
5
7
|
const EMPTY_VALUE = {};
|
|
6
8
|
const DEFAULT_FOLDER_NAME = 'wcms-resources';
|
|
7
9
|
|
|
10
|
+
interface SWRResourceOptions {
|
|
11
|
+
fallback?: Fallback;
|
|
12
|
+
folderName?: string;
|
|
13
|
+
setBasePath?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
8
16
|
export function useSWRResource<Data>(
|
|
9
17
|
filename: string | null | undefined,
|
|
10
|
-
|
|
11
|
-
folderName: string = DEFAULT_FOLDER_NAME,
|
|
18
|
+
options: SWRResourceOptions = {},
|
|
12
19
|
): Data {
|
|
13
|
-
const {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
const { fallback = EMPTY_VALUE, folderName = DEFAULT_FOLDER_NAME, setBasePath = false } = options;
|
|
21
|
+
|
|
22
|
+
const path = joinPath(
|
|
23
|
+
setBasePath ? projectSettings.BASE_PATH : '',
|
|
24
|
+
folderName,
|
|
25
|
+
`${filename}.json`,
|
|
17
26
|
);
|
|
18
27
|
|
|
28
|
+
const { data } = useAsyncData<Data, any, string | null>(filename ? path : null, fetchJSONUnsafe, {
|
|
29
|
+
fallback,
|
|
30
|
+
});
|
|
31
|
+
|
|
19
32
|
return data || (EMPTY_VALUE as Data);
|
|
20
33
|
}
|
package/src/icons/IconName.ts
CHANGED
|
@@ -233,7 +233,7 @@ export enum IconTitleMap {
|
|
|
233
233
|
GridIcon = 'Сетка (белая)',
|
|
234
234
|
HeadphonesIcon = 'HeadphonesIcon',
|
|
235
235
|
HeartIcon = 'Сердце',
|
|
236
|
-
HouseIcon = '
|
|
236
|
+
HouseIcon = 'Ипотека',
|
|
237
237
|
HuaweiIcon = 'Лого «Huawei»',
|
|
238
238
|
InterestGrowthIcon = 'Диаграмма роста',
|
|
239
239
|
InterestIcon = 'Скидка',
|
|
@@ -297,7 +297,7 @@ export enum IconTitleMap {
|
|
|
297
297
|
* @title Иконка
|
|
298
298
|
* @enumNames [
|
|
299
299
|
* "",
|
|
300
|
-
* 'Деньги', 'Самолёт', 'Лого «Apple»', 'Стрелка \'Вниз\'', 'Стрелка сплошная \'Вниз\'', 'Стрелка \'Влево\'', 'Стрелка \'Вправо\'', 'Стрелка \'Вверх-право\'', 'Стрелка \'Вверх\'', 'Стрелка сплошная \'Вверх\'', 'Банкомат', 'Сумка', 'Банк', 'Белорусский флаг', 'BriefcaseIcon', 'Здание с деревом', 'Бургер', 'Календарь 2', 'Скруглённый календарь', 'Календарь', 'Календарь с галочкой', 'Машина2', 'Кред. карта', 'Кред. карта под наклоном', 'Кред. карта с галочкой', 'Карта с драгоценностями', 'Машина', 'Инвестиции', 'Деньги внутри кошелька', 'Стрелка \'Влево\'', 'Кинотеатр', 'Клиент', 'Часы', 'Крестик', 'Кресло', 'Здание суда', 'Кредитные карты', 'Скидка', 'Скачать документ', 'Документ', 'Документ (одноцветный)', 'Документы', 'Документы-2', 'Документ с текстом', 'Доллар', 'Зелёная \'галочка\' в круге', 'Зелёная \'галочка\'', 'Земля', 'Пустой кошелёк с возвратом', 'Пустой кошелёк', 'Евро', 'FullScreenIcon', 'Геолокация', 'Зеркало', 'Глобус', 'Gps', 'Сетка (белая)', 'HeadphonesIcon', 'Сердце', '
|
|
300
|
+
* 'Деньги', 'Самолёт', 'Лого «Apple»', 'Стрелка \'Вниз\'', 'Стрелка сплошная \'Вниз\'', 'Стрелка \'Влево\'', 'Стрелка \'Вправо\'', 'Стрелка \'Вверх-право\'', 'Стрелка \'Вверх\'', 'Стрелка сплошная \'Вверх\'', 'Банкомат', 'Сумка', 'Банк', 'Белорусский флаг', 'BriefcaseIcon', 'Здание с деревом', 'Бургер', 'Календарь 2', 'Скруглённый календарь', 'Календарь', 'Календарь с галочкой', 'Машина2', 'Кред. карта', 'Кред. карта под наклоном', 'Кред. карта с галочкой', 'Карта с драгоценностями', 'Машина', 'Инвестиции', 'Деньги внутри кошелька', 'Стрелка \'Влево\'', 'Кинотеатр', 'Клиент', 'Часы', 'Крестик', 'Кресло', 'Здание суда', 'Кредитные карты', 'Скидка', 'Скачать документ', 'Документ', 'Документ (одноцветный)', 'Документы', 'Документы-2', 'Документ с текстом', 'Доллар', 'Зелёная \'галочка\' в круге', 'Зелёная \'галочка\'', 'Земля', 'Пустой кошелёк с возвратом', 'Пустой кошелёк', 'Евро', 'FullScreenIcon', 'Геолокация', 'Зеркало', 'Глобус', 'Gps', 'Сетка (белая)', 'HeadphonesIcon', 'Сердце', 'Ипотека', 'Лого «Huawei»', 'Диаграмма роста', 'Скидка', 'JCB', 'Logo', 'Лупа', 'E-mail', 'Маркер карты', 'Маркер карты РСХБ', 'Иконка Развёрнутая карта', 'MasterCard', 'Лого Метро', 'Минус', 'МИР', 'Деньги', 'Денежное страхование', 'Купюры', 'Монитор и мобильный', 'Новый документ', 'Офис', 'Лого «Одноклассники»', 'Пачка бумаги А4', 'Бизнес', 'Проценты (круг.)', 'Проценты', 'PercentIcon', 'Персональная карта', 'Телефон', 'Лого «PlayMarket»', 'Плюс', 'Щит', 'Профиль, 2 персоны', 'Профиль', 'Тыква', 'Ошибка', 'Ок', 'Рубль (круг.)', 'Сейф', 'Безопасность', 'Подписанные документы', 'Маленькие часы', 'Звук', 'Ящик с замочной скважиной', 'Лого «Telegram»', 'UnionPay', 'UserGeoLocationIcon', 'Пользователь в рамке', 'Пользователь', 'Visa', 'Лого «VK»', 'Пополнение карты', 'Кошелёк с плюсом', 'Кошелёк', 'Кошелёк с деньгами', 'Добавить продукт', 'Лого «Youtube»'
|
|
301
301
|
* ]
|
|
302
302
|
*/
|
|
303
303
|
export type IconName =
|
|
@@ -4,4 +4,4 @@ import { projectSettings } from '../../ProjectSettings';
|
|
|
4
4
|
import type { SitemapData } from './SitemapData';
|
|
5
5
|
|
|
6
6
|
export const useSitemap = (fallback?: Fallback) =>
|
|
7
|
-
useSWRResource<SitemapData>(projectSettings.SITEMAP || 'sitemap', fallback);
|
|
7
|
+
useSWRResource<SitemapData>(projectSettings.SITEMAP || 'sitemap', { fallback });
|
|
@@ -70,9 +70,13 @@ export const useSwipeListScroll = <E extends HTMLElement>({
|
|
|
70
70
|
}, [itemCount, canScrollRight]);
|
|
71
71
|
|
|
72
72
|
const scrollTo = useCallback(
|
|
73
|
-
(idx) => {
|
|
73
|
+
(idx: number) => {
|
|
74
74
|
if (containerRef?.current) {
|
|
75
|
-
containerRef.current.children[idx]?.scrollIntoView(
|
|
75
|
+
containerRef.current.children[idx]?.scrollIntoView({
|
|
76
|
+
behavior: 'smooth',
|
|
77
|
+
block: 'nearest',
|
|
78
|
+
inline: 'center',
|
|
79
|
+
});
|
|
76
80
|
}
|
|
77
81
|
},
|
|
78
82
|
[containerRef],
|