Skip to content

Commit

Permalink
refactor: migrate off modal paragon deprecated component (openedx#71)
Browse files Browse the repository at this point in the history
* refactor: migrate off modal paragon deprecated component

* refactor: fixed ModalDialog body uppercase

* refactor: change button tag
  • Loading branch information
Mashal-m authored and dcoa committed Jan 10, 2024
1 parent 35352e6 commit 65bc186
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions src/instructions/proctored_exam/WarningModal.jsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Button, Modal } from '@edx/paragon';
import { ActionRow, ModalDialog, Button } from '@edx/paragon';

const WarningModal = ({
isOpen, handleClose, title, body,
}) => (
<Modal
title={title}
open={isOpen}
onClose={() => {}}
renderDefaultCloseButton={false}
renderHeaderCloseButton={false}
buttons={[
<Button variant="tertiary" onClick={handleClose}>Ok</Button>,
]}
body={(
<p>
{body}
</p>
)}
/>
<ModalDialog
isOpen={isOpen}
hasCloseButton={false}
>

<ModalDialog.Header>
<ModalDialog.Title>
{title}
</ModalDialog.Title>
</ModalDialog.Header>
<ModalDialog.Body>
{body}
</ModalDialog.Body>
<ModalDialog.Footer>
<ActionRow>
<Button onClick={handleClose} variant="tertiary">
Ok
</Button>
</ActionRow>
</ModalDialog.Footer>
</ModalDialog>
);

WarningModal.propTypes = {
Expand Down

0 comments on commit 65bc186

Please sign in to comment.