Skip to content

Commit

Permalink
fix(Footer): fix clear footer clicking (#228)
Browse files Browse the repository at this point in the history
Co-authored-by: kseniyakuzina <kseniyakuzina@yandex-team.ru>
  • Loading branch information
kseniya57 and kseniyakuzina authored Apr 22, 2024
1 parent a150c30 commit 20a6964
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
2 changes: 2 additions & 0 deletions src/components/Footer/desktop/Footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ $block: '.#{variables.$ns}footer';
#{$block}_desktop {
display: flex;
align-items: center;
justify-content: flex-end;
height: 40px;
padding: 0 var(--g-spacing-6) 0 var(--g-spacing-3);
gap: var(--g-spacing-6);
Expand Down Expand Up @@ -63,4 +64,5 @@ $block: '.#{variables.$ns}footer';

#{$block}_view_clear {
background: transparent;
z-index: -1;
}
45 changes: 24 additions & 21 deletions src/components/Footer/desktop/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,30 +57,33 @@ export const Footer: FC<FooterProps> = ({
);

const shouldRenderLogo = view !== 'clear' && Boolean(logo);
const shouldRenderMenu = (menuItems?.length ?? 0) > 0;

return (
<footer className={b({desktop: true, 'with-divider': withDivider, view}, className)}>
<div className={b('menu', {measured})} ref={menuContainerRef}>
{visibleItems.length > 0 && (
<Menu className={b('list')}>
{visibleItems.map((item, index) => (
<MenuItem
key={index}
{...item}
className={b('menu-item', item.className)}
/>
))}
</Menu>
)}
{dropdownMenuItems.length > 0 && (
<DropdownMenu
items={dropdownMenuItems}
switcherWrapperClassName={b('more-button')}
popupProps={moreItemsPopupProps}
defaultSwitcherProps={moreButtonProps}
/>
)}
</div>
{shouldRenderMenu && (
<div className={b('menu', {measured})} ref={menuContainerRef}>
{visibleItems.length > 0 && (
<Menu className={b('list')}>
{visibleItems.map((item, index) => (
<MenuItem
key={index}
{...item}
className={b('menu-item', item.className)}
/>
))}
</Menu>
)}
{dropdownMenuItems.length > 0 && (
<DropdownMenu
items={dropdownMenuItems}
switcherWrapperClassName={b('more-button')}
popupProps={moreItemsPopupProps}
defaultSwitcherProps={moreButtonProps}
/>
)}
</div>
)}
<div className={b('right')}>
<small className={b('copyright', {small: !menuItems?.length})}>{copyright}</small>
{shouldRenderLogo && (
Expand Down
1 change: 1 addition & 0 deletions src/components/Footer/mobile/Footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ $block: '.#{variables.$ns}footer';

#{$block}_view_clear {
background: transparent;
z-index: -1;

#{$block}__bottom-row {
justify-content: flex-end;
Expand Down

0 comments on commit 20a6964

Please sign in to comment.