Move status components inside individual containers. We still need to select

all statuses/accounts to assemble, but at least lists don't have to be
re-rendered all the time now. Also add "mention" dropdown option
This commit is contained in:
Eugen Rochko
2016-10-24 17:11:02 +02:00
parent 61db14bcbe
commit f8f40f15da
13 changed files with 179 additions and 154 deletions

View File

@@ -9,7 +9,8 @@ const StatusActionBar = React.createClass({
onReply: React.PropTypes.func,
onFavourite: React.PropTypes.func,
onReblog: React.PropTypes.func,
onDelete: React.PropTypes.func
onDelete: React.PropTypes.func,
onMention: React.PropTypes.func
},
mixins: [PureRenderMixin],
@@ -30,12 +31,18 @@ const StatusActionBar = React.createClass({
this.props.onDelete(this.props.status);
},
handleMentionClick () {
this.props.onMention(this.props.status.get('account'));
},
render () {
const { status, me } = this.props;
let menu = [];
if (status.getIn(['account', 'id']) === me) {
menu.push({ text: 'Delete', action: this.handleDeleteClick });
} else {
menu.push({ text: 'Mention', action: this.handleMentionClick });
}
return (