2020-02-28 01:00:12 +01:00
|
|
|
import {Config} from "data";
|
2021-03-06 09:30:16 +01:00
|
|
|
import Logger from "common/logger";
|
2022-10-10 00:22:07 +02:00
|
|
|
import {WebpackModules, React, ReactDOM, Settings, Strings, DOMManager, DiscordModules, DiscordClasses} from "modules";
|
2020-07-16 07:42:56 +02:00
|
|
|
import FormattableString from "../structs/string";
|
2021-04-06 20:09:43 +02:00
|
|
|
import AddonErrorModal from "./addonerrormodal";
|
2020-11-03 02:47:08 +01:00
|
|
|
import ErrorBoundary from "./errorboundary";
|
2019-05-31 07:53:11 +02:00
|
|
|
|
2022-09-27 05:33:51 +02:00
|
|
|
|
2019-05-31 07:53:11 +02:00
|
|
|
export default class Modals {
|
|
|
|
|
2019-06-27 22:18:40 +02:00
|
|
|
static get shouldShowAddonErrors() {return Settings.get("settings", "addons", "addonErrors");}
|
2019-06-03 22:25:08 +02:00
|
|
|
|
2022-09-27 05:33:51 +02:00
|
|
|
static get ModalActions() {
|
2022-10-08 22:28:56 +02:00
|
|
|
return this._ModalActions ??= {
|
2022-10-09 19:49:29 +02:00
|
|
|
openModal: WebpackModules.getModule(m => m?.toString().includes("onCloseCallback") && m?.toString().includes("Layer"), {searchExports: true}),
|
|
|
|
closeModal: WebpackModules.getModule(m => m?.toString().includes("onCloseCallback()"), {searchExports: true})
|
2022-09-27 05:33:51 +02:00
|
|
|
};
|
|
|
|
}
|
2022-10-08 22:28:56 +02:00
|
|
|
static get ModalStack() {return this._ModalStack ??= WebpackModules.getByProps("push", "update", "pop", "popWithKey");}
|
|
|
|
static get ModalComponents() {return this._ModalComponents ??= WebpackModules.getByProps("Header", "Footer");}
|
2022-10-09 19:49:29 +02:00
|
|
|
static get ModalRoot() {return this._ModalRoot ??= WebpackModules.getModule(m => m?.toString?.()?.includes("ENTERING"), {searchExports: true});}
|
2022-10-08 22:28:56 +02:00
|
|
|
static get ModalClasses() {return this._ModalClasses ??= WebpackModules.getByProps("modal", "content");}
|
|
|
|
static get FlexElements() {return this._FlexElements ??= WebpackModules.getByProps("Child", "Align");}
|
|
|
|
static get TextElement() {return this._TextElement ??= WebpackModules.getModule(m => m?.Sizes?.SIZE_32 && m.Colors);}
|
2022-10-09 19:49:29 +02:00
|
|
|
static get ConfirmationModal() {return this._ConfirmationModal ??= WebpackModules.getModule(m => m?.toString?.()?.includes(".confirmButtonColor"));}
|
2022-10-08 22:28:56 +02:00
|
|
|
static get Markdown() {return this._Markdown ??= WebpackModules.find(m => m?.prototype?.render && m.rules);}
|
2022-10-09 19:49:29 +02:00
|
|
|
static get Buttons() {return this._Buttons ??= WebpackModules.getModule(m => m.BorderColors, {searchExports: true});}
|
2022-10-08 22:28:56 +02:00
|
|
|
static get ModalQueue() {return this._ModalQueue ??= [];}
|
|
|
|
|
|
|
|
static get hasModalOpen() {return !!document.getElementsByClassName("bd-modal").length;}
|
|
|
|
|
|
|
|
static async initialize() {
|
|
|
|
const names = ["ModalActions", "Markdown", "ModalRoot", "ModalComponents", "Buttons", "TextElement", "FlexElements"];
|
|
|
|
|
|
|
|
for (const name of names) {
|
|
|
|
const value = this[name];
|
|
|
|
|
|
|
|
if (!value) {
|
|
|
|
Logger.warn("Modals", `Missing ${name} module!`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static default(title, content, buttons = []) {
|
2022-10-02 09:34:34 +02:00
|
|
|
const modal = DOMManager.parseHTML(`<div class="bd-modal-wrapper theme-dark">
|
2020-07-16 07:42:56 +02:00
|
|
|
<div class="bd-backdrop backdrop-1wrmKB"></div>
|
|
|
|
<div class="bd-modal modal-1UGdnR">
|
|
|
|
<div class="bd-modal-inner inner-1JeGVc">
|
2019-05-31 07:53:11 +02:00
|
|
|
<div class="header header-1R_AjF">
|
|
|
|
<div class="title">${title}</div>
|
|
|
|
</div>
|
|
|
|
<div class="bd-modal-body">
|
|
|
|
<div class="scroller-wrap fade">
|
2022-10-08 22:28:56 +02:00
|
|
|
<div class="scroller"></div>
|
2019-05-31 07:53:11 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-10-08 22:28:56 +02:00
|
|
|
<div class="footer footer-2yfCgX footer-3rDWdC footer-2gL1pp"></div>
|
2019-05-31 07:53:11 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>`);
|
2022-10-08 22:28:56 +02:00
|
|
|
|
|
|
|
const handleClose = () => {
|
2020-07-16 23:17:02 +02:00
|
|
|
modal.classList.add("closing");
|
2022-10-08 22:28:56 +02:00
|
|
|
setTimeout(() => {
|
|
|
|
modal.remove();
|
|
|
|
|
|
|
|
const next = this.ModalQueue.shift();
|
|
|
|
if (!next) return;
|
|
|
|
|
|
|
|
next();
|
|
|
|
}, 300);
|
|
|
|
};
|
|
|
|
|
|
|
|
if (!buttons.length) {
|
|
|
|
buttons.push({
|
|
|
|
label: Strings.Modals.okay,
|
|
|
|
action: handleClose
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
const buttonContainer = modal.querySelector(".footer");
|
|
|
|
for (const button of buttons) {
|
|
|
|
const buttonEl = Object.assign(document.createElement("button"), {
|
|
|
|
onclick: (e) => {
|
2022-10-14 05:42:05 +02:00
|
|
|
try {
|
|
|
|
button.action(e);
|
|
|
|
}
|
|
|
|
catch (error) {
|
|
|
|
Logger.stacktrace("Modals", "Could not fire button listener", error);
|
|
|
|
}
|
2022-10-08 22:28:56 +02:00
|
|
|
|
|
|
|
handleClose();
|
|
|
|
},
|
|
|
|
type: "button",
|
|
|
|
className: "bd-button"
|
|
|
|
});
|
|
|
|
|
2022-10-14 05:42:05 +02:00
|
|
|
if (button.danger) buttonEl.classList.add("bd-button-danger");
|
2022-10-08 22:28:56 +02:00
|
|
|
|
|
|
|
buttonEl.append(button.label);
|
|
|
|
buttonContainer.appendChild(buttonEl);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Array.isArray(content) ? content.every(el => React.isValidElement(el)) : React.isValidElement(content)) {
|
|
|
|
const container = modal.querySelector(".scroller");
|
|
|
|
|
|
|
|
try {
|
|
|
|
ReactDOM.render(content, container);
|
2022-10-14 05:42:05 +02:00
|
|
|
}
|
|
|
|
catch (error) {
|
2022-10-08 22:28:56 +02:00
|
|
|
container.append(DOMManager.parseHTML(`<span style="color: red">There was an unexpected error. Modal could not be rendered.</span>`));
|
|
|
|
}
|
|
|
|
|
|
|
|
DOMManager.onRemoved(container, () => {
|
|
|
|
ReactDOM.unmountComponentAtNode(container);
|
|
|
|
});
|
2022-10-14 05:42:05 +02:00
|
|
|
}
|
|
|
|
else {
|
2022-10-08 22:28:56 +02:00
|
|
|
modal.querySelector(".scroller").append(content);
|
|
|
|
}
|
|
|
|
|
|
|
|
modal.querySelector(".footer button").addEventListener("click", handleClose);
|
|
|
|
modal.querySelector(".bd-backdrop").addEventListener("click", handleClose);
|
|
|
|
|
|
|
|
const handleOpen = () => document.getElementById("app-mount").append(modal);
|
|
|
|
|
|
|
|
if (this.hasModalOpen) {
|
|
|
|
this.ModalQueue.push(handleOpen);
|
2022-10-14 05:42:05 +02:00
|
|
|
}
|
|
|
|
else {
|
2022-10-08 22:28:56 +02:00
|
|
|
handleOpen();
|
|
|
|
}
|
2019-05-31 07:53:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static alert(title, content) {
|
2021-04-06 20:09:43 +02:00
|
|
|
this.showConfirmationModal(title, content, {cancelText: null});
|
2019-05-31 07:53:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shows a generic but very customizable confirmation modal with optional confirm and cancel callbacks.
|
|
|
|
* @param {string} title - title of the modal
|
2020-07-16 07:42:56 +02:00
|
|
|
* @param {(string|ReactElement|Array<string|ReactElement>)} children - a single or mixed array of react elements and strings. Everything is wrapped in Discord's `Markdown` component so strings will show and render properly.
|
2019-05-31 07:53:11 +02:00
|
|
|
* @param {object} [options] - options to modify the modal
|
|
|
|
* @param {boolean} [options.danger=false] - whether the main button should be red or not
|
|
|
|
* @param {string} [options.confirmText=Okay] - text for the confirmation/submit button
|
|
|
|
* @param {string} [options.cancelText=Cancel] - text for the cancel button
|
|
|
|
* @param {callable} [options.onConfirm=NOOP] - callback to occur when clicking the submit button
|
|
|
|
* @param {callable} [options.onCancel=NOOP] - callback to occur when clicking the cancel button
|
2020-07-16 07:42:56 +02:00
|
|
|
* @param {string} [options.key] - key used to identify the modal. If not provided, one is generated and returned
|
|
|
|
* @returns {string} - the key used for this modal
|
2019-05-31 07:53:11 +02:00
|
|
|
*/
|
|
|
|
static showConfirmationModal(title, content, options = {}) {
|
2020-07-16 07:42:56 +02:00
|
|
|
const Markdown = this.Markdown;
|
2019-05-31 07:53:11 +02:00
|
|
|
const ConfirmationModal = this.ConfirmationModal;
|
2020-07-18 04:24:20 +02:00
|
|
|
const ModalActions = this.ModalActions;
|
2022-10-08 22:28:56 +02:00
|
|
|
|
2020-07-16 07:42:56 +02:00
|
|
|
if (content instanceof FormattableString) content = content.toString();
|
2019-05-31 07:53:11 +02:00
|
|
|
|
|
|
|
const emptyFunction = () => {};
|
2020-07-16 07:42:56 +02:00
|
|
|
const {onConfirm = emptyFunction, onCancel = emptyFunction, confirmText = Strings.Modals.okay, cancelText = Strings.Modals.cancel, danger = false, key = undefined} = options;
|
2021-04-05 07:43:30 +02:00
|
|
|
|
2022-10-14 05:42:05 +02:00
|
|
|
if (!this.ModalActions || !this.ConfirmationModal || !this.Markdown) {
|
|
|
|
return this.default(title, content, [
|
|
|
|
confirmText && {label: confirmText, action: onConfirm},
|
|
|
|
cancelText && {label: cancelText, action: onCancel, danger}
|
|
|
|
].filter(Boolean));
|
|
|
|
}
|
2022-10-08 22:28:56 +02:00
|
|
|
|
2020-07-16 07:42:56 +02:00
|
|
|
if (!Array.isArray(content)) content = [content];
|
|
|
|
content = content.map(c => typeof(c) === "string" ? React.createElement(Markdown, null, c) : c);
|
|
|
|
|
2022-10-14 05:42:05 +02:00
|
|
|
const modalKey = ModalActions.openModal(props => {
|
2022-10-08 22:28:56 +02:00
|
|
|
return React.createElement(ErrorBoundary, {
|
|
|
|
onError: () => {
|
|
|
|
setTimeout(() => {
|
|
|
|
ModalActions.closeModal(modalKey);
|
|
|
|
this.default(title, content, [
|
|
|
|
confirmText && {label: confirmText, action: onConfirm},
|
|
|
|
cancelText && {label: cancelText, action: onCancel, danger}
|
|
|
|
].filter(Boolean));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, React.createElement(ConfirmationModal, Object.assign({
|
2020-07-18 04:24:20 +02:00
|
|
|
header: title,
|
2022-09-27 05:33:51 +02:00
|
|
|
confirmButtonColor: danger ? this.Buttons.Colors.RED : this.Buttons.Colors.BRAND,
|
2020-07-18 04:24:20 +02:00
|
|
|
confirmText: confirmText,
|
|
|
|
cancelText: cancelText,
|
|
|
|
onConfirm: onConfirm,
|
|
|
|
onCancel: onCancel
|
2022-10-08 22:28:56 +02:00
|
|
|
}, props), React.createElement(ErrorBoundary, {}, content)));
|
2020-07-18 04:24:20 +02:00
|
|
|
}, {modalKey: key});
|
2022-10-08 22:28:56 +02:00
|
|
|
return modalKey;
|
2019-05-31 07:53:11 +02:00
|
|
|
}
|
|
|
|
|
2019-06-27 22:18:40 +02:00
|
|
|
static showAddonErrors({plugins: pluginErrors = [], themes: themeErrors = []}) {
|
|
|
|
if (!pluginErrors || !themeErrors || !this.shouldShowAddonErrors) return;
|
2019-05-31 07:53:11 +02:00
|
|
|
if (!pluginErrors.length && !themeErrors.length) return;
|
2021-04-06 20:09:43 +02:00
|
|
|
|
|
|
|
if (this.addonErrorsRef && this.addonErrorsRef.current) {
|
|
|
|
return this.addonErrorsRef.current.refreshTabs(Array.isArray(pluginErrors) ? pluginErrors : [], Array.isArray(themeErrors) ? themeErrors : []);
|
|
|
|
}
|
|
|
|
|
|
|
|
this.addonErrorsRef = React.createRef();
|
2022-10-08 22:28:56 +02:00
|
|
|
this.ModalActions.openModal(props => React.createElement(ErrorBoundary, null, React.createElement(this.ModalRoot, Object.assign(props, {
|
2021-04-06 20:09:43 +02:00
|
|
|
size: "medium",
|
2021-04-16 00:08:00 +02:00
|
|
|
className: "bd-error-modal",
|
|
|
|
children: [
|
|
|
|
React.createElement(AddonErrorModal, {
|
|
|
|
ref: this.addonErrorsRef,
|
|
|
|
pluginErrors: Array.isArray(pluginErrors) ? pluginErrors : [],
|
|
|
|
themeErrors: Array.isArray(themeErrors) ? themeErrors : [],
|
|
|
|
onClose: props.onClose
|
|
|
|
}),
|
2022-09-27 05:33:51 +02:00
|
|
|
React.createElement(this.ModalComponents.Footer, {
|
2021-04-16 00:08:00 +02:00
|
|
|
className: "bd-error-modal-footer",
|
2022-09-27 05:33:51 +02:00
|
|
|
}, React.createElement(this.Buttons, {
|
2021-04-16 00:08:00 +02:00
|
|
|
onClick: props.onClose,
|
|
|
|
className: "bd-button"
|
|
|
|
}, Strings.Modals.okay))
|
|
|
|
]
|
2022-10-08 22:28:56 +02:00
|
|
|
}))));
|
2019-05-31 07:53:11 +02:00
|
|
|
}
|
2020-02-28 01:00:12 +01:00
|
|
|
|
2022-10-10 00:22:07 +02:00
|
|
|
static showChangelogModal(options = {}) {
|
|
|
|
const OriginalModalClasses = WebpackModules.getByProps("hideOnFullscreen", "root");
|
|
|
|
const ChangelogModalClasses = WebpackModules.getModule(m => m.modal && m.maxModalWidth);
|
2020-02-28 01:00:12 +01:00
|
|
|
const ChangelogClasses = WebpackModules.getByProps("fixed", "improved");
|
2022-10-10 00:22:07 +02:00
|
|
|
const TextElement = this.TextElement;
|
|
|
|
const FlexChild = this.FlexElements;
|
2020-02-28 01:00:12 +01:00
|
|
|
const MarkdownParser = WebpackModules.getByProps("defaultRules", "parse");
|
2022-10-10 00:22:07 +02:00
|
|
|
|
2022-10-18 00:05:08 +02:00
|
|
|
if (!OriginalModalClasses || !ChangelogModalClasses || !ChangelogClasses || !TextElement || !FlexChild || !MarkdownParser) return Logger.warn("Modals", "showChangelogModal missing modules");
|
2021-04-05 07:43:30 +02:00
|
|
|
|
2022-02-01 04:21:39 +01:00
|
|
|
const {image = "https://i.imgur.com/wuh5yMK.png", description = "", changes = [], title = "BetterDiscord", subtitle = `v${Config.version}`, footer} = options;
|
2020-02-28 01:00:12 +01:00
|
|
|
const ce = React.createElement;
|
2020-07-26 11:34:38 +02:00
|
|
|
const changelogItems = [options.video ? ce("video", {src: options.video, poster: options.poster, controls: true, className: ChangelogClasses.video}) : ce("img", {src: image})];
|
2020-02-28 01:00:12 +01:00
|
|
|
if (description) changelogItems.push(ce("p", null, MarkdownParser.parse(description)));
|
|
|
|
for (let c = 0; c < changes.length; c++) {
|
|
|
|
const entry = changes[c];
|
|
|
|
const type = ChangelogClasses[entry.type] ? ChangelogClasses[entry.type] : ChangelogClasses.added;
|
|
|
|
const margin = c == 0 ? ChangelogClasses.marginTop : "";
|
|
|
|
changelogItems.push(ce("h1", {className: `${type} ${margin}`,}, entry.title));
|
2022-02-06 00:32:05 +01:00
|
|
|
if (entry.description) changelogItems.push(ce("p", null, MarkdownParser.parse(entry.description)));
|
2020-02-28 01:00:12 +01:00
|
|
|
const list = ce("ul", null, entry.items.map(i => ce("li", null, MarkdownParser.parse(i))));
|
|
|
|
changelogItems.push(list);
|
|
|
|
}
|
|
|
|
const renderHeader = function() {
|
2022-10-10 00:22:07 +02:00
|
|
|
return ce(FlexChild, {className: OriginalModalClasses.header, grow: 0, shrink: 0, direction: FlexChild.Direction.VERTICAL},
|
2022-10-18 00:05:08 +02:00
|
|
|
ce(TextElement, {tag: "h1", size: TextElement.Sizes.SIZE_20, strong: true}, title),
|
2022-10-10 00:22:07 +02:00
|
|
|
ce(TextElement, {size: TextElement.Sizes.SIZE_12, color: TextElement.Colors.STANDARD, className: ChangelogClasses.date}, subtitle)
|
2020-02-28 01:00:12 +01:00
|
|
|
);
|
|
|
|
};
|
2021-04-05 07:43:30 +02:00
|
|
|
|
2020-02-28 01:00:12 +01:00
|
|
|
const renderFooter = () => {
|
|
|
|
const AnchorClasses = WebpackModules.getByProps("anchorUnderlineOnHover") || {anchor: "anchor-3Z-8Bb", anchorUnderlineOnHover: "anchorUnderlineOnHover-2ESHQB"};
|
|
|
|
const joinSupportServer = (click) => {
|
|
|
|
click.preventDefault();
|
|
|
|
click.stopPropagation();
|
2022-10-18 00:05:08 +02:00
|
|
|
DiscordModules.InviteActions.acceptInviteAndTransitionToInviteChannel({inviteKey: "0Tmfo5ZbORCRqbAd"});
|
2020-02-28 01:00:12 +01:00
|
|
|
};
|
2022-10-10 00:22:07 +02:00
|
|
|
const supportLink = ce("a", {className: `${AnchorClasses.anchor} ${AnchorClasses.anchorUnderlineOnHover}`, onClick: joinSupportServer}, "Join our Discord Server.");
|
|
|
|
const defaultFooter = ce(TextElement, {size: TextElement.Sizes.SIZE_12, color: TextElement.Colors.STANDARD}, "Need support? ", supportLink);
|
|
|
|
return ce(FlexChild, {className: OriginalModalClasses.footer + " " + OriginalModalClasses.footerSeparator},
|
|
|
|
ce(FlexChild.Child, {grow: 1, shrink: 1}, footer ? footer : defaultFooter)
|
|
|
|
);
|
2020-02-28 01:00:12 +01:00
|
|
|
};
|
2020-07-26 11:34:38 +02:00
|
|
|
|
2022-10-10 00:22:07 +02:00
|
|
|
const body = ce("div", {
|
|
|
|
className: `${OriginalModalClasses.content} ${ChangelogClasses.container} ${ChangelogModalClasses.content} ${DiscordClasses.Scrollers.thin}`
|
|
|
|
}, changelogItems);
|
|
|
|
|
|
|
|
const key = this.ModalActions.openModal(props => {
|
|
|
|
return React.createElement(ErrorBoundary, null, React.createElement(this.ModalRoot, Object.assign({
|
|
|
|
className: `bd-changelog-modal ${OriginalModalClasses.root} ${OriginalModalClasses.small} ${ChangelogModalClasses.modal}`,
|
2020-07-26 11:34:38 +02:00
|
|
|
selectable: true,
|
|
|
|
onScroll: _ => _,
|
|
|
|
onClose: _ => _,
|
2022-10-10 00:22:07 +02:00
|
|
|
}, props), renderHeader(), body, renderFooter()));
|
2020-02-28 01:00:12 +01:00
|
|
|
});
|
2020-07-26 11:34:38 +02:00
|
|
|
return key;
|
2020-02-28 01:00:12 +01:00
|
|
|
}
|
2020-11-03 02:47:08 +01:00
|
|
|
|
|
|
|
static showAddonSettingsModal(name, panel) {
|
|
|
|
|
|
|
|
let child = panel;
|
|
|
|
if (panel instanceof Node || typeof(panel) === "string") {
|
|
|
|
child = class ReactWrapper extends React.Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
this.elementRef = React.createRef();
|
|
|
|
this.element = panel;
|
|
|
|
}
|
2021-04-05 07:43:30 +02:00
|
|
|
|
2020-11-03 02:47:08 +01:00
|
|
|
componentDidMount() {
|
|
|
|
if (this.element instanceof Node) this.elementRef.current.appendChild(this.element);
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const props = {
|
|
|
|
className: "bd-addon-settings-wrap",
|
|
|
|
ref: this.elementRef
|
|
|
|
};
|
|
|
|
if (typeof(this.element) === "string") props.dangerouslySetInnerHTML = {__html: this.element};
|
|
|
|
return React.createElement("div", props);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
if (typeof(child) === "function") child = React.createElement(child);
|
|
|
|
|
|
|
|
const mc = this.ModalComponents;
|
|
|
|
const modal = props => {
|
2022-09-27 05:33:51 +02:00
|
|
|
return React.createElement(ErrorBoundary, {}, React.createElement(this.ModalRoot, Object.assign({size: mc.Sizes.MEDIUM, className: "bd-addon-modal" + " " + mc.Sizes.MEDIUM}, props),
|
|
|
|
React.createElement(mc.Header, {separator: false, className: "bd-addon-modal-header"},
|
2022-10-18 00:05:08 +02:00
|
|
|
React.createElement(this.TextElement, {tag: "h1", size: this.TextElement.Sizes.SIZE_20, strong: true}, `${name} Settings`)
|
2020-11-03 02:47:08 +01:00
|
|
|
),
|
2022-09-27 05:33:51 +02:00
|
|
|
React.createElement(mc.Content, {className: "bd-addon-modal-settings"},
|
2021-04-05 07:43:30 +02:00
|
|
|
React.createElement(ErrorBoundary, {}, child)
|
2020-11-03 02:47:08 +01:00
|
|
|
),
|
2022-09-27 05:33:51 +02:00
|
|
|
React.createElement(mc.Footer, {className: "bd-addon-modal-footer"},
|
|
|
|
React.createElement(this.Buttons, {onClick: props.onClose, className: "bd-button"}, Strings.Modals.done)
|
2020-11-03 02:47:08 +01:00
|
|
|
)
|
2022-09-27 05:33:51 +02:00
|
|
|
));
|
2020-11-03 02:47:08 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
return this.ModalActions.openModal(props => {
|
2022-10-08 22:28:56 +02:00
|
|
|
return React.createElement(ErrorBoundary, null, React.createElement(modal, props));
|
2020-11-03 02:47:08 +01:00
|
|
|
});
|
|
|
|
}
|
2022-10-08 22:28:56 +02:00
|
|
|
}
|