Skip to content

Commit

Permalink
#4352 - Macro: Gap between button and drop-down list of Macro modes
Browse files Browse the repository at this point in the history
  • Loading branch information
Guch1g0v committed Oct 17, 2024
1 parent 946ccdb commit 2b8f86f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export const LayoutModeButton = () => {
testId="layout-mode"
vertical={true}
needOpenByMenuItemClick={true}
layoutModeButton={true}
>
<Menu.Item
itemId="sequence-layout-mode"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type SubMenuProps = {
disabled?: boolean;
needOpenByMenuItemClick?: boolean;
testId?: string;
layoutModeButton?: boolean;
};

const SubMenu = ({
Expand All @@ -39,6 +40,7 @@ const SubMenu = ({
disabled = false,
needOpenByMenuItemClick = false,
testId,
layoutModeButton = false,
}: React.PropsWithChildren<SubMenuProps>) => {
const [open, setOpen] = useState(false);
const { isActive } = useMenuContext();
Expand Down Expand Up @@ -98,7 +100,10 @@ const SubMenu = ({
onClick={hideCollapse}
>
<ClickAwayListener onClickAway={hideCollapse}>
<OptionsContainer isVertical={vertical}>
<OptionsContainer
isVertical={vertical}
islayoutModeButton={layoutModeButton}
>
{subComponents.map((component) => component)}
</OptionsContainer>
</ClickAwayListener>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export const OptionsContainer = styled.div<OptionsContainerProps>`
display: flex;
position: absolute;
left: ${({ isVertical }) => (isVertical ? '-34px' : '5px')};
top: ${({ isVertical }) => (isVertical ? '38px' : '0')};
top: ${({ isVertical, islayoutModeButton }) =>
isVertical && islayoutModeButton ? '24px' : isVertical ? '38px' : '0px'};
border-radius: 4px;
flex-direction: ${({ isVertical }) => (isVertical ? 'column' : 'row')};
height: 100px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ export interface IStyledDropdownIconProps {

export type OptionsContainerProps = {
isVertical?: boolean;
islayoutModeButton?: boolean;
} & React.HTMLAttributes<HTMLDivElement>;

0 comments on commit 2b8f86f

Please sign in to comment.