enabling / disabling editor from url

This commit is contained in:
muerwre 2018-08-29 14:43:21 +07:00
parent b35a063cd7
commit e3e209ff65
5 changed files with 70 additions and 38 deletions

View file

@ -1,2 +1,12 @@
export const getPath = () => (window.location && window.location.pathname &&
window.location.pathname.replace(/^\//, ''));
export const replacePath = url => window.history.replaceState(url, 'Редактирование маршрута', url);
export const getUrlData = () => {
const url = getPath();
const [path, mode] = url.split('/');
return { path, mode };
};