1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-30 21:52:08 +02:00
onion/js/components/piece_list.js

48 lines
1.2 KiB
JavaScript
Raw Normal View History

import React from 'react';
import Router from 'react-router';
import AltContainer from 'alt/AltContainer';
import PieceListStore from '../stores/piece_list_store';
import PieceListActions from '../actions/piece_list_actions';
2015-05-20 15:22:29 +02:00
import Table from './table';
2015-05-20 15:22:29 +02:00
import TableItemImg from './table_item_img';
import TableItemText from './table_item_text';
let Link = Router.Link;
2015-05-19 17:16:01 +02:00
let PieceList = React.createClass({
componentDidMount() {
PieceListActions.fetchPieceList();
},
render() {
2015-05-20 14:48:57 +02:00
// TODO:
// Specifiy how a TableItemX should look like
2015-05-20 14:48:57 +02:00
let columnMap = {
2015-05-20 15:22:29 +02:00
'thumbnail': {
'display_name': 'Thumbnail',
2015-05-20 15:22:29 +02:00
'display_type': TableItemImg
},
'artist_name': {
'display_name': 'Artist',
'display_type': TableItemText
},
'title': {
'display_name': 'Title',
'display_type': TableItemText
}
2015-05-20 14:48:57 +02:00
};
return (
<AltContainer store={PieceListStore}>
2015-05-20 14:48:57 +02:00
<Table class="piecesTable" columnMap={columnMap} />
</AltContainer>
);
}
});
export default PieceList;