removed separate routes file

This commit is contained in:
bill bittner 2018-02-22 15:59:51 -08:00
parent 6a9e7005bd
commit 9bf45975da
3 changed files with 11 additions and 38 deletions

View file

@ -1,13 +1,20 @@
import React from 'react';
import { Route, Switch } from 'react-router-dom';
import routes from './routes';
import PublishPage from 'components/PublishPage';
import AboutPage from 'components/AboutPage';
import LoginPage from 'containers/LoginPage';
import ShowPage from 'containers/ShowPage';
import FourOhFourPage from 'components/FourOhFourPage';
const App = () => {
return (
<Switch>
{routes.map((route, index) => (
<Route key={index}{...route} />
))}
<Route exact path='/' component={PublishPage} />
<Route exact path='/about' component={AboutPage} />
<Route exact path='/login' component={LoginPage} />
<Route exact path='/:identifier/:claim' component={ShowPage} />
<Route exact path='/:claim' component={ShowPage} />
<Route component={FourOhFourPage} />
</Switch>
);
};

View file

@ -8,7 +8,6 @@ class AssetDisplay extends React.Component {
this.props.onFileRequest(name, claimId);
}
render () {
console.log('rendering assetdisplay', this.props);
const { status, error, asset: { claimData: { name, claimId, contentType, fileExt, thumbnail } } } = this.props;
return (
<div id="asset-display-component">

View file

@ -1,33 +0,0 @@
import PublishPage from 'components/PublishPage';
import AboutPage from 'components/AboutPage';
import LoginPage from 'containers/LoginPage';
import ShowPage from 'containers/ShowPage';
import FourOhFourPage from 'components/FourOhFourPage';
const routes = [
{ path : '/',
exact : true,
component: PublishPage,
},
{ path : '/about',
exact : true,
component: AboutPage,
},
{ path : '/login',
exact : true,
component: LoginPage,
},
{ path : '/:identifier/:claim',
exact : true,
component: ShowPage,
},
{ path : '/:claim',
exact : true,
component: ShowPage,
},
{
component: FourOhFourPage,
},
];
export default routes;