fix: publish success modal navigation
This commit is contained in:
parent
08b30fe0f2
commit
19906171c8
2 changed files with 5 additions and 3 deletions
|
@ -2,10 +2,12 @@ import { connect } from 'react-redux';
|
||||||
import { doHideModal } from 'redux/actions/app';
|
import { doHideModal } from 'redux/actions/app';
|
||||||
import ModalSendTip from './view';
|
import ModalSendTip from './view';
|
||||||
import { doClearPublish } from 'redux/actions/publish';
|
import { doClearPublish } from 'redux/actions/publish';
|
||||||
|
import { push } from 'connected-react-router';
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
closeModal: () => dispatch(doHideModal()),
|
closeModal: () => dispatch(doHideModal()),
|
||||||
clearPublish: () => dispatch(doClearPublish()),
|
clearPublish: () => dispatch(doClearPublish()),
|
||||||
|
navigate: path => dispatch(push(path)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
|
|
|
@ -9,7 +9,7 @@ type Props = {
|
||||||
uri: string,
|
uri: string,
|
||||||
};
|
};
|
||||||
|
|
||||||
class ModalSendTip extends React.PureComponent<Props> {
|
class ModalPublishSuccess extends React.PureComponent<Props> {
|
||||||
render() {
|
render() {
|
||||||
const { closeModal, clearPublish, navigate, uri } = this.props;
|
const { closeModal, clearPublish, navigate, uri } = this.props;
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ class ModalSendTip extends React.PureComponent<Props> {
|
||||||
contentLabel={__('File published')}
|
contentLabel={__('File published')}
|
||||||
onConfirmed={() => {
|
onConfirmed={() => {
|
||||||
clearPublish();
|
clearPublish();
|
||||||
navigate('/published');
|
navigate('/$/published');
|
||||||
closeModal();
|
closeModal();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -38,4 +38,4 @@ class ModalSendTip extends React.PureComponent<Props> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ModalSendTip;
|
export default ModalPublishSuccess;
|
||||||
|
|
Loading…
Reference in a new issue