From 33a0556d14852f9fe13d865ccd0bfef6475f2967 Mon Sep 17 00:00:00 2001 From: kseniyakuzina Date: Mon, 4 Mar 2024 13:20:17 +0300 Subject: [PATCH] fix(logo): make logo independent of the aside state --- src/components/AsideHeader/components/Header.tsx | 10 ++++++++-- src/components/Logo/Logo.tsx | 6 ++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/AsideHeader/components/Header.tsx b/src/components/AsideHeader/components/Header.tsx index 1f2dfe3..fecf94f 100644 --- a/src/components/AsideHeader/components/Header.tsx +++ b/src/components/AsideHeader/components/Header.tsx @@ -9,7 +9,7 @@ import {CompositeBar} from '../../CompositeBar/CompositeBar'; import headerDividerCollapsedIcon from '../../../../assets/icons/divider-collapsed.svg'; -import {useAsideHeaderInnerContext} from '../AsideHeaderContext'; +import {useAsideHeaderContext, useAsideHeaderInnerContext} from '../AsideHeaderContext'; import {b} from '../utils'; const DEFAULT_SUBHEADER_ITEMS: SubheaderMenuItem[] = []; @@ -17,6 +17,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) => { @@ -28,7 +29,12 @@ export const Header = () => { return (
- + = ({ +export const Logo: React.FC = ({ text, icon, iconSrc, @@ -24,8 +22,8 @@ export const Logo: React.FC = ({ wrapper, onClick, iconWrapperClassName, + compact, }) => { - const {compact} = useAsideHeaderContext(); const hasWrapper = typeof wrapper === 'function'; let buttonIcon;