Skip to content

Commit

Permalink
fix: remove dropdown menu offset in slim headers
Browse files Browse the repository at this point in the history
  • Loading branch information
astagi committed Jan 9, 2025
1 parent 5c93a93 commit 52a1149
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Dropdown/DropdownMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React, { FC, HTMLAttributes } from 'react';
import { DropdownMenu as BSDRopdownMenu } from 'reactstrap';

// .it-header-slim-wrapper .it-header-slim-wrapper-content .dropdown-menu {
// top: unset !important;
// }
import { SLIM, useHeaderContext } from '../Header/HeaderContext';

export interface DropdownMenuProps extends HTMLAttributes<HTMLElement> {
/** Classi aggiuntive da usare per il componente Button */
Expand All @@ -13,9 +10,9 @@ export interface DropdownMenuProps extends HTMLAttributes<HTMLElement> {
}

export const DropdownMenu: FC<DropdownMenuProps> = ({ className, inNavbar, testId, children, ...attributes }) => {
const type = useHeaderContext();
const style = inNavbar && type === SLIM ? { top: 'unset !important' } : {};

const style = inNavbar ? {'top' : 'unset !important'} : {}

return (
<BSDRopdownMenu style={style} data-testid={testId} {...attributes} className={className}>
{children}
Expand Down

0 comments on commit 52a1149

Please sign in to comment.