2015-07-27 20:49:37 +02:00
|
|
|
import React from 'react';
|
|
|
|
import Router from 'react-router';
|
|
|
|
import Api from './api';
|
|
|
|
import Home from './sites/home';
|
|
|
|
import Category from './sites/category';
|
2015-07-30 10:51:35 +02:00
|
|
|
import Show from './sites/show';
|
2015-07-27 20:49:37 +02:00
|
|
|
import Header from './partials/header';
|
|
|
|
import Footer from './partials/footer';
|
|
|
|
|
|
|
|
let Route = Router.Route;
|
|
|
|
|
|
|
|
let RouteHandler = Router.RouteHandler;
|
|
|
|
|
|
|
|
class Flox extends React.Component {
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<Header />
|
|
|
|
<RouteHandler />
|
|
|
|
<Footer />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let routes = (
|
|
|
|
<Route handler={Flox} path={config.uri}>
|
|
|
|
<Route handler={Home} />
|
|
|
|
<Route path=":category" handler={Category} />
|
2015-07-30 10:51:35 +02:00
|
|
|
<Route path=":category/:item" handler={Show} />
|
2015-07-27 20:49:37 +02:00
|
|
|
</Route>
|
|
|
|
);
|
|
|
|
|
|
|
|
Router.run(routes, Router.HistoryLocation, (Root) => {
|
|
|
|
React.render(<Root />, document.querySelector('.flox'));
|
|
|
|
});
|