diff --git a/js/actions/artwork_list_actions.js b/js/actions/artwork_list_actions.js deleted file mode 100644 index b9618bd4..00000000 --- a/js/actions/artwork_list_actions.js +++ /dev/null @@ -1,22 +0,0 @@ -import alt from '../alt'; -import ArtworkFetcher from '../fetchers/artwork_fetcher'; - -class ArtworkListActions { - constructor() { - this.generateActions( - 'updateArtworkList' - ); - } - - fetchArtworkList() { - ArtworkFetcher.fetch(1, 10) - .then((res) => { - this.actions.updateArtworkList(res.pieces); - }) - .catch((err) => { - console.log(err); - }); - } -}; - -export default alt.createActions(ArtworkListActions); diff --git a/js/actions/piece_list_actions.js b/js/actions/piece_list_actions.js new file mode 100644 index 00000000..51158285 --- /dev/null +++ b/js/actions/piece_list_actions.js @@ -0,0 +1,22 @@ +import alt from '../alt'; +import PieceListFetcher from '../fetchers/piece_list_fetcher'; + +class PieceListActions { + constructor() { + this.generateActions( + 'updatePieceList' + ); + } + + fetchPieceList() { + PieceListFetcher.fetch(1, 10) + .then((res) => { + this.actions.updatePieceList(res.pieces); + }) + .catch((err) => { + console.log(err); + }); + } +}; + +export default alt.createActions(PieceListActions); diff --git a/js/components/artwork.js b/js/components/artwork.js deleted file mode 100644 index 27ab31e2..00000000 --- a/js/components/artwork.js +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; - -let Artwork = React.createClass({ - render() { - return ( -
this.props.artwork.title
- ); - } -}); - -export default Artwork; \ No newline at end of file diff --git a/js/components/artwork_list.js b/js/components/artwork_list.js deleted file mode 100644 index 3bde0815..00000000 --- a/js/components/artwork_list.js +++ /dev/null @@ -1,40 +0,0 @@ -import React from 'react'; -import Router from 'react-router'; - -import ArtworkListStore from '../stores/artwork_list_store'; -import ArtworkListActions from '../actions/artwork_list_actions'; - -let Link = Router.Link; - -var ArtworkList = React.createClass({ - getInitialState() { - return ArtworkListStore.getState(); - }, - - componentDidMount() { - ArtworkListStore.listen(this.onChange); - ArtworkListActions.fetchArtworkList(); - }, - - componentWillUnmount() { - ArtworkListStore.unlisten(this.onChange); - }, - - onChange(state) { - this.setState(state); - }, - - render() { - return ( -this.props.piece.title
+ ); + } +}); + +export default Piece; \ No newline at end of file diff --git a/js/components/piece_list.js b/js/components/piece_list.js new file mode 100644 index 00000000..516ad62e --- /dev/null +++ b/js/components/piece_list.js @@ -0,0 +1,40 @@ +import React from 'react'; +import Router from 'react-router'; + +import PieceListStore from '../stores/piece_list_store'; +import PieceListActions from '../actions/piece_list_actions'; + +let Link = Router.Link; + +var PieceList = React.createClass({ + getInitialState() { + return PieceListStore.getState(); + }, + + componentDidMount() { + PieceListStore.listen(this.onChange); + PieceListActions.fetchPieceList(); + }, + + componentWillUnmount() { + PieceListStore.unlisten(this.onChange); + }, + + onChange(state) { + this.setState(state); + }, + + render() { + return ( +