1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-05 11:25:09 +01:00
onion/js/components/piece_list.js
2015-05-20 19:19:57 +02:00

55 lines
1.4 KiB
JavaScript

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';
import Table from './table';
import TableItemImg from './table_item_img';
import TableItemText from './table_item_text';
let Link = Router.Link;
let PieceList = React.createClass({
componentDidMount() {
PieceListActions.fetchList(1, 10);
},
render() {
// TODO:
// Specifiy how a TableItemX should look like
let columnMap = {
'thumbnail': {
'displayName': '',
'displayType': TableItemImg,
'rowWidth': 2,
'canBeOrdered': false
},
'artist_name': {
'displayName': 'Artist',
'displayType': TableItemText,
'rowWidth': 4,
'canBeOrdered': true
},
'title': {
'displayName': 'Title',
'displayType': TableItemText,
'rowWidth': 4,
'canBeOrdered': true
}
};
return (
<AltContainer store={PieceListStore} actions={PieceListActions}>
<Table columnMap={columnMap} />
</AltContainer>
);
}
});
export default PieceList;