Auto redirect to edit page after event creation
This commit is contained in:
1 parent
3d33b0f8bc
commit
dc10e4d629
2 files changed
+6
-10
No files matched your search
@@ -31,6 +31,7 @@ class New extends React.Component {
|
||||
query: HOSTS_EVENTSBYHOST,
|
||||
data: { hosts_EventsByHost: hostedEvents.concat([data.hosts_HostEvent]) }
|
||||
})
|
||||
this.props.handleNewEvent(data.hosts_HostEvent)
|
||||
}
|
||||
}
|
||||
>
|
||||
@@ -45,7 +46,6 @@ class New extends React.Component {
|
||||
startDatetime: startDatetime.valueOf() / 1000,
|
||||
finishDatetime: startDatetime.valueOf() / 1000
|
||||
} })
|
||||
this.props.handleNewEventClose()
|
||||
}}
|
||||
>
|
||||
<TextField
|
||||
|
||||
@@ -24,12 +24,8 @@ class HostedEvent extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
handleNewEventOpen = () => {
|
||||
this.setState({ isNewEventOpen: true })
|
||||
};
|
||||
|
||||
handleNewEventClose = () => {
|
||||
this.setState({ isNewEventOpen: false })
|
||||
handleNewEvent = (event) => {
|
||||
this.props.history.push(`/${event.designator}`)
|
||||
};
|
||||
|
||||
render () {
|
||||
@@ -58,12 +54,12 @@ class HostedEvent extends React.Component {
|
||||
<React.Fragment>
|
||||
<Button variant='contained' color='secondary'
|
||||
aria-label='addNewEvent' className={classes.centered}
|
||||
onClick={this.handleNewEventOpen} >
|
||||
onClick={() => { this.setState({ isNewEventOpen: true }) }} >
|
||||
Host another event
|
||||
</Button>
|
||||
<Dialog
|
||||
open={this.state.isNewEventOpen}
|
||||
onClose={this.handleNewEventClose}
|
||||
onClose={() => { this.setState({ isNewEventOpen: false }) }}
|
||||
aria-labelledby='addEvent-dialog-title'
|
||||
>
|
||||
<DialogTitle id='addEvent-dialog-title'>
|
||||
@@ -73,7 +69,7 @@ class HostedEvent extends React.Component {
|
||||
<DialogContentText>
|
||||
Here you will add just the minimal information, will be settable in the edit page of your event.
|
||||
</DialogContentText>
|
||||
<New handleNewEventClose={this.handleNewEventClose} classes={classes} />
|
||||
<New handleNewEvent={this.handleNewEvent} classes={classes} />
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</React.Fragment>
|
||||
|
||||
Reference in new issue
Block a user