mirror of
https://github.com/ascribe/onion.git
synced 2024-06-30 13:41:57 +02:00
59 lines
1.5 KiB
JavaScript
59 lines
1.5 KiB
JavaScript
'use strict';
|
|
|
|
import React from 'react';
|
|
import PieceList from '../../../../piece_list';
|
|
|
|
import UserActions from '../../../../../actions/user_actions';
|
|
import UserStore from '../../../../../stores/user_store';
|
|
|
|
import CylandAccordionListItem from './cyland_accordion_list/cyland_accordion_list_item';
|
|
|
|
import { getLangText } from '../../../../../utils/lang_utils';
|
|
import { setDocumentTitle } from '../../../../../utils/dom_utils';
|
|
|
|
|
|
let CylandPieceList = React.createClass({
|
|
propTypes: {
|
|
location: React.PropTypes.object
|
|
},
|
|
|
|
getInitialState() {
|
|
return UserStore.getState();
|
|
},
|
|
|
|
componentDidMount() {
|
|
UserStore.listen(this.onChange);
|
|
UserActions.fetchCurrentUser();
|
|
},
|
|
|
|
componentWillUnmount() {
|
|
UserStore.unlisten(this.onChange);
|
|
},
|
|
|
|
onChange(state) {
|
|
this.setState(state);
|
|
},
|
|
|
|
render() {
|
|
setDocumentTitle(getLangText('Collection'));
|
|
|
|
return (
|
|
<div>
|
|
<PieceList
|
|
redirectTo="/register_piece?slide_num=0"
|
|
accordionListItemType={CylandAccordionListItem}
|
|
filterParams={[{
|
|
label: getLangText('Show works I have'),
|
|
items: [{
|
|
key: 'acl_loaned',
|
|
label: getLangText('loaned to Cyland')
|
|
}]
|
|
}]}
|
|
location={this.props.location}/>
|
|
</div>
|
|
);
|
|
}
|
|
});
|
|
|
|
export default CylandPieceList;
|