Replaces ConfirmationModal with ConfirmationDialog

This commit is contained in:
Josh Perez 2021-04-27 12:29:59 -07:00 committed by GitHub
parent c9d74654bf
commit e75bba1c52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 456 additions and 737 deletions

View file

@ -3,7 +3,7 @@
// This file is here temporarily while we're switching off of Backbone into
// React. In the future, and in React-land, please just import and use
// ConfirmationModal directly. This is the thin API layer to bridge the gap
// ConfirmationDialog directly. This is the thin API layer to bridge the gap
// while we convert things over. Please delete this file once all usages are
// ported over. Note: this file cannot have any imports/exports since it is
// being included in a <script /> tag.
@ -49,11 +49,10 @@ function showConfirmationDialog(options: ConfirmationDialogViewProps) {
window.ReactDOM.render(
// eslint-disable-next-line react/react-in-jsx-scope, react/jsx-no-undef
<window.Signal.Components.ConfirmationModal
<window.Signal.Components.ConfirmationDialog
actions={[
{
action: () => {
removeConfirmationDialog();
options.resolve();
},
style: options.confirmStyle,
@ -62,11 +61,13 @@ function showConfirmationDialog(options: ConfirmationDialogViewProps) {
]}
cancelText={options.cancelText || window.i18n('cancel')}
i18n={window.i18n}
onCancel={() => {
if (options.reject) {
options.reject(new Error('showConfirmationDialog: onCancel called'));
}
}}
onClose={() => {
removeConfirmationDialog();
if (options.reject) {
options.reject(new Error('showConfirmationDialog: onClose called'));
}
}}
title={options.message}
/>,