Skip to content

Commit 9752309

Browse files
committed
Fix fullScreen prop on derived Modal
1 parent a142fc0 commit 9752309

File tree

1 file changed

+6
-25
lines changed
  • packages/compass-components/src/components/modals

1 file changed

+6
-25
lines changed

packages/compass-components/src/components/modals/modal.tsx

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Body, Modal as LeafyGreenModal } from '../leafygreen';
55
import { useScrollbars } from '../../hooks/use-scrollbars';
66
import { withStackedComponentStyles } from '../../hooks/use-stacked-component';
77

8-
const contentStyles = css({
8+
const styles = css({
99
width: '600px',
1010
letterSpacing: 0,
1111
padding: 0,
@@ -15,22 +15,9 @@ const contentStyles = css({
1515
transform: 'none',
1616
});
1717

18-
const modalFullScreenStyles = css({
19-
'& > div': {
20-
paddingTop: spacing[600],
21-
paddingBottom: spacing[600],
22-
paddingLeft: spacing[800],
23-
paddingRight: spacing[800],
24-
height: '100vh',
25-
maxHeight: '100vh',
26-
},
27-
});
28-
29-
const contentFullScreenStyles = css({
18+
const fullScreenStyles = css({
3019
width: '100%',
3120
height: '100%',
32-
maxHeight: '100%',
33-
margin: 0,
3421
alignSelf: 'stretch',
3522
'& > div': {
3623
height: '100%',
@@ -56,16 +43,10 @@ function UnwrappedModal({
5643

5744
return (
5845
<LeafyGreenModal
59-
backdropClassName={cx(
60-
scrollbarStyles,
61-
fullScreen && modalFullScreenStyles,
62-
backdropClassName
63-
)}
64-
className={cx(
65-
contentStyles,
66-
fullScreen && contentFullScreenStyles,
67-
className
68-
)}
46+
backdropClassName={cx(scrollbarStyles, backdropClassName)}
47+
className={cx(styles, className, {
48+
[fullScreenStyles]: fullScreen,
49+
})}
6950
{...props}
7051
>
7152
{/* Rendering conditionally on `open` as a workaround for LG-5601 */}

0 commit comments

Comments
 (0)