Skip to content

Commit d75f409

Browse files
committed
Remove use of deprecated backdropClassName
1 parent 9752309 commit d75f409

File tree

5 files changed

+16
-37
lines changed

5 files changed

+16
-37
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ import {
66
} from '../leafygreen';
77
import { withStackedComponentStyles } from '../../hooks/use-stacked-component';
88

9+
export type ConfirmationModalProps = Omit<
10+
React.ComponentProps<typeof LeafyGreenConfirmationModal>,
11+
'backdropClassName'
12+
>;
13+
914
function ConfirmationModal({
1015
children,
1116
...props
12-
}: React.ComponentProps<
13-
typeof LeafyGreenConfirmationModal
14-
>): React.ReactElement {
17+
}: ConfirmationModalProps): React.ReactElement {
1518
return (
1619
<LeafyGreenConfirmationModal {...props}>
1720
<Body as="div">{children}</Body>

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ import {
55
} from '../leafygreen';
66
import { withStackedComponentStyles } from '../../hooks/use-stacked-component';
77

8+
export type MarketingModalProps = Omit<
9+
React.ComponentProps<typeof LeafyGreenMarketingModal>,
10+
'backdropClassName'
11+
>;
12+
813
function MarketingModal({
914
children,
1015
...props
11-
}: React.ComponentProps<typeof LeafyGreenMarketingModal>): React.ReactElement {
16+
}: MarketingModalProps): React.ReactElement {
1217
return (
1318
<LeafyGreenMarketingModal {...props}>
1419
<Body as="div">{children}</Body>

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,15 @@ const fullScreenStyles = css({
2626
});
2727

2828
function UnwrappedModal({
29-
backdropClassName,
3029
className,
3130
children,
3231
fullScreen = false,
3332
...props
34-
}: React.ComponentProps<typeof LeafyGreenModal> & {
33+
}: Omit<React.ComponentProps<typeof LeafyGreenModal>, 'backdropClassName'> & {
3534
fullScreen?: boolean;
3635
}): React.ReactElement {
37-
// NOTE: We supply scrollbar styles to the `Modal` content as
38-
// there is currently a bug in `LeafyGreen` with the portal providers
39-
// where our top level `portalContainer` we supply to the `LeafyGreenProvider`
40-
// in home.tsx is not used by Modals.
41-
// Once this issue is fixed we can remove these styles here.
42-
const { className: scrollbarStyles } = useScrollbars();
43-
4436
return (
4537
<LeafyGreenModal
46-
backdropClassName={cx(scrollbarStyles, backdropClassName)}
4738
className={cx(styles, className, {
4839
[fullScreenStyles]: fullScreen,
4940
})}

packages/compass-crud/src/components/insert-document-dialog.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ const InsertDocumentDialog: React.FC<InsertDocumentDialogProps> = ({
297297
<FormModal
298298
title="Insert Document"
299299
subtitle={`To collection ${ns}`}
300-
backdropClassName="insert-document-dialog"
301300
open={isOpen}
302301
onSubmit={handleInsert.bind(this)}
303302
onCancel={closeInsertDocumentDialog}

packages/connection-form/src/components/connection-form-modal.tsx

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,13 @@ import type { Dispatch, SetStateAction } from 'react';
44
import type { ConnectionFormProps } from './connection-form';
55
import ConnectionForm from './connection-form';
66

7-
const modalStyles = css({
8-
'& > div': {
9-
height: '100%',
10-
},
11-
});
12-
13-
const modalContentStyles = css({
7+
const styles = css({
148
width: '960px',
159
maxWidth: '960px',
16-
margin: 0,
1710

1811
display: 'flex',
1912
alignItems: 'stretch',
2013
justifyContent: 'stretch',
21-
22-
'& > div': {
23-
width: '100%',
24-
},
25-
});
26-
27-
const modalContentFullHeightStyles = css({
28-
height: '100%',
29-
maxHeight: spacing[1600] * 18,
3014
});
3115

3216
export default function ConnectionFormModal({
@@ -48,11 +32,8 @@ export default function ConnectionFormModal({
4832
open={isOpen}
4933
setOpen={setOpen}
5034
data-testid="connection-form-modal"
51-
backdropClassName={modalStyles}
52-
className={cx(
53-
modalContentStyles,
54-
advancedOpen && modalContentFullHeightStyles
55-
)}
35+
className={styles}
36+
fullScreen={advancedOpen}
5637
>
5738
<ConnectionForm
5839
// Key is not applied to the Modal itself or the upper component so that

0 commit comments

Comments
 (0)