-
+
diff --git a/app/assets/javascripts/components/features/status/components/action_bar.jsx b/app/assets/javascripts/components/features/status/components/action_bar.jsx
index 65c107edc..6d6aa87fc 100644
--- a/app/assets/javascripts/components/features/status/components/action_bar.jsx
+++ b/app/assets/javascripts/components/features/status/components/action_bar.jsx
@@ -1,26 +1,36 @@
import PureRenderMixin from 'react-addons-pure-render-mixin';
import IconButton from '../../../components/icon_button';
import ImmutablePropTypes from 'react-immutable-proptypes';
+import DropdownMenu from '../../../components/dropdown_menu';
const ActionBar = React.createClass({
-
+
propTypes: {
status: ImmutablePropTypes.map.isRequired,
onReply: React.PropTypes.func.isRequired,
onReblog: React.PropTypes.func.isRequired,
- onFavourite: React.PropTypes.func.isRequired
+ onFavourite: React.PropTypes.func.isRequired,
+ onDelete: React.PropTypes.func.isRequired,
+ me: React.PropTypes.number.isRequired
},
mixins: [PureRenderMixin],
render () {
- const { status } = this.props;
+ const { status, me } = this.props;
+
+ let menu = [];
+
+ if (me === status.getIn(['account', 'id'])) {
+ menu.push({ text: 'Delete', action: () => this.props.onDelete(status) });
+ }
return (
this.props.onReply(status)} />
this.props.onReblog(status)} />
this.props.onFavourite(status)} />
+
);
}
diff --git a/app/assets/javascripts/components/features/status/index.jsx b/app/assets/javascripts/components/features/status/index.jsx
index 1d40f127b..cc7a2bfeb 100644
--- a/app/assets/javascripts/components/features/status/index.jsx
+++ b/app/assets/javascripts/components/features/status/index.jsx
@@ -10,6 +10,7 @@ import ActionBar from './components/action_bar';
import Column from '../ui/components/column';
import { favourite, reblog } from '../../actions/interactions';
import { replyCompose } from '../../actions/compose';
+import { deleteStatus } from '../../actions/statuses';
import {
getStatus,
getStatusAncestors,
@@ -57,8 +58,12 @@ const Status = React.createClass({
this.props.dispatch(reblog(status));
},
+ handleDeleteClick (status) {
+ this.props.dispatch(deleteStatus(status.get('id')));
+ },
+
renderChildren (list) {
- return list.map(s =>
);
+ return list.map(s =>
);
},
render () {
@@ -80,7 +85,7 @@ const Status = React.createClass({
{this.renderChildren(ancestors)}
-
+
{this.renderChildren(descendants)}