mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-28 12:36:41 +07:00
routes: hiding map dialog on map select
This commit is contained in:
parent
c5b6fcf011
commit
f325824da3
3 changed files with 17 additions and 6 deletions
|
@ -8,12 +8,14 @@ import {
|
|||
searchSetDistance,
|
||||
searchSetTitle,
|
||||
searchSetTab,
|
||||
setDialogActive,
|
||||
} from '$redux/user/actions';
|
||||
import classnames from 'classnames';
|
||||
|
||||
import { Range } from 'rc-slider';
|
||||
import { TABS } from '$constants/dialogs';
|
||||
import { Icon } from '$components/panels/Icon';
|
||||
import { pushPath } from '$utils/history';
|
||||
|
||||
type Props = {
|
||||
ready: Boolean,
|
||||
|
@ -31,10 +33,10 @@ type Props = {
|
|||
editing: Boolean,
|
||||
routes_sorted: Array<string>,
|
||||
|
||||
searchSetAuthor: Function,
|
||||
searchSetDistance: Function,
|
||||
searchSetTitle: Function,
|
||||
searchSetTab: Function,
|
||||
setDialogActive: Function,
|
||||
};
|
||||
|
||||
class Component extends React.Component<Props> {
|
||||
|
@ -42,6 +44,11 @@ class Component extends React.Component<Props> {
|
|||
this.props.searchSetTitle(value);
|
||||
};
|
||||
|
||||
openRoute = _id => {
|
||||
pushPath(`/${_id}/${this.props.editing ? 'edit' : ''}`);
|
||||
this.props.setDialogActive(false);
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
ready,
|
||||
|
@ -130,6 +137,7 @@ class Component extends React.Component<Props> {
|
|||
editing={editing}
|
||||
{...route}
|
||||
key={route._id}
|
||||
openRoute={this.openRoute}
|
||||
/>
|
||||
))
|
||||
}
|
||||
|
@ -164,6 +172,7 @@ const mapDispatchToProps = dispatch => bindActionCreators({
|
|||
searchSetDistance,
|
||||
searchSetTitle,
|
||||
searchSetTab,
|
||||
setDialogActive,
|
||||
}, dispatch);
|
||||
|
||||
export const MapListMoreDialog = connect(mapStateToProps, mapDispatchToProps)(Component);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue