about summary refs log tree commit diff
path: root/app/assets/javascripts/components/features/status
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-09-17 17:47:26 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-09-17 17:47:26 +0200
commitbd5ad304bac69b34a3c223e9baac532106db7dd8 (patch)
tree46d98c91108401e19a5065103b7c1f48db91def8 /app/assets/javascripts/components/features/status
parent183a23943bba2c214c56bf43c706f3f34d9bde32 (diff)
Adding media controller, 1 webm/compose form allowed, previews generated
Diffstat (limited to 'app/assets/javascripts/components/features/status')
-rw-r--r--app/assets/javascripts/components/features/status/index.jsx18
1 files changed, 16 insertions, 2 deletions
diff --git a/app/assets/javascripts/components/features/status/index.jsx b/app/assets/javascripts/components/features/status/index.jsx
index 122db8906..39bc2bec5 100644
--- a/app/assets/javascripts/components/features/status/index.jsx
+++ b/app/assets/javascripts/components/features/status/index.jsx
@@ -4,6 +4,8 @@ import ImmutablePropTypes       from 'react-immutable-proptypes';
 import { fetchStatus }          from '../../actions/statuses';
 import Immutable                from 'immutable';
 import EmbeddedStatus           from '../../components/status';
+import { favourite, reblog }    from '../../actions/interactions';
+import { replyCompose }         from '../../actions/compose';
 
 function selectStatus(state, id) {
   let status = state.getIn(['timelines', 'statuses', id]);
@@ -49,8 +51,20 @@ const Status = React.createClass({
     }
   },
 
+  handleFavouriteClick (status) {
+    this.props.dispatch(favourite(status));
+  },
+
+  handleReplyClick (status) {
+    this.props.dispatch(replyCompose(status));
+  },
+
+  handleReblogClick (status) {
+    this.props.dispatch(reblog(status));
+  },
+
   renderChildren (list) {
-    return list.map(s => <EmbeddedStatus status={s} key={s.get('id')} />);
+    return list.map(s => <EmbeddedStatus status={s} key={s.get('id')} onReply={this.handleReplyClick} onFavourite={this.handleFavouriteClick} onReblog={this.handleReblogClick} />);
   },
 
   render () {
@@ -63,7 +77,7 @@ const Status = React.createClass({
     return (
       <div>
         {this.renderChildren(ancestors)}
-        <EmbeddedStatus status={status} />
+        <EmbeddedStatus status={status} onReply={this.handleReplyClick} onFavourite={this.handleFavouriteClick} onReblog={this.handleReblogClick} />
         {this.renderChildren(descendants)}
       </div>
     );