Skip to content

Commit

Permalink
fix(Logo): fix condition display logo (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunory authored Sep 10, 2024
1 parent 0b8abd3 commit 38f234a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
4 changes: 1 addition & 3 deletions src/components/AsideHeader/components/FirstPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export const FirstPanel = React.forwardRef<HTMLDivElement>((_props, ref) => {
customBackgroundClassName,
className,
hideCollapseButton,
logo,
qa,
} = useAsideHeaderInnerContext();
const visibleMenuItems = useVisibleMenuItems();
Expand All @@ -47,8 +46,7 @@ export const FirstPanel = React.forwardRef<HTMLDivElement>((_props, ref) => {
{customBackground}
</div>
)}
{/* TODO add new prop for hiding Header */}
{logo && <Header />}
<Header />
{visibleMenuItems?.length ? (
<CompositeBar
type="menu"
Expand Down
20 changes: 9 additions & 11 deletions src/components/AsideHeader/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,17 @@ export const Header = () => {
[onClosePanel, logo],
);

if (!logo) {
return null;
}

return (
<div className={b('header', {['with-decoration']: headerDecoration})}>
<Logo
{...logo}
onClick={onLogoClick}
compact={compact}
buttonWrapperClassName={b('logo-button-wrapper')}
buttonClassName={b('logo-button')}
/>
{logo && (
<Logo
{...logo}
onClick={onLogoClick}
compact={compact}
buttonWrapperClassName={b('logo-button-wrapper')}
buttonClassName={b('logo-button')}
/>
)}

<CompositeBar
type="subheader"
Expand Down

0 comments on commit 38f234a

Please sign in to comment.