0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Added back action to action list

no issue

- Adds back action to action list to allow pages to navigate back to last page
This commit is contained in:
Rish 2020-05-01 20:54:32 +05:30
parent ec407eae5f
commit 7dd4282520

View file

@ -110,6 +110,12 @@ export default class ParentContainer extends React.Component {
this.setState({
showPopup: !this.state.showPopup
});
} else if (action === 'back') {
if (this.state.lastPage) {
this.setState({
page: this.state.lastPage
});
}
} else if (action === 'closePopup') {
const {page: defaultPage} = this.getDefaultPage();
this.setState({
@ -187,6 +193,7 @@ export default class ParentContainer extends React.Component {
action: this.state.action,
brandColor: this.getBrandColor(),
page: this.state.page,
lastPage: this.state.lastPage,
onAction: (action, data) => this.onAction(action, data)
}}>
{this.renderPopup()}