2015-07-27 20:49:37 +02:00
|
|
|
import React from 'react';
|
2016-02-23 13:09:50 +01:00
|
|
|
import {render} from 'react-dom';
|
|
|
|
import {Router, Route, browserHistory, IndexRoute} from 'react-router';
|
|
|
|
|
2015-07-27 20:49:37 +02:00
|
|
|
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';
|
|
|
|
|
|
|
|
|
|
|
|
class Flox extends React.Component {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<Header />
|
2016-02-23 13:09:50 +01:00
|
|
|
{this.props.children}
|
2015-07-27 20:49:37 +02:00
|
|
|
<Footer />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-23 13:09:50 +01:00
|
|
|
render((
|
|
|
|
<Router history={browserHistory}>
|
|
|
|
<Route component={Flox} path={config.uri}>
|
|
|
|
<IndexRoute component={Home} />
|
|
|
|
<Route path=":category" component={Category} />
|
|
|
|
<Route path=":category/:item" component={Show} />
|
|
|
|
</Route>
|
|
|
|
</Router>
|
|
|
|
), document.querySelector('.flox'));
|