map_list: initial

urls: editing now handled through urls
This commit is contained in:
muerwre 2018-12-05 14:16:23 +07:00
parent 3771e5d338
commit 0d9bad9095
23 changed files with 386 additions and 68 deletions

View file

@ -1,12 +1,10 @@
export const getPath = () => (window.location && window.location.pathname &&
window.location.pathname.replace(/^\//, ''));
import { history } from '$redux/store';
export const pushPath = url => window.history.pushState(url, 'Редактирование маршрута', url);
export const getPath = () => (window.location && window.location.pathname);
export const pushPath = url => history.push(url);
export const getUrlData = () => {
const url = getPath();
const [path, mode] = url.split('/');
export const getUrlData = (url = getPath()) => {
const [, path, mode] = url.split('/');
const { host } = window.location;
return { path, mode, host };