mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
dont close map list on click
This commit is contained in:
parent
46a7d30f8a
commit
25630a30b8
5 changed files with 15 additions and 68 deletions
|
@ -1,53 +0,0 @@
|
||||||
// @flow
|
|
||||||
import React from 'react';
|
|
||||||
// import { bindActionCreators } from 'redux';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { RouteRow } from '$components/maps/RouteRow';
|
|
||||||
import type { Route } from '$constants/types';
|
|
||||||
import { Scroll } from '$components/Scroll';
|
|
||||||
|
|
||||||
type Props = {
|
|
||||||
routes: { [id: String]: Route },
|
|
||||||
editing: Boolean,
|
|
||||||
routes_sorted: Array<string>,
|
|
||||||
};
|
|
||||||
|
|
||||||
const Component = ({ routes, editing, routes_sorted }: Props) => (
|
|
||||||
<div className="dialog-content">
|
|
||||||
<div className="dialog-head">
|
|
||||||
<div className="dialog-head-title">
|
|
||||||
Ваши маршруты
|
|
||||||
</div>
|
|
||||||
<div className="small gray">
|
|
||||||
{
|
|
||||||
routes_sorted.length > 0
|
|
||||||
? `${routes_sorted.length} шт.`
|
|
||||||
: '(здесь пока ничего нет)'
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<Scroll className="dialog-shader">
|
|
||||||
<div className="dialog-maplist">
|
|
||||||
{
|
|
||||||
routes_sorted.map(id => (
|
|
||||||
<RouteRow
|
|
||||||
editing={editing}
|
|
||||||
{...routes[id]}
|
|
||||||
key={id}
|
|
||||||
/>
|
|
||||||
))
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</Scroll>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
const mapStateToProps = ({ user: { editing, user: { routes } } }) => ({
|
|
||||||
routes,
|
|
||||||
editing,
|
|
||||||
routes_sorted: Object.keys(routes).sort((a, b) => (Date.parse(routes[b].updated_at) - Date.parse(routes[a].updated_at))),
|
|
||||||
});
|
|
||||||
|
|
||||||
// const mapDispatchToProps = dispatch => bindActionCreators({}, dispatch);
|
|
||||||
|
|
||||||
export const MapListDialog = connect(mapStateToProps)(Component);
|
|
|
@ -46,7 +46,7 @@ class Component extends React.Component<Props> {
|
||||||
|
|
||||||
openRoute = _id => {
|
openRoute = _id => {
|
||||||
pushPath(`/${_id}/${this.props.editing ? 'edit' : ''}`);
|
pushPath(`/${_id}/${this.props.editing ? 'edit' : ''}`);
|
||||||
this.props.setDialogActive(false);
|
// this.props.setDialogActive(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@ -70,26 +70,26 @@ class Component extends React.Component<Props> {
|
||||||
return (
|
return (
|
||||||
<div className="dialog-content">
|
<div className="dialog-content">
|
||||||
{ list.length === 0 && loading &&
|
{ list.length === 0 && loading &&
|
||||||
<div className="dialog-maplist-loader">
|
<div className="dialog-maplist-loader">
|
||||||
<div className="dialog-maplist-icon spin">
|
<div className="dialog-maplist-icon spin">
|
||||||
<Icon icon="icon-sync-1" />
|
<Icon icon="icon-sync-1" />
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
{ ready && !loading && list.length === 0 &&
|
{ ready && !loading && list.length === 0 &&
|
||||||
<div className="dialog-maplist-loader">
|
<div className="dialog-maplist-loader">
|
||||||
<div className="dialog-maplist-icon">
|
<div className="dialog-maplist-icon">
|
||||||
<Icon icon="icon-sad-1" />
|
<Icon icon="icon-sad-1" />
|
||||||
</div>
|
|
||||||
ТУТ ПУСТО <br />
|
|
||||||
И ОДИНОКО
|
|
||||||
</div>
|
</div>
|
||||||
|
ТУТ ПУСТО <br />
|
||||||
|
И ОДИНОКО
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
<div className="dialog-tabs">
|
<div className="dialog-tabs">
|
||||||
{
|
{
|
||||||
Object.keys(TABS).map(item => (
|
Object.keys(TABS).map(item => (
|
||||||
<div
|
<div
|
||||||
className={classnames('dialog-tab', { active: tab === item})}
|
className={classnames('dialog-tab', { active: tab === item })}
|
||||||
onClick={() => this.props.searchSetTab(item)}
|
onClick={() => this.props.searchSetTab(item)}
|
||||||
key={item}
|
key={item}
|
||||||
>
|
>
|
||||||
|
@ -150,7 +150,7 @@ class Component extends React.Component<Props> {
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapStateToProps = ({ user: { editing, routes } }) => {
|
const mapStateToProps = ({ user: { editing, routes } }) => {
|
||||||
if (routes.filter.max >= 9999){
|
if (routes.filter.max >= 9999) {
|
||||||
return {
|
return {
|
||||||
routes, editing, marks: {}, ready: false,
|
routes, editing, marks: {}, ready: false,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// @flow
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Icon } from '$components/panels/Icon';
|
import { Icon } from '$components/panels/Icon';
|
||||||
import { pushPath } from '$utils/history';
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
title: String,
|
title: String,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// @flow
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { DIALOGS } from '$constants/dialogs';
|
import { DIALOGS } from '$constants/dialogs';
|
||||||
import { MapListDialog } from '$components/dialogs/MapListDialog';
|
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { AppInfoDialog } from '$components/dialogs/AppInfoDialog';
|
import { AppInfoDialog } from '$components/dialogs/AppInfoDialog';
|
||||||
import { Icon } from '$components/panels/Icon';
|
import { Icon } from '$components/panels/Icon';
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
|
||||||
todo save spinner
|
todo save spinner
|
||||||
todo cancelling editing someone's else map return back to it's original address /razminochnyj/
|
todo cancelling editing someone's else map return back to it's original address /razminochnyj/
|
||||||
|
|
||||||
|
@ -29,6 +30,7 @@
|
||||||
|
|
||||||
OBLIVION STARTS HERE:
|
OBLIVION STARTS HERE:
|
||||||
|
|
||||||
|
done dont close map list on click
|
||||||
done fix loaded stickers has wrong text placement for right-sided captions
|
done fix loaded stickers has wrong text placement for right-sided captions
|
||||||
done fix save button should not react to clicks
|
done fix save button should not react to clicks
|
||||||
done stickers with empty text should not have blackbox at view mode
|
done stickers with empty text should not have blackbox at view mode
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue