Commit d1046cb7 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Use updated shared `Modal` instead of `ConfirmModal` in prompts

parent 332a32b5
import { render } from 'preact';
import type { ComponentChildren } from 'preact';
import { ConfirmModal } from '@hypothesis/frontend-shared';
import { Button, Modal } from '@hypothesis/frontend-shared/lib/next';
export type ConfirmModalProps = {
title?: string;
message: string;
message: ComponentChildren;
confirmAction?: string;
};
......@@ -43,13 +44,26 @@ export async function confirm({
};
render(
<ConfirmModal
<Modal
buttons={
<>
<Button data-testid="cancel-button" onClick={() => close(false)}>
Cancel
</Button>
<Button
data-testid="confirm-button"
variant="primary"
onClick={() => close(true)}
>
{confirmAction}
</Button>
</>
}
title={title}
message={message}
confirmAction={confirmAction}
onConfirm={() => close(true)}
onCancel={() => close(false)}
/>,
onClose={() => close(false)}
>
{message}
</Modal>,
container
);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment