This commit is contained in:
mgabdev
2020-05-01 01:50:27 -04:00
parent c15d4f12dc
commit 8e349c368c
99 changed files with 1268 additions and 887 deletions

View File

@@ -1,6 +1,8 @@
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 {
MODAL_ACTIONS,
MODAL_BLOCK_ACCOUNT,
@@ -64,9 +66,6 @@ import {
VideoModal,
} from '../../features/ui/util/async_components'
import ModalBase from './modal_base'
import BundleModalError from '../bundle_modal_error'
const MODAL_COMPONENTS = {}
MODAL_COMPONENTS[MODAL_ACTIONS] = ActionsModal
MODAL_COMPONENTS[MODAL_BLOCK_ACCOUNT] = BlockAccountModal
@@ -135,12 +134,12 @@ class ModalRoot extends PureComponent {
}
}
renderLoading = modalId => () => {
return ['MEDIA', 'VIDEO', 'BOOST', 'CONFIRM', 'ACTIONS'].indexOf(modalId) === -1 ? <ModalLoading /> : null
renderLoading = () => {
return <ModalLoading />
}
renderError = (props) => {
return <BundleModalError {...props} onClose={this.onClickClose} />
renderError = () => {
return <BundleModalError {...this.props} onClose={this.onClickClose} />
}
onClickClose = () => {
@@ -157,12 +156,12 @@ class ModalRoot extends PureComponent {
visible &&
<Bundle
fetchComponent={MODAL_COMPONENTS[type]}
loading={this.renderLoading(type)}
loading={this.renderLoading}
error={this.renderError}
renderDelay={200}
>
{
(SpecificComponent) => <SpecificComponent {...props} onClose={this.onClickClose} />
(Component) => <Component {...props} onClose={this.onClickClose} />
}
</Bundle>
}