mirror of
https://github.com/maputnik/editor.git
synced 2026-09-12 07:17:26 +00:00
9540686b40
Keeps the repo clean, same as several other of our repos --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
49 lines
1.2 KiB
TypeScript
49 lines
1.2 KiB
TypeScript
import React from 'react'
|
|
|
|
import InputButton from './InputButton'
|
|
import Modal from './Modal'
|
|
import { WithTranslation, withTranslation } from 'react-i18next';
|
|
|
|
|
|
type ModalLoadingInternalProps = {
|
|
isOpen: boolean
|
|
onCancel(...args: unknown[]): unknown
|
|
title: string
|
|
message: React.ReactNode
|
|
} & WithTranslation;
|
|
|
|
|
|
class ModalLoadingInternal extends React.Component<ModalLoadingInternalProps> {
|
|
underlayOnClick(e: Event) {
|
|
// This stops click events falling through to underlying modals.
|
|
e.stopPropagation();
|
|
}
|
|
|
|
render() {
|
|
const t = this.props.t;
|
|
return <Modal
|
|
data-wd-key="modal:loading"
|
|
isOpen={this.props.isOpen}
|
|
underlayClickExits={false}
|
|
underlayProps={{
|
|
// @ts-ignore
|
|
onClick: (e: Event) => underlayProps(e)
|
|
}}
|
|
title={this.props.title}
|
|
onOpenToggle={() => this.props.onCancel()}
|
|
>
|
|
<p>
|
|
{this.props.message}
|
|
</p>
|
|
<p className="maputnik-dialog__buttons">
|
|
<InputButton onClick={(e) => this.props.onCancel(e)}>
|
|
{t("Cancel")}
|
|
</InputButton>
|
|
</p>
|
|
</Modal>
|
|
}
|
|
}
|
|
|
|
const ModalLoading = withTranslation()(ModalLoadingInternal);
|
|
export default ModalLoading;
|