1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 09:23:13 +01:00

outsourced routes to separate file and created a boilerplate action and store

This commit is contained in:
Tim Daubenschütz 2015-05-18 13:43:42 +02:00
parent 6ae7ff0d4b
commit c6097fe5c2
5 changed files with 23 additions and 5 deletions

View File

@ -4,7 +4,7 @@ import React from 'react';
import Router from 'react-router'; import Router from 'react-router';
import AscribeApp from './components/ascribe_app'; import AscribeApp from './components/ascribe_app';
import routes from '.routes'; import routes from './routes';
Router.run(routes, Router.HashLocation, (AscribeApp) => { Router.run(routes, Router.HashLocation, (AscribeApp) => {
React.render( React.render(

View File

@ -0,0 +1,11 @@
import alt from '../alt';
class ArtworkListActions {
constructor() {
this.generateActions(
'updateArtworks'
);
};
};
export default alt.createAction(ArtworkListActions);

View File

@ -4,7 +4,7 @@ import Router from 'react-router';
var RouteHandler = Router.RouteHandler; var RouteHandler = Router.RouteHandler;
class AscribeApp extends React.Component { class AscribeApp extends React.Component {
render () { render() {
return ( return (
<div> <div>
<h1>ascribe all the things!</h1> <h1>ascribe all the things!</h1>

View File

@ -1,5 +1,9 @@
import alt from '../alt';
class ArtworkListStore { class ArtworkListStore {
constructor() { constructor() {
this.artworkList = []; this.artworkList = [];
} }
}; };
export default alt.createStore(ArtworkListStore);

View File

@ -1,7 +1,8 @@
import React from 'react';
import Router from 'react-router'; import Router from 'react-router';
import AscribeApp from './components/ascribe_app'; import AscribeApp from './components/ascribe_app';
import ArtworkList from './components/artwork_list'; import ArtworkList from './components/gui/artwork_list';
var Route = Router.Route; var Route = Router.Route;
@ -9,4 +10,6 @@ var routes = (
<Route handler={AscribeApp}> <Route handler={AscribeApp}>
<Route path="artworks" handler={ArtworkList} /> <Route path="artworks" handler={ArtworkList} />
</Route> </Route>
); );
export default routes;