Added error, loading modal and popover components

• Added:
- error, loading modal components
- error, loading popover components

• Removed:
- ModalLoading from async_components

• Updated:
- ModalRoot to use new components
This commit is contained in:
mgabdev
2020-07-21 16:48:55 -05:00
parent 7ea07d4a2b
commit 87f85131b7
9 changed files with 121 additions and 82 deletions

View File

@@ -1,9 +1,9 @@
import { Fragment } from 'react'
import { closeModal } from '../../actions/modal'
import { cancelReplyCompose } from '../../actions/compose'
import Bundle from '../../features/ui/util/bundle'
import ModalBase from './modal_base'
import BundleModalError from '../bundle_modal_error'
import BundleErrorModal from './bundle_error_modal'
import LoadingModal from './loading_modal'
import {
MODAL_BLOCK_ACCOUNT,
MODAL_BOOST,
@@ -152,11 +152,11 @@ class ModalRoot extends PureComponent {
}
renderLoading = () => {
return null
return <LoadingModal />
}
renderError = () => {
return <BundleModalError {...this.props} onClose={this.onClickClose} />
return <BundleErrorModal {...this.props} onClose={this.onClickClose} />
}
onClickClose = () => {
@@ -179,7 +179,7 @@ class ModalRoot extends PureComponent {
fetchComponent={MODAL_COMPONENTS[type]}
loading={this.renderLoading}
error={this.renderError}
renderDelay={200}
renderDelay={150}
>
{
(Component) => <Component {...props} onClose={this.onClickClose} />