Skip to content

Commit

Permalink
Update the sfx/ui menu by applying auto width and removing the overfl…
Browse files Browse the repository at this point in the history
…ow: visible
  • Loading branch information
AhmeeedMostafa authored and amrelbialy committed Dec 11, 2024
1 parent b2b0497 commit 388dadd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ const OverrideDefaultStyles = createGlobalStyle`
box-sizing: border-box;
.SfxPopper-root .SfxMenu-root {
overflow: visible;
width: max-content;
.SfxMenuItem-prefix {
margin-right: 6px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import styled from 'styled-components';
import Label from '@scaleflex/ui/core/label';
import { Color as PC } from '@scaleflex/ui/utils/types/palette';
import Menu from '@scaleflex/ui/core/menu';

const StyledOptions = styled.div`
display: flex;
Expand Down Expand Up @@ -139,6 +140,10 @@ const StyledIconLabel = styled(Label)`
color: ${({ theme: { palette } }) => palette[PC.TextPrimary]};
`;

const StyledOptionsPopUp = styled(Menu)`
width: auto;
`;

export {
StyledTwoColumnsContainer,
StyledColumn,
Expand All @@ -148,4 +153,5 @@ export {
StyledOptionsWrapper,
StyledOptionPopupContent,
StyledIconLabel,
StyledOptionsPopUp,
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import React, { useCallback, useMemo, useState } from 'react';
import PropTypes from 'prop-types';
import { usePhoneScreen, useStore } from 'hooks';
import { Label } from '@scaleflex/ui/core';
import Menu from '@scaleflex/ui/core/menu';
import Transparency from '@scaleflex/icons/transparency';
import Shadow from '@scaleflex/icons/shadow';
import Stroke from '@scaleflex/icons/stroke';
Expand All @@ -19,6 +18,7 @@ import {
StyledOptions,
StyledOptionsWrapper,
StyledIconWrapper,
StyledOptionsPopUp,
} from './AnnotationOptions.styled';
import { POPPABLE_OPTIONS } from './AnnotationOptions.constants';
import ColorInput from '../ColorInput';
Expand Down Expand Up @@ -145,7 +145,7 @@ const AnnotationOptions = ({
</StyledOptionsWrapper>

{OptionPopupComponent && (
<Menu
<StyledOptionsPopUp
className="FIE_annotation-option-popup"
anchorEl={anchorEl}
open={Boolean(anchorEl)}
Expand All @@ -163,7 +163,7 @@ const AnnotationOptions = ({
/>
)}
</StyledOptionPopupContent>
</Menu>
</StyledOptionsPopUp>
)}
</StyledOptions>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const StyledRatioDescription = styled(Label)`
`;

const StyledMenu = styled.div`
min-width: 270px;
border-radius: 4px;
overflow: hidden;
background-color: ${({ theme: { palette } }) =>
Expand Down

0 comments on commit 388dadd

Please sign in to comment.