Cat: use match params where possible
This commit is contained in:
parent
60371afd03
commit
0685cbf136
@ -7,7 +7,6 @@ import InfoBox from './info-box';
|
||||
import Sidebar from './sidebar';
|
||||
import Tooltip from './tooltip';
|
||||
import { SaveIcon } from './icons';
|
||||
import { parseCategoryURL } from '../parse';
|
||||
|
||||
import CONFIG from './fields-config.json';
|
||||
|
||||
@ -15,7 +14,7 @@ const BuildingEdit = (props) => {
|
||||
if (!props.user){
|
||||
return <Redirect to="/sign-up.html" />
|
||||
}
|
||||
const cat = parseCategoryURL(props.match.url);
|
||||
const cat = props.match.params.cat;
|
||||
if (!props.building_id){
|
||||
return (
|
||||
<Sidebar title="Building Not Found" back={`/edit/${cat}.html`}>
|
||||
|
@ -7,7 +7,6 @@ import Sidebar from './sidebar';
|
||||
import Tooltip from './tooltip';
|
||||
import InfoBox from './info-box';
|
||||
import { EditIcon } from './icons';
|
||||
import { parseCategoryURL } from '../parse';
|
||||
|
||||
import CONFIG from './fields-config.json';
|
||||
|
||||
@ -22,7 +21,7 @@ const BuildingView = (props) => {
|
||||
</Sidebar>
|
||||
);
|
||||
}
|
||||
const cat = parseCategoryURL(props.match.url);
|
||||
const cat = props.match.params.cat;
|
||||
return (
|
||||
<Sidebar title={'Data available for this building'} back={`/view/${cat}.html`}>
|
||||
{
|
||||
|
@ -2,14 +2,14 @@ import React from 'react';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
|
||||
import Sidebar from './sidebar';
|
||||
import { parseCategoryURL } from '../parse';
|
||||
|
||||
|
||||
const MultiEdit = (props) => {
|
||||
if (!props.user){
|
||||
return <Redirect to="/sign-up.html" />
|
||||
}
|
||||
const cat = parseCategoryURL(props.match.url);
|
||||
const cat = props.match.params.cat;
|
||||
|
||||
return (
|
||||
<Sidebar
|
||||
title={`Quick edit`}
|
||||
|
Loading…
Reference in New Issue
Block a user