1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-29 00:58:03 +02:00
onion/js/components/piece_list.js

55 lines
1.4 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-20 16:44:45 +02:00
2015-05-19 17:16:01 +02:00
let PieceList = React.createClass({
componentDidMount() {
2015-05-20 19:19:57 +02:00
PieceListActions.fetchList(1, 10);
},
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': {
2015-05-20 17:32:06 +02:00
'displayName': '',
'displayType': TableItemImg,
2015-05-20 19:19:57 +02:00
'rowWidth': 2,
'canBeOrdered': false
2015-05-20 15:22:29 +02:00
},
'artist_name': {
'displayName': 'Artist',
'displayType': TableItemText,
2015-05-20 19:19:57 +02:00
'rowWidth': 4,
'canBeOrdered': true
2015-05-20 15:22:29 +02:00
},
'title': {
'displayName': 'Title',
'displayType': TableItemText,
2015-05-20 19:19:57 +02:00
'rowWidth': 4,
'canBeOrdered': true
2015-05-20 15:22:29 +02:00
}
2015-05-20 14:48:57 +02:00
};
2015-05-20 19:19:57 +02:00
return (
2015-05-20 19:19:57 +02:00
<AltContainer store={PieceListStore} actions={PieceListActions}>
<Table columnMap={columnMap} />
</AltContainer>
);
}
});
export default PieceList;