Added subscriptions cancel
This commit is contained in:
parent
f17fd13c2a
commit
38b4769806
3 changed files with 10 additions and 5 deletions
|
|
@ -244,7 +244,7 @@ class SelectionMap extends Component {
|
||||||
bsStyle="warning"
|
bsStyle="warning"
|
||||||
onClick={event => this.onSndBtn(event)}
|
onClick={event => this.onSndBtn(event)}
|
||||||
>
|
>
|
||||||
{this.props.sndBtn}
|
{this.props.sndBtn.match(/^fa-/) ? <i className={`fa ${this.props.sndBtn}`} /> : this.props.sndBtn }
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
<Button
|
<Button
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ class SubscriptionEditor extends React.Component {
|
||||||
zoom={this.state.zoom}
|
zoom={this.state.zoom}
|
||||||
distance={doc.distance}
|
distance={doc.distance}
|
||||||
focusInput={focus}
|
focusInput={focus}
|
||||||
|
history={this.props.history}
|
||||||
disableFstBtn={this.state.disableFstBtn}
|
disableFstBtn={this.state.disableFstBtn}
|
||||||
subsBtn={isEdit ? t('Actualizar') : t(isAnyMobile ? 'Suscribirme a este radio' : 'Suscribirme a fuegos en este radio')}
|
subsBtn={isEdit ? t('Actualizar') : t(isAnyMobile ? 'Suscribirme a este radio' : 'Suscribirme a fuegos en este radio')}
|
||||||
onSubs={state => this.onSubs(state)}
|
onSubs={state => this.onSubs(state)}
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,7 @@ class FireSubscription extends React.Component {
|
||||||
zoom: this.props.zoom,
|
zoom: this.props.zoom,
|
||||||
distance: this.props.distance
|
distance: this.props.distance
|
||||||
};
|
};
|
||||||
/* if (props.location) {
|
this.onCancel = this.onCancel.bind(this);
|
||||||
console.log(props.location.state);
|
|
||||||
}
|
|
||||||
console.log(this.state); */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
@ -62,6 +59,10 @@ class FireSubscription extends React.Component {
|
||||||
this.props.onSubs(value);
|
this.props.onSubs(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onCancel() {
|
||||||
|
this.props.history.push('/subscriptions');
|
||||||
|
}
|
||||||
|
|
||||||
centerOnUserLocation(value) {
|
centerOnUserLocation(value) {
|
||||||
this.setState({ center: value.center });
|
this.setState({ center: value.center });
|
||||||
}
|
}
|
||||||
|
|
@ -103,6 +104,8 @@ class FireSubscription extends React.Component {
|
||||||
distance={this.state.distance}
|
distance={this.state.distance}
|
||||||
fstBtn={this.props.subsBtn}
|
fstBtn={this.props.subsBtn}
|
||||||
onFstBtn={state => this.onSubs(state)}
|
onFstBtn={state => this.onSubs(state)}
|
||||||
|
sndBtn="fa-times"
|
||||||
|
onSndBtn={this.onCancel}
|
||||||
onSelection={state => this.onSelection(state)}
|
onSelection={state => this.onSelection(state)}
|
||||||
action={action.add}
|
action={action.add}
|
||||||
disableFstBtn={this.props.disableFstBtn}
|
disableFstBtn={this.props.disableFstBtn}
|
||||||
|
|
@ -119,6 +122,7 @@ FireSubscription.propTypes = {
|
||||||
focusInput: PropTypes.bool.isRequired,
|
focusInput: PropTypes.bool.isRequired,
|
||||||
subsBtn: PropTypes.string.isRequired,
|
subsBtn: PropTypes.string.isRequired,
|
||||||
onSubs: PropTypes.func.isRequired,
|
onSubs: PropTypes.func.isRequired,
|
||||||
|
history: PropTypes.object.isRequired,
|
||||||
disableFstBtn: PropTypes.bool.isRequired
|
disableFstBtn: PropTypes.bool.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue