mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
55 lines
1.7 KiB
JavaScript
55 lines
1.7 KiB
JavaScript
import React from 'react';
|
|
|
|
import UserActions from '../../actions/user_actions';
|
|
import UserStore from '../../stores/user_store';
|
|
|
|
import AclButton from '../ascribe_buttons/acl_button';
|
|
|
|
let AclButtonList = React.createClass({
|
|
getInitialState() {
|
|
return UserStore.getState();
|
|
},
|
|
|
|
onChange(state) {
|
|
this.setState(state);
|
|
},
|
|
|
|
componentWillMount() {
|
|
UserActions.fetchCurrentUser();
|
|
UserStore.listen(this.onChange);
|
|
},
|
|
|
|
componentDidUnmount() {
|
|
UserStore.unlisten(this.onChange);
|
|
},
|
|
render() {
|
|
return (<div className="text-center">
|
|
<AclButton
|
|
availableAcls={this.props.availableAcls}
|
|
action="transfer"
|
|
editions={this.props.editions}
|
|
currentUser={this.state.currentUser}
|
|
handleSuccess={this.props.handleSuccess} />
|
|
<AclButton
|
|
availableAcls={this.props.availableAcls}
|
|
action="consign"
|
|
editions={this.props.editions}
|
|
currentUser={this.state.currentUser}
|
|
handleSuccess={this.props.handleSuccess} />
|
|
<AclButton
|
|
availableAcls={this.props.availableAcls}
|
|
action="loan"
|
|
editions={this.props.editions}
|
|
currentUser={this.state.currentUser}
|
|
handleSuccess={this.props.handleSuccess} />
|
|
<AclButton
|
|
availableAcls={this.props.availableAcls}
|
|
action="share"
|
|
editions={this.props.editions}
|
|
currentUser={this.state.currentUser}
|
|
handleSuccess={this.props.handleSuccess} />
|
|
</div>)
|
|
}
|
|
});
|
|
|
|
export default AclButtonList; |