Skip to content

Commit 1bab0d3

Browse files
committed
refactor: replace paragon deprecated components
1 parent 70aa4ff commit 1bab0d3

File tree

2 files changed

+17
-33
lines changed

2 files changed

+17
-33
lines changed

src/courseware/course/sequence/Unit/ContentIFrame.jsx

+15-30
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33

44
import { ErrorPage } from '@edx/frontend-platform/react';
55
import { StrictDict } from '@edx/react-unit-test-utils';
6-
import { ModalDialog, Modal } from '@openedx/paragon';
6+
import { ModalDialog } from '@openedx/paragon';
77
import { PluginSlot } from '@openedx/frontend-plugin-framework';
88

99
import PageLoading from '@src/generic/PageLoading';
@@ -66,21 +66,6 @@ const ContentIFrame = ({
6666
onLoad: handleIFrameLoad,
6767
};
6868

69-
let modalContent;
70-
if (modalOptions.isOpen) {
71-
modalContent = modalOptions.body
72-
? <div className="unit-modal">{ modalOptions.body }</div>
73-
: (
74-
<iframe
75-
title={modalOptions.title}
76-
allow={IFRAME_FEATURE_POLICY}
77-
frameBorder="0"
78-
src={modalOptions.url}
79-
style={{ width: '100%', height: modalOptions.height }}
80-
/>
81-
);
82-
}
83-
8469
return (
8570
<>
8671
{(shouldShowContent && !hasLoaded) && (
@@ -101,28 +86,28 @@ const ContentIFrame = ({
10186
<iframe title={title} {...contentIFrameProps} data-testid={testIDs.contentIFrame} />
10287
</div>
10388
)}
104-
{modalOptions.isOpen && (modalOptions.isFullscreen
105-
? (
106-
<ModalDialog
89+
{modalOptions.isOpen &&
90+
(<ModalDialog
10791
dialogClassName="modal-lti"
10892
onClose={handleModalClose}
109-
size="fullscreen"
93+
size={ modalOptions.isFullscreen ? 'fullscreen': 'md'}
11094
isOpen
11195
hasCloseButton={false}
11296
>
11397
<ModalDialog.Body className={modalOptions.modalBodyClassName}>
114-
{modalContent}
98+
{modalOptions.body
99+
? <div className="unit-modal">{ modalOptions.body }</div>
100+
: (
101+
<iframe
102+
title={modalOptions.title}
103+
allow={IFRAME_FEATURE_POLICY}
104+
frameBorder="0"
105+
src={modalOptions.url}
106+
style={{ width: '100%', height: modalOptions.height }}
107+
/>
108+
)}
115109
</ModalDialog.Body>
116110
</ModalDialog>
117-
118-
) : (
119-
<Modal
120-
body={modalContent}
121-
dialogClassName="modal-lti"
122-
onClose={handleModalClose}
123-
open
124-
/>
125-
)
126111
)}
127112
</>
128113
);

src/instructor-toolbar/masquerade-widget/MasqueradeUserNameInput.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { useIntl } from '@edx/frontend-platform/i18n';
3-
import { Input } from '@openedx/paragon';
3+
import { Form } from '@openedx/paragon';
44

55
import { MasqueradeStatus, Payload } from './data/api';
66
import messages from './messages';
@@ -40,11 +40,10 @@ export const MasqueradeUserNameInput: React.FC<Props> = ({ onSubmit, onError, ..
4040
}, [handleSubmit]);
4141

4242
return (
43-
<Input
43+
<Form.Control
4444
aria-labelledby="masquerade-search-label"
4545
label={intl.formatMessage(messages.userNameLabel)}
4646
onKeyPress={handleKeyPress}
47-
type="text"
4847
{...otherProps}
4948
/>
5049
);

0 commit comments

Comments
 (0)