From 5c115d2a157f3077dab891bc9f073c9da62fe969 Mon Sep 17 00:00:00 2001 From: kseniyakuzina Date: Mon, 4 Mar 2024 12:40:56 +0300 Subject: [PATCH] fix(logo): make logo independent of the aside state --- src/components/AsideHeader/components/Header.tsx | 5 +++-- src/components/Logo/Logo.tsx | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/AsideHeader/components/Header.tsx b/src/components/AsideHeader/components/Header.tsx index 787aadb..2bd7f0c 100644 --- a/src/components/AsideHeader/components/Header.tsx +++ b/src/components/AsideHeader/components/Header.tsx @@ -6,7 +6,7 @@ import {CompositeBar} from '../../CompositeBar/CompositeBar'; import {Logo} from '../../Logo'; import {ASIDE_HEADER_COMPACT_WIDTH, HEADER_DIVIDER_HEIGHT} from '../../constants'; import {SubheaderMenuItem} from '../../types'; -import {useAsideHeaderInnerContext} from '../AsideHeaderContext'; +import {useAsideHeaderContext, useAsideHeaderInnerContext} from '../AsideHeaderContext'; import {b} from '../utils'; import headerDividerCollapsedIcon from '../../../../assets/icons/divider-collapsed.svg'; @@ -16,6 +16,7 @@ const DEFAULT_SUBHEADER_ITEMS: SubheaderMenuItem[] = []; export const Header = () => { const {logo, onItemClick, onClosePanel, headerDecoration, subheaderItems} = useAsideHeaderInnerContext(); + const {compact} = useAsideHeaderContext(); const {onClick: onLogoClickProp} = logo; const onLogoClick = useCallback( (event: React.MouseEvent) => { @@ -27,7 +28,7 @@ export const Header = () => { return (
- + = ({ +export const Logo: React.FC = ({ text, icon, iconSrc, @@ -21,8 +20,8 @@ export const Logo: React.FC = ({ target = '_self', wrapper, onClick, + compact, }) => { - const {compact} = useAsideHeaderContext(); const hasWrapper = typeof wrapper === 'function'; let buttonIcon;