about summary refs log tree commit diff
path: root/app/assets/javascripts/components/features/ui/containers/status_list_container.jsx
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-09-19 23:25:59 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-09-19 23:26:21 +0200
commit337462aa5e68014aa15788e4513e190b2e434d7e (patch)
treea760e80e2bc9b1fef55f118ddeb8603b20155a61 /app/assets/javascripts/components/features/ui/containers/status_list_container.jsx
parentf820edb463109e313e836d8e2f210927a0eba7d1 (diff)
Re-organizing components to be more modular, adding loading bars
Diffstat (limited to 'app/assets/javascripts/components/features/ui/containers/status_list_container.jsx')
-rw-r--r--app/assets/javascripts/components/features/ui/containers/status_list_container.jsx29
1 files changed, 29 insertions, 0 deletions
diff --git a/app/assets/javascripts/components/features/ui/containers/status_list_container.jsx b/app/assets/javascripts/components/features/ui/containers/status_list_container.jsx
new file mode 100644
index 000000000..4ea599fc0
--- /dev/null
+++ b/app/assets/javascripts/components/features/ui/containers/status_list_container.jsx
@@ -0,0 +1,29 @@
+import { connect }           from 'react-redux';
+import StatusList            from '../../../components/status_list';
+import { replyCompose }      from '../../../actions/compose';
+import { reblog, favourite } from '../../../actions/interactions';
+import { selectStatus }      from '../../../reducers/timelines';
+
+const mapStateToProps = function (state, props) {
+  return {
+    statuses: state.getIn(['timelines', props.type]).map(id => selectStatus(state, id))
+  };
+};
+
+const mapDispatchToProps = function (dispatch) {
+  return {
+    onReply: function (status) {
+      dispatch(replyCompose(status));
+    },
+
+    onFavourite: function (status) {
+      dispatch(favourite(status));
+    },
+
+    onReblog: function (status) {
+      dispatch(reblog(status));
+    }
+  };
+};
+
+export default connect(mapStateToProps, mapDispatchToProps)(StatusList);