@redneckz/wildless-cms-uni-blocks 0.7.6 → 0.7.8
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/bin/migration-scripts/0.7.8.js +29 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +115 -71
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +5 -9
- package/bundle/components/Footer/MediaButton.d.ts +3 -4
- package/bundle/components/Footer/SocialMedia.d.ts +2 -3
- package/bundle/components/Header/HeaderChatBotButton.d.ts +11 -0
- package/bundle/components/Header/HeaderContent.d.ts +6 -1
- package/bundle/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/bundle/components/Header/HeaderSecondaryMenuButton.d.ts +7 -2
- package/bundle/components/Header/useChatBot.d.ts +2 -0
- package/bundle/components/PictureText/renderBenefit.d.ts +4 -0
- package/bundle/hooks/useBool.d.ts +9 -0
- package/bundle/icons/IconName.d.ts +4 -2
- package/bundle/model/ButtonVersion.d.ts +2 -2
- package/bundle/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/cosmos-static/icons/HeadphonesIcon.svg +1 -0
- package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
- package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCard.js +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +2 -2
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +5 -9
- package/dist/components/Footer/Footer.js +2 -2
- package/dist/components/Footer/Footer.js.map +1 -1
- package/dist/components/Footer/Footer.mobile.js.map +1 -1
- package/dist/components/Footer/MediaButton.d.ts +3 -4
- package/dist/components/Footer/MediaButton.js +4 -5
- package/dist/components/Footer/MediaButton.js.map +1 -1
- package/dist/components/Footer/SocialMedia.d.ts +2 -3
- package/dist/components/Footer/SocialMedia.js +1 -1
- package/dist/components/Footer/SocialMedia.js.map +1 -1
- package/dist/components/Header/DropdownMenu.js +3 -2
- package/dist/components/Header/DropdownMenu.js.map +1 -1
- package/dist/components/Header/Header.js +3 -2
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/HeaderChatBotButton.d.ts +11 -0
- package/dist/components/Header/HeaderChatBotButton.js +19 -0
- package/dist/components/Header/HeaderChatBotButton.js.map +1 -0
- package/dist/components/Header/HeaderContent.d.ts +6 -1
- package/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/dist/components/Header/HeaderSecondaryMenu.js +6 -11
- package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/dist/components/Header/HeaderSecondaryMenuButton.d.ts +7 -2
- package/dist/components/Header/HeaderSecondaryMenuButton.js +5 -1
- package/dist/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- package/dist/components/Header/useChatBot.d.ts +2 -0
- package/dist/components/Header/useChatBot.js +15 -0
- package/dist/components/Header/useChatBot.js.map +1 -0
- package/dist/components/PictureText/PictureText.js +2 -3
- package/dist/components/PictureText/PictureText.js.map +1 -1
- package/dist/components/PictureText/renderBenefit.d.ts +4 -0
- package/dist/components/PictureText/renderBenefit.js +25 -0
- package/dist/components/PictureText/renderBenefit.js.map +1 -0
- package/dist/components/ProductTile/renderBenefit.js +1 -1
- package/dist/components/ProductTile/renderBenefit.js.map +1 -1
- package/dist/hooks/useBool.d.ts +9 -0
- package/dist/hooks/useBool.js +12 -0
- package/dist/hooks/useBool.js.map +1 -0
- package/dist/icons/IconName.d.ts +4 -2
- package/dist/icons/IconName.js +3 -1
- package/dist/icons/IconName.js.map +1 -1
- package/dist/model/ButtonVersion.d.ts +2 -2
- package/dist/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/dist/ui-kit/Button/buttonClassNameConstants.js +3 -0
- package/dist/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
- package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCard.js +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +2 -2
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +5 -9
- package/lib/components/Footer/Footer.js +2 -2
- package/lib/components/Footer/Footer.js.map +1 -1
- package/lib/components/Footer/Footer.mobile.js.map +1 -1
- package/lib/components/Footer/MediaButton.d.ts +3 -4
- package/lib/components/Footer/MediaButton.js +4 -5
- package/lib/components/Footer/MediaButton.js.map +1 -1
- package/lib/components/Footer/SocialMedia.d.ts +2 -3
- package/lib/components/Footer/SocialMedia.js +1 -1
- package/lib/components/Footer/SocialMedia.js.map +1 -1
- package/lib/components/Header/DropdownMenu.js +3 -2
- package/lib/components/Header/DropdownMenu.js.map +1 -1
- package/lib/components/Header/Header.js +3 -2
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/HeaderChatBotButton.d.ts +11 -0
- package/lib/components/Header/HeaderChatBotButton.js +17 -0
- package/lib/components/Header/HeaderChatBotButton.js.map +1 -0
- package/lib/components/Header/HeaderContent.d.ts +6 -1
- package/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/lib/components/Header/HeaderSecondaryMenu.js +6 -11
- package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/lib/components/Header/HeaderSecondaryMenuButton.d.ts +7 -2
- package/lib/components/Header/HeaderSecondaryMenuButton.js +5 -1
- package/lib/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- package/lib/components/Header/useChatBot.d.ts +2 -0
- package/lib/components/Header/useChatBot.js +12 -0
- package/lib/components/Header/useChatBot.js.map +1 -0
- package/lib/components/PictureText/PictureText.fixture.d.ts +2 -0
- package/lib/components/PictureText/PictureText.js +1 -2
- package/lib/components/PictureText/PictureText.js.map +1 -1
- package/lib/components/PictureText/renderBenefit.d.ts +4 -0
- package/lib/components/PictureText/renderBenefit.js +22 -0
- package/lib/components/PictureText/renderBenefit.js.map +1 -0
- package/lib/components/ProductTile/renderBenefit.js +1 -1
- package/lib/components/ProductTile/renderBenefit.js.map +1 -1
- package/lib/hooks/useBool.d.ts +9 -0
- package/lib/hooks/useBool.js +9 -0
- package/lib/hooks/useBool.js.map +1 -0
- package/lib/icons/IconName.d.ts +4 -2
- package/lib/icons/IconName.js +3 -1
- package/lib/icons/IconName.js.map +1 -1
- package/lib/model/ButtonVersion.d.ts +2 -2
- package/lib/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/lib/ui-kit/Button/buttonClassNameConstants.js +3 -0
- package/lib/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +7 -5
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +5 -9
- package/mobile/bundle/components/Footer/MediaButton.d.ts +3 -4
- package/mobile/bundle/components/Header/HeaderChatBotButton.d.ts +11 -0
- package/mobile/bundle/components/Header/HeaderContent.d.ts +6 -1
- package/mobile/bundle/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/mobile/bundle/components/Header/HeaderSecondaryMenuButton.d.ts +7 -2
- package/mobile/bundle/components/Header/useChatBot.d.ts +2 -0
- package/mobile/bundle/components/PictureText/renderBenefit.d.ts +4 -0
- package/mobile/bundle/hooks/useBool.d.ts +9 -0
- package/mobile/bundle/icons/IconName.d.ts +4 -2
- package/mobile/bundle/model/ButtonVersion.d.ts +2 -2
- package/mobile/bundle/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
- package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +2 -2
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +5 -9
- package/mobile/dist/components/Footer/Footer.js.map +1 -1
- package/mobile/dist/components/Footer/MediaButton.d.ts +3 -4
- package/mobile/dist/components/Footer/MediaButton.js +4 -5
- package/mobile/dist/components/Footer/MediaButton.js.map +1 -1
- package/mobile/dist/components/Header/DropdownMenu.js +3 -2
- package/mobile/dist/components/Header/DropdownMenu.js.map +1 -1
- package/mobile/dist/components/Header/HeaderChatBotButton.d.ts +11 -0
- package/mobile/dist/components/Header/HeaderChatBotButton.js +19 -0
- package/mobile/dist/components/Header/HeaderChatBotButton.js.map +1 -0
- package/mobile/dist/components/Header/HeaderContent.d.ts +6 -1
- package/mobile/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js +6 -11
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/dist/components/Header/HeaderSecondaryMenuButton.d.ts +7 -2
- package/mobile/dist/components/Header/HeaderSecondaryMenuButton.js +5 -1
- package/mobile/dist/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- package/mobile/dist/components/Header/useChatBot.d.ts +2 -0
- package/mobile/dist/components/Header/useChatBot.js +15 -0
- package/mobile/dist/components/Header/useChatBot.js.map +1 -0
- package/mobile/dist/components/PictureText/PictureText.js +2 -3
- package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
- package/mobile/dist/components/PictureText/renderBenefit.d.ts +4 -0
- package/mobile/dist/components/PictureText/renderBenefit.js +25 -0
- package/mobile/dist/components/PictureText/renderBenefit.js.map +1 -0
- package/mobile/dist/components/ProductTile/renderBenefit.js +1 -1
- package/mobile/dist/components/ProductTile/renderBenefit.js.map +1 -1
- package/mobile/dist/hooks/useBool.d.ts +9 -0
- package/mobile/dist/hooks/useBool.js +12 -0
- package/mobile/dist/hooks/useBool.js.map +1 -0
- package/mobile/dist/icons/IconName.d.ts +4 -2
- package/mobile/dist/icons/IconName.js +3 -1
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/model/ButtonVersion.d.ts +2 -2
- package/mobile/dist/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/mobile/dist/ui-kit/Button/buttonClassNameConstants.js +3 -0
- package/mobile/dist/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
- package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
- package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCard.js.map +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +2 -2
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +5 -9
- package/mobile/lib/components/Footer/Footer.js.map +1 -1
- package/mobile/lib/components/Footer/MediaButton.d.ts +3 -4
- package/mobile/lib/components/Footer/MediaButton.js +4 -5
- package/mobile/lib/components/Footer/MediaButton.js.map +1 -1
- package/mobile/lib/components/Header/DropdownMenu.js +3 -2
- package/mobile/lib/components/Header/DropdownMenu.js.map +1 -1
- package/mobile/lib/components/Header/HeaderChatBotButton.d.ts +11 -0
- package/mobile/lib/components/Header/HeaderChatBotButton.js +17 -0
- package/mobile/lib/components/Header/HeaderChatBotButton.js.map +1 -0
- package/mobile/lib/components/Header/HeaderContent.d.ts +6 -1
- package/mobile/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -0
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js +6 -11
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/lib/components/Header/HeaderSecondaryMenuButton.d.ts +7 -2
- package/mobile/lib/components/Header/HeaderSecondaryMenuButton.js +5 -1
- package/mobile/lib/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- package/mobile/lib/components/Header/useChatBot.d.ts +2 -0
- package/mobile/lib/components/Header/useChatBot.js +12 -0
- package/mobile/lib/components/Header/useChatBot.js.map +1 -0
- package/mobile/lib/components/PictureText/PictureText.js +1 -2
- package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
- package/mobile/lib/components/PictureText/renderBenefit.d.ts +4 -0
- package/mobile/lib/components/PictureText/renderBenefit.js +22 -0
- package/mobile/lib/components/PictureText/renderBenefit.js.map +1 -0
- package/mobile/lib/components/ProductTile/renderBenefit.js +1 -1
- package/mobile/lib/components/ProductTile/renderBenefit.js.map +1 -1
- package/mobile/lib/hooks/useBool.d.ts +9 -0
- package/mobile/lib/hooks/useBool.js +9 -0
- package/mobile/lib/hooks/useBool.js.map +1 -0
- package/mobile/lib/icons/IconName.d.ts +4 -2
- package/mobile/lib/icons/IconName.js +3 -1
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/model/ButtonVersion.d.ts +2 -2
- package/mobile/lib/ui-kit/BenefitItem/BenefitItemProps.d.ts +26 -3
- package/mobile/lib/ui-kit/Button/buttonClassNameConstants.js +3 -0
- package/mobile/lib/ui-kit/Button/buttonClassNameConstants.js.map +1 -1
- package/mobile/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +0 -1
- package/mobile/src/components/CarouselProductCard/CarouselProductCard.tsx +0 -1
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +6 -3
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +2 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +7 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +5 -9
- package/mobile/src/components/Footer/Footer.tsx +1 -1
- package/mobile/src/components/Footer/MediaButton.tsx +19 -17
- package/mobile/src/components/Header/DropdownMenu.tsx +7 -5
- package/mobile/src/components/Header/HeaderChatBotButton.tsx +45 -0
- package/mobile/src/components/Header/HeaderContent.ts +7 -1
- package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +20 -30
- package/mobile/src/components/Header/HeaderSecondaryMenuButton.tsx +24 -5
- package/mobile/src/components/Header/useChatBot.ts +16 -0
- package/mobile/src/components/PictureText/PictureText.tsx +1 -14
- package/mobile/src/components/PictureText/PictureText.ui.json +10 -0
- package/mobile/src/components/PictureText/renderBenefit.tsx +33 -0
- package/mobile/src/components/ProductTile/renderBenefit.tsx +5 -1
- package/mobile/src/hooks/useBool.ts +19 -0
- package/mobile/src/icons/HeadphonesIcon.svg +5 -0
- package/mobile/src/icons/IconName.ts +5 -5
- package/mobile/src/model/ButtonVersion.ts +9 -2
- package/mobile/src/ui-kit/BenefitItem/BenefitItemProps.ts +28 -3
- package/mobile/src/ui-kit/Button/buttonClassNameConstants.ts +3 -0
- package/mobile/src/ui-kit/Img/ImgProps.ts +1 -0
- package/package.json +1 -1
- package/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +0 -1
- package/src/components/CarouselProductCard/CarouselProductCard.tsx +0 -1
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +6 -3
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +20 -5
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +2 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +7 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +5 -9
- package/src/components/Footer/Footer.mobile.tsx +1 -1
- package/src/components/Footer/Footer.tsx +2 -2
- package/src/components/Footer/MediaButton.tsx +19 -17
- package/src/components/Footer/SocialMedia.tsx +4 -5
- package/src/components/Header/DropdownMenu.tsx +7 -5
- package/src/components/Header/Header.fixture.tsx +3 -3
- package/src/components/Header/Header.tsx +13 -5
- package/src/components/Header/HeaderChatBotButton.tsx +45 -0
- package/src/components/Header/HeaderContent.ts +7 -1
- package/src/components/Header/HeaderSecondaryMenu.tsx +20 -30
- package/src/components/Header/HeaderSecondaryMenuButton.tsx +24 -5
- package/src/components/Header/useChatBot.ts +16 -0
- package/src/components/PictureText/PictureText.fixture.tsx +37 -0
- package/src/components/PictureText/PictureText.tsx +1 -14
- package/src/components/PictureText/PictureText.ui.json +10 -0
- package/src/components/PictureText/renderBenefit.tsx +33 -0
- package/src/components/ProductTile/renderBenefit.tsx +5 -1
- package/src/hooks/useBool.ts +19 -0
- package/src/icons/HeadphonesIcon.svg +5 -0
- package/src/icons/IconName.ts +6 -340
- package/src/model/ButtonVersion.ts +9 -2
- package/src/ui-kit/BenefitItem/BenefitItemProps.ts +28 -3
- package/src/ui-kit/Button/buttonClassNameConstants.ts +3 -0
- package/src/ui-kit/Img/ImgProps.ts +1 -0
|
@@ -3,6 +3,7 @@ import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
|
3
3
|
import { useLink } from '../../hooks/useLink';
|
|
4
4
|
import { useOutsideClick } from '../../hooks/useOutsideClick';
|
|
5
5
|
import type { LinkProps } from '../../model/LinkProps';
|
|
6
|
+
import { style } from '../../utils/style';
|
|
6
7
|
|
|
7
8
|
interface DropdownMenuProps {
|
|
8
9
|
className?: string;
|
|
@@ -21,7 +22,7 @@ export const DropdownMenu = JSX<DropdownMenuProps>(({ className = '', items, act
|
|
|
21
22
|
|
|
22
23
|
return (
|
|
23
24
|
<div
|
|
24
|
-
className={
|
|
25
|
+
className={style(visible ? 'bg-white rounded-md shadow-blue-gray' : '', className)}
|
|
25
26
|
ref={ref}
|
|
26
27
|
>
|
|
27
28
|
<button
|
|
@@ -39,15 +40,16 @@ export const DropdownMenu = JSX<DropdownMenuProps>(({ className = '', items, act
|
|
|
39
40
|
))}
|
|
40
41
|
</button>
|
|
41
42
|
<div
|
|
42
|
-
className={
|
|
43
|
+
className={style('flex flex-col rounded-md bg-white p-6 pb-2', visible ? '' : 'hidden')}
|
|
43
44
|
aria-hidden={!visible}
|
|
44
45
|
>
|
|
45
46
|
{items?.map((item, i) => (
|
|
46
47
|
<a
|
|
47
48
|
key={item.href || String(i)}
|
|
48
|
-
className={
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
className={style(
|
|
50
|
+
'text-l-light pb-4 hover:text-primary-main',
|
|
51
|
+
item === activeItem ? 'text-primary-main' : '',
|
|
52
|
+
)}
|
|
51
53
|
{...link(item)}
|
|
52
54
|
>
|
|
53
55
|
{item.text}
|
|
@@ -2,7 +2,7 @@ import '../../setup-fixture';
|
|
|
2
2
|
import { Header } from './Header';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
default: <Header />,
|
|
6
|
-
transparent: <Header bgColor="transparent" />,
|
|
7
|
-
'no submenu': <Header showSubMenu={false} />,
|
|
5
|
+
default: <Header chat="personal" />,
|
|
6
|
+
transparent: <Header bgColor="transparent" chat="personal" />,
|
|
7
|
+
'no submenu': <Header showSubMenu={false} chat="personal" />,
|
|
8
8
|
};
|
|
@@ -10,6 +10,7 @@ import { useSWRResource } from '../../services/sitemap/useSWRResource';
|
|
|
10
10
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
11
11
|
import { Logo } from '../../ui-kit/Logo/Logo';
|
|
12
12
|
import { TopItem } from '../../ui-kit/TopItem/TopItem';
|
|
13
|
+
import { style } from '../../utils/style';
|
|
13
14
|
import type { HeaderContent } from './HeaderContent';
|
|
14
15
|
import { HeaderSecondaryMenu } from './HeaderSecondaryMenu';
|
|
15
16
|
import { HeaderSubMenu } from './HeaderSubMenu';
|
|
@@ -24,9 +25,10 @@ const BG_COLOR_TO_BLOCK_VERSION: Record<BgColorVersion, BlockVersion> = {
|
|
|
24
25
|
export const Header = JSX<HeaderProps>(
|
|
25
26
|
({
|
|
26
27
|
bgColor = 'bg-white',
|
|
27
|
-
className
|
|
28
|
+
className,
|
|
28
29
|
showSubMenu = true,
|
|
29
30
|
version = BG_COLOR_TO_BLOCK_VERSION[bgColor],
|
|
31
|
+
chat,
|
|
30
32
|
...rest
|
|
31
33
|
}) => {
|
|
32
34
|
const router = useRouter();
|
|
@@ -46,9 +48,11 @@ export const Header = JSX<HeaderProps>(
|
|
|
46
48
|
return (
|
|
47
49
|
<BlockWrapper
|
|
48
50
|
tag="header"
|
|
49
|
-
className={
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
className={style(
|
|
52
|
+
'pt-6 px-20',
|
|
53
|
+
showSubMenu && activeTopItem?.items?.length ? 'pb-4' : 'pb-5',
|
|
54
|
+
className,
|
|
55
|
+
)}
|
|
52
56
|
version={version}
|
|
53
57
|
{...rest}
|
|
54
58
|
>
|
|
@@ -62,10 +66,14 @@ export const Header = JSX<HeaderProps>(
|
|
|
62
66
|
foreignOffices={foreignOffices}
|
|
63
67
|
defaultLocation={defaultLocation}
|
|
64
68
|
officesLink={officesLink}
|
|
69
|
+
chat={chat}
|
|
65
70
|
/>
|
|
66
71
|
</div>
|
|
67
72
|
<div
|
|
68
|
-
className={
|
|
73
|
+
className={style(
|
|
74
|
+
'mt-6 h-px bg-main-divider',
|
|
75
|
+
version === 'transparent' ? 'opacity-30' : '',
|
|
76
|
+
)}
|
|
69
77
|
/>
|
|
70
78
|
{showSubMenu && activeTopItem?.items?.length ? (
|
|
71
79
|
<HeaderSubMenu subItems={activeTopItem.items} />
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useBool } from '../../hooks/useBool';
|
|
3
|
+
import type { IconVersion } from '../../model/IconVersion';
|
|
4
|
+
import { style } from '../../utils/style';
|
|
5
|
+
import type { ChatBot as ChatBotWithEmptyOption } from './HeaderContent';
|
|
6
|
+
import { HeaderSecondaryMenuButton } from './HeaderSecondaryMenuButton';
|
|
7
|
+
import { useChatBot } from './useChatBot';
|
|
8
|
+
|
|
9
|
+
export type ChatBot = Exclude<ChatBotWithEmptyOption, ''>;
|
|
10
|
+
|
|
11
|
+
interface HeaderChatBotButtonProps {
|
|
12
|
+
className?: string;
|
|
13
|
+
iconVersion?: IconVersion;
|
|
14
|
+
chat?: ChatBot;
|
|
15
|
+
onClick?: () => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const CHAT_BUTTON_EXTERNAL_NAME = 'text-page__btn-chat';
|
|
19
|
+
|
|
20
|
+
export const HeaderChatBotButton = JSX<HeaderChatBotButtonProps>((props) => {
|
|
21
|
+
const [loadRequested, { setTrue: load }] = useBool();
|
|
22
|
+
|
|
23
|
+
return loadRequested ? (
|
|
24
|
+
<HeaderChatBotButtonWithLoader {...props} />
|
|
25
|
+
) : (
|
|
26
|
+
renderChatBotButton({ ...props, onClick: load })
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const HeaderChatBotButtonWithLoader = JSX<HeaderChatBotButtonProps>(
|
|
31
|
+
({ chat = 'personal', ...rest }) => {
|
|
32
|
+
useChatBot(chat);
|
|
33
|
+
|
|
34
|
+
return renderChatBotButton(rest);
|
|
35
|
+
},
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const renderChatBotButton = ({ className, iconVersion, onClick }: HeaderChatBotButtonProps) => (
|
|
39
|
+
<HeaderSecondaryMenuButton
|
|
40
|
+
className={style(CHAT_BUTTON_EXTERNAL_NAME, className)}
|
|
41
|
+
image={{ icon: 'HeadphonesIcon', iconVersion }}
|
|
42
|
+
ariaLabel="Чат"
|
|
43
|
+
onClick={onClick}
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
@@ -7,6 +7,12 @@ import type { IconProps, Picture } from '../../model/Picture';
|
|
|
7
7
|
*/
|
|
8
8
|
export type SubMenuItem = LinkProps & IconProps;
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @title Чат-бот
|
|
12
|
+
* @enumNames ["", "Для физических лиц", "Для юридических лиц"]
|
|
13
|
+
*/
|
|
14
|
+
export type ChatBot = '' | 'personal' | 'business';
|
|
15
|
+
|
|
10
16
|
/**
|
|
11
17
|
* @title Ссылка дополнительного меню
|
|
12
18
|
* @required ["text", "href"]
|
|
@@ -28,11 +34,11 @@ export interface Logo {
|
|
|
28
34
|
|
|
29
35
|
/**
|
|
30
36
|
* @title Шапка (для мобильных горизонтальная прокрутка shift+mouseScroll)
|
|
31
|
-
* @required ["defaultLocation", "topItems"]
|
|
32
37
|
*/
|
|
33
38
|
export interface HeaderContent {
|
|
34
39
|
/** @hidden */
|
|
35
40
|
showSubMenu?: boolean;
|
|
36
41
|
/** @hidden */
|
|
37
42
|
bgColor?: BgColorVersion;
|
|
43
|
+
chat?: ChatBot;
|
|
38
44
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useBool } from '../../hooks/useBool';
|
|
3
3
|
import { useLocation } from '../../hooks/useLocation';
|
|
4
4
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
5
5
|
import type { IconVersion } from '../../model/IconVersion';
|
|
6
6
|
import type { ForeignOffice } from '../../services/sitemap/SitemapProps';
|
|
7
|
-
import { Img } from '../../ui-kit/Img/Img';
|
|
8
7
|
import { Location } from '../../ui-kit/Location/Location';
|
|
9
8
|
import { TopItem } from '../../ui-kit/TopItem/TopItem';
|
|
9
|
+
import { style } from '../../utils/style';
|
|
10
|
+
import { HeaderChatBotButton } from './HeaderChatBotButton';
|
|
11
|
+
import type { ChatBot } from './HeaderContent';
|
|
10
12
|
import { HeaderSecondaryMenuButton } from './HeaderSecondaryMenuButton';
|
|
11
13
|
|
|
12
14
|
interface HeaderSecondaryMenuContent {
|
|
@@ -14,6 +16,7 @@ interface HeaderSecondaryMenuContent {
|
|
|
14
16
|
defaultLocation?: string;
|
|
15
17
|
officesLink?: string;
|
|
16
18
|
foreignOffices?: ForeignOffice[];
|
|
19
|
+
chat?: ChatBot;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
export interface HeaderSecondaryMenuProps extends HeaderSecondaryMenuContent {
|
|
@@ -21,22 +24,16 @@ export interface HeaderSecondaryMenuProps extends HeaderSecondaryMenuContent {
|
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
24
|
-
({ version, className, officesLink, defaultLocation = 'Москва', foreignOffices }) => {
|
|
25
|
-
const [isShowLocationModal,
|
|
27
|
+
({ version, className, officesLink, defaultLocation = 'Москва', foreignOffices, chat }) => {
|
|
28
|
+
const [isShowLocationModal, { setTrue: showLocationModal, setFalse: hideLocationModal }] =
|
|
29
|
+
useBool();
|
|
26
30
|
|
|
27
31
|
const [location, onChangeLocation] = useLocation(defaultLocation);
|
|
28
32
|
|
|
29
|
-
const showLocationModal = useCallback(() => {
|
|
30
|
-
setShowLocationModal(true);
|
|
31
|
-
}, []);
|
|
32
|
-
const hideLocationModal = useCallback(() => {
|
|
33
|
-
setShowLocationModal(false);
|
|
34
|
-
}, []);
|
|
35
|
-
|
|
36
33
|
const iconVersion: IconVersion = version === 'transparent' ? 'white' : 'black';
|
|
37
34
|
|
|
38
35
|
return (
|
|
39
|
-
<div className={
|
|
36
|
+
<div className={style('flex items-center', className)}>
|
|
40
37
|
<TopItem
|
|
41
38
|
className="mr-5"
|
|
42
39
|
flat={true}
|
|
@@ -54,28 +51,21 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
|
54
51
|
ariaLabel="Список всех доступных офисов и банкоматов"
|
|
55
52
|
/>
|
|
56
53
|
) : null}
|
|
54
|
+
{chat ? (
|
|
55
|
+
<HeaderChatBotButton className="mr-5" iconVersion={iconVersion} chat={chat} />
|
|
56
|
+
) : null}
|
|
57
57
|
<HeaderSecondaryMenuButton
|
|
58
|
-
className="mr-5
|
|
58
|
+
className="mr-5"
|
|
59
|
+
image={{ icon: 'LoupeIcon', iconVersion }}
|
|
59
60
|
ariaLabel="Поиск по сайту"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
image={{ icon: 'LoupeIcon', iconVersion }}
|
|
63
|
-
className="h-full pointer-events-none"
|
|
64
|
-
imageClassName="group-hover/btn:text-primary-hover group-hover/btn:invert-0 pointer-events-none"
|
|
65
|
-
asSVG
|
|
66
|
-
/>
|
|
67
|
-
</HeaderSecondaryMenuButton>
|
|
61
|
+
disabled={true}
|
|
62
|
+
/>
|
|
68
63
|
<HeaderSecondaryMenuButton
|
|
69
|
-
|
|
64
|
+
image={{ icon: 'GridIcon', iconVersion }}
|
|
70
65
|
ariaLabel="Дополнительные ссылки"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
className="h-full bg-main-divider/20 rounded-full pointer-events-none"
|
|
75
|
-
imageClassName="group-hover/btn:text-primary-hover group-hover/btn:invert-0"
|
|
76
|
-
asSVG
|
|
77
|
-
/>
|
|
78
|
-
</HeaderSecondaryMenuButton>
|
|
66
|
+
isRounded={true}
|
|
67
|
+
disabled={true}
|
|
68
|
+
/>
|
|
79
69
|
{isShowLocationModal ? (
|
|
80
70
|
<Location
|
|
81
71
|
currentLocation={location}
|
|
@@ -1,19 +1,38 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
3
|
+
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
4
|
+
import { style } from '../../utils/style';
|
|
2
5
|
|
|
3
|
-
interface HeaderSecondaryMenuButtonProps {
|
|
6
|
+
export interface HeaderSecondaryMenuButtonProps extends ImageContent {
|
|
4
7
|
className?: string;
|
|
8
|
+
isRounded?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
5
10
|
ariaLabel?: string;
|
|
11
|
+
onClick?: (ev?: { preventDefault: () => void }) => void;
|
|
6
12
|
}
|
|
7
13
|
|
|
8
14
|
export const HeaderSecondaryMenuButton = JSX<HeaderSecondaryMenuButtonProps>(
|
|
9
|
-
({ className
|
|
15
|
+
({ className, isRounded, disabled, ariaLabel, image, onClick }) => (
|
|
10
16
|
<button
|
|
17
|
+
className={style(
|
|
18
|
+
'group/btn border-0 p-0 flex items-center bg-inherit',
|
|
19
|
+
isRounded
|
|
20
|
+
? 'w-8 h-8 text-secondary-light hover:text-secondary-hove'
|
|
21
|
+
: 'w-6 h-6 text-primary-text hover:text-primary-main',
|
|
22
|
+
'group-data-transparent:text-white',
|
|
23
|
+
className,
|
|
24
|
+
)}
|
|
11
25
|
type="button"
|
|
12
|
-
|
|
13
|
-
disabled={true}
|
|
26
|
+
disabled={disabled}
|
|
14
27
|
aria-label={ariaLabel}
|
|
28
|
+
onClick={onClick}
|
|
15
29
|
>
|
|
16
|
-
|
|
30
|
+
<Img
|
|
31
|
+
image={image}
|
|
32
|
+
className={style('h-full', isRounded ? 'bg-main-divider/20 rounded-full' : '')}
|
|
33
|
+
imageClassName="group-hover/btn:text-primary-hover group-hover/btn:invert-0"
|
|
34
|
+
asSVG
|
|
35
|
+
/>
|
|
17
36
|
</button>
|
|
18
37
|
),
|
|
19
38
|
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { useExternalNS } from '../../hooks/useExternalNS';
|
|
3
|
+
import { ChatBot } from './HeaderChatBotButton';
|
|
4
|
+
|
|
5
|
+
const CHATBOT_NAMESPACE = 'chatbot';
|
|
6
|
+
|
|
7
|
+
const CHATBOT_URL: Record<ChatBot, string> = {
|
|
8
|
+
personal: '//chat.mes.rshb.ru/assets/js/webchat_rshb',
|
|
9
|
+
business: '', //TODO: add url business chat
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const useChatBot = (chat: ChatBot) => {
|
|
13
|
+
useEffect(() => globalThis.localStorage?.setItem('webchat-keep-open', String(Date.now())), []);
|
|
14
|
+
|
|
15
|
+
return useExternalNS(CHATBOT_NAMESPACE, CHATBOT_URL[chat]);
|
|
16
|
+
};
|
|
@@ -29,6 +29,14 @@ const imageInsurance: Picture = {
|
|
|
29
29
|
],
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
const imageMonitor: Picture = {
|
|
33
|
+
src: 'monitor.png',
|
|
34
|
+
format: 'webp',
|
|
35
|
+
alt: 'Управление несколькими счетами',
|
|
36
|
+
size: {
|
|
37
|
+
width: 420,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
32
40
|
export const PICTURE_TEXT: PictureTextContent = {
|
|
33
41
|
title: 'Обменивайте бонусы на путешествия',
|
|
34
42
|
description:
|
|
@@ -36,11 +44,13 @@ export const PICTURE_TEXT: PictureTextContent = {
|
|
|
36
44
|
'бонусные баллы на авиа и ж/д билеты, бронирование отелей и прокат автомобилей.',
|
|
37
45
|
benefits: [
|
|
38
46
|
{
|
|
47
|
+
type: 'default',
|
|
39
48
|
label: 'Кредит по одному документу',
|
|
40
49
|
description: 'До 300 тыс ₽ по упрощённой процедуре получения кредита',
|
|
41
50
|
icon: { icon: 'DocumentTextIcon' },
|
|
42
51
|
},
|
|
43
52
|
{
|
|
53
|
+
type: 'default',
|
|
44
54
|
label: 'Кредит на общих условиях',
|
|
45
55
|
description: 'До 5 млн ₽ на общих условиях получения кредита',
|
|
46
56
|
icon: { icon: 'DocumentTextIcon' },
|
|
@@ -54,19 +64,23 @@ export const INSURANCE_TEXT: PictureTextContent = {
|
|
|
54
64
|
description: 'Покрываемые риски программы «Защита вас и ваших близких»',
|
|
55
65
|
benefits: [
|
|
56
66
|
{
|
|
67
|
+
type: 'default',
|
|
57
68
|
label: 'Телесное повреждение',
|
|
58
69
|
icon: { icon: 'ShieldTickIcon' },
|
|
59
70
|
},
|
|
60
71
|
{
|
|
72
|
+
type: 'default',
|
|
61
73
|
label: 'Госпитализация застрахованного',
|
|
62
74
|
description: 'Описание',
|
|
63
75
|
icon: { icon: 'ShieldTickIcon' },
|
|
64
76
|
},
|
|
65
77
|
{
|
|
78
|
+
type: 'default',
|
|
66
79
|
label: 'Сокращение численности работников организации и другой текст для теста длинны текста',
|
|
67
80
|
icon: { icon: 'ShieldTickIcon' },
|
|
68
81
|
},
|
|
69
82
|
{
|
|
83
|
+
type: 'default',
|
|
70
84
|
label: 'Смерть застрахованного',
|
|
71
85
|
icon: { icon: 'ShieldTickIcon' },
|
|
72
86
|
},
|
|
@@ -75,6 +89,24 @@ export const INSURANCE_TEXT: PictureTextContent = {
|
|
|
75
89
|
sum: 500000,
|
|
76
90
|
};
|
|
77
91
|
|
|
92
|
+
export const BENEFITS_HTML_TEXT: PictureTextContent = {
|
|
93
|
+
title: '',
|
|
94
|
+
benefits: [
|
|
95
|
+
{
|
|
96
|
+
type: 'rte',
|
|
97
|
+
__html:
|
|
98
|
+
'<p class="h3">Управление несколькими счетами</p><p>Контролируйте баланс, пересылайте реквизиты контрагентам и установите любимый счёт для регулярных платежей</p>',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: 'rte',
|
|
102
|
+
__html:
|
|
103
|
+
'<p class="h3">Управление несколькими счетами</p><p>Контролируйте баланс, пересылайте реквизиты контрагентам и установите любимый счёт для регулярных платежей</p>',
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
|
|
107
|
+
image: imageMonitor,
|
|
108
|
+
};
|
|
109
|
+
|
|
78
110
|
export default {
|
|
79
111
|
default: (
|
|
80
112
|
<div className="container grid grid-cols-12">
|
|
@@ -96,4 +128,9 @@ export default {
|
|
|
96
128
|
<PictureText className="col-span-12" {...INSURANCE_TEXT} monthLimit={25000} />
|
|
97
129
|
</div>
|
|
98
130
|
),
|
|
131
|
+
'benefits as html': (
|
|
132
|
+
<div className="container grid grid-cols-12">
|
|
133
|
+
<PictureText className="col-span-12" {...BENEFITS_HTML_TEXT} />
|
|
134
|
+
</div>
|
|
135
|
+
),
|
|
99
136
|
};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
2
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
4
|
-
import { BenefitItem } from '../../ui-kit/BenefitItem/BenefitItem';
|
|
5
|
-
import type { BenefitItemProps } from '../../ui-kit/BenefitItem/BenefitItemProps';
|
|
6
3
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
7
4
|
import { Img } from '../../ui-kit/Img/Img';
|
|
8
5
|
import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
|
|
9
6
|
import { Headline } from '../Headline/Headline';
|
|
10
7
|
import type { PictureTextContent } from './PictureTextContent';
|
|
8
|
+
import { renderBenefit } from './renderBenefit';
|
|
11
9
|
|
|
12
10
|
export interface PictureTextProps extends PictureTextContent, UniBlockProps {}
|
|
13
11
|
|
|
@@ -39,17 +37,6 @@ export const PictureText = JSX<PictureTextProps>(
|
|
|
39
37
|
),
|
|
40
38
|
);
|
|
41
39
|
|
|
42
|
-
const renderBenefit = (version: BlockVersion) => (benefit: BenefitItemProps, i: number) =>
|
|
43
|
-
(
|
|
44
|
-
<BenefitItem
|
|
45
|
-
key={String(i)}
|
|
46
|
-
icon={benefit.icon}
|
|
47
|
-
label={benefit.label}
|
|
48
|
-
description={benefit.description}
|
|
49
|
-
version={version}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
52
|
-
|
|
53
40
|
function renderInsuranceSumMonth(sum?: number, monthLimit?: number) {
|
|
54
41
|
return sum || monthLimit ? (
|
|
55
42
|
<div className="bg-main-divider rounded-md flex mt-7 gap-6 px-5 py-4">
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BlockVersion } from '../../model/BlockVersion';
|
|
2
|
+
import { BenefitItem } from '../../ui-kit/BenefitItem/BenefitItem';
|
|
3
|
+
import type { ComplexBenefitProps } from '../../ui-kit/BenefitItem/BenefitItemProps';
|
|
4
|
+
import { RichText } from '../../ui-kit/RichText/RichText';
|
|
5
|
+
import { assertUnreachable } from '../../utils/assertUnreachable';
|
|
6
|
+
|
|
7
|
+
export const renderBenefit =
|
|
8
|
+
// Linter doesn't understand that switch processes all cases
|
|
9
|
+
// eslint-disable-next-line consistent-return
|
|
10
|
+
(version: BlockVersion) => (benefit: ComplexBenefitProps, i: number) => {
|
|
11
|
+
const { type } = benefit;
|
|
12
|
+
|
|
13
|
+
if (!(type === 'default' || type === 'rte')) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
switch (type) {
|
|
18
|
+
case 'default':
|
|
19
|
+
return (
|
|
20
|
+
<BenefitItem
|
|
21
|
+
key={String(i)}
|
|
22
|
+
icon={benefit.icon}
|
|
23
|
+
label={benefit.label}
|
|
24
|
+
description={benefit.description}
|
|
25
|
+
version={version}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
case 'rte':
|
|
29
|
+
return <RichText __html={benefit.__html} />;
|
|
30
|
+
default:
|
|
31
|
+
assertUnreachable(benefit);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
@@ -29,7 +29,11 @@ export const renderBenefit =
|
|
|
29
29
|
</Text>,
|
|
30
30
|
];
|
|
31
31
|
case 'rte':
|
|
32
|
-
return
|
|
32
|
+
return (
|
|
33
|
+
<div className="col-span-2">
|
|
34
|
+
<RichText __html={benefit.__html} />
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
33
37
|
default:
|
|
34
38
|
assertUnreachable(benefit);
|
|
35
39
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
|
|
3
|
+
export function useBool(defaultValue = false): [
|
|
4
|
+
boolean,
|
|
5
|
+
{
|
|
6
|
+
setValue: (_: boolean) => void;
|
|
7
|
+
setTrue: () => void;
|
|
8
|
+
setFalse: () => void;
|
|
9
|
+
toggle: () => void;
|
|
10
|
+
},
|
|
11
|
+
] {
|
|
12
|
+
const [value, setValue] = useState<boolean>(defaultValue);
|
|
13
|
+
|
|
14
|
+
const setTrue = useCallback(() => setValue(true), []);
|
|
15
|
+
const setFalse = useCallback(() => setValue(false), []);
|
|
16
|
+
const toggle = useCallback(() => setValue((_) => !_), []);
|
|
17
|
+
|
|
18
|
+
return [value, { setValue, setTrue, setFalse, toggle }];
|
|
19
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" name="Наушники" fill="none" viewBox="0 0 24 23">
|
|
2
|
+
<path fill="currentColor" fill-rule="evenodd"
|
|
3
|
+
d="M2.002 19.612a3.025 3.025 0 0 1-2-2.965V13.48a2.948 2.948 0 0 1 1.53-2.561v-.272C1.504 5.437 5.237.98 10.334.14c5.098-.841 10.044 2.182 11.664 7.128.124.34.058.718-.17.995a.997.997 0 0 1-1.71-.299 8.484 8.484 0 0 0-3.999-4.85 8.505 8.505 0 0 0-8.417.215 8.657 8.657 0 0 0-4.17 7.378v1.009c0 .557-.448 1.008-1 1.008-.17 0-.5.393-.5.767v3.267c0 .557.447 1.008 1 1.008.552 0 1-.451 1-1.008v-2.26c0-.556.447-1.007 1-1.007.551 0 .999.45.999 1.008v2.259c.004.99-.472 1.92-1.276 2.488a2.978 2.978 0 0 1-2.753.366Zm19.876.222a3.022 3.022 0 0 0 2.12-2.885v-2.924a3.025 3.025 0 0 0-2-2.965 2.978 2.978 0 0 0-2.74.388 3.034 3.034 0 0 0-1.259 2.486v2.017c0 .557.448 1.008 1 1.008s1-.451 1-1.008v-2.017c0-.557.447-1.008 1-1.008.552 0 1 .451 1 1.008v3.025c0 .557-.448 1.009-1 1.009a.996.996 0 0 0-.73.316c-.189.203-.287.475-.27.753a2.008 2.008 0 0 1-2 1.956h-4v-.716c0-.557-.447-1.008-1-1.008-.551 0-.999.451-.999 1.008v1.715c0 .556.448 1.008 1 1.008h4.999a4.007 4.007 0 0 0 3.91-3.166h-.03Z"
|
|
4
|
+
clip-rule="evenodd" />
|
|
5
|
+
</svg>
|