Skip to content

Commit

Permalink
#3580 - Macro: Add possibility to expand "Select Attachment Points" M…
Browse files Browse the repository at this point in the history
…odal

dont interfere with other modals styles
  • Loading branch information
Mariia_Khrustaleva(EPAM) authored and Mariia_Khrustaleva(EPAM) committed Nov 28, 2023
1 parent a1cadd8 commit 1aaa83f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const MonomerConnection = ({
isOpen={isModalOpen}
onClose={cancelBondCreationAndClose}
showExpandButton
modalWidth="350px"
>
<Modal.Content>
<ModalContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ interface ModalProps {
showExpandButton?: boolean;
onClose: VoidFunction;
className?: string;
modalWidth?: string;
}
const StyledDialog = styled(Dialog)`
.MuiPaper-root {
min-width: 304px;
max-width: calc(min(1280px, 100%));
max-height: calc(min(980px, 100%));
}
`;

Expand Down Expand Up @@ -86,6 +85,7 @@ export const Modal = ({
showExpandButton = false,
onClose,
className,
modalWidth,
}: ModalProps) => {
const theme = useTheme();
const [expanded, setExpanded] = React.useState(false);
Expand All @@ -96,8 +96,12 @@ export const Modal = ({
background: theme.ketcher.color.background.primary,
borderRadius: '8px',
color: theme.ketcher.color.text.primary,
width: expanded ? '100%' : '350px',
height: expanded ? '100%' : undefined,
...(showExpandButton && {
width: expanded ? '100%' : modalWidth,
height: expanded ? '100%' : undefined,
maxWidth: 'calc(min(1280px, 100%))',
maxHeight: 'calc(min(980px, 100%))',
}),
},
}),
[
Expand Down

0 comments on commit 1aaa83f

Please sign in to comment.