Added subscriptions cancel
This commit is contained in:
parent
f17fd13c2a
commit
38b4769806
3 changed files with 10 additions and 5 deletions
|
|
@ -20,10 +20,7 @@ class FireSubscription extends React.Component {
|
|||
zoom: this.props.zoom,
|
||||
distance: this.props.distance
|
||||
};
|
||||
/* if (props.location) {
|
||||
console.log(props.location.state);
|
||||
}
|
||||
console.log(this.state); */
|
||||
this.onCancel = this.onCancel.bind(this);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
|
@ -62,6 +59,10 @@ class FireSubscription extends React.Component {
|
|||
this.props.onSubs(value);
|
||||
}
|
||||
|
||||
onCancel() {
|
||||
this.props.history.push('/subscriptions');
|
||||
}
|
||||
|
||||
centerOnUserLocation(value) {
|
||||
this.setState({ center: value.center });
|
||||
}
|
||||
|
|
@ -103,6 +104,8 @@ class FireSubscription extends React.Component {
|
|||
distance={this.state.distance}
|
||||
fstBtn={this.props.subsBtn}
|
||||
onFstBtn={state => this.onSubs(state)}
|
||||
sndBtn="fa-times"
|
||||
onSndBtn={this.onCancel}
|
||||
onSelection={state => this.onSelection(state)}
|
||||
action={action.add}
|
||||
disableFstBtn={this.props.disableFstBtn}
|
||||
|
|
@ -119,6 +122,7 @@ FireSubscription.propTypes = {
|
|||
focusInput: PropTypes.bool.isRequired,
|
||||
subsBtn: PropTypes.string.isRequired,
|
||||
onSubs: PropTypes.func.isRequired,
|
||||
history: PropTypes.object.isRequired,
|
||||
disableFstBtn: PropTypes.bool.isRequired
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue