about summary refs log tree commit diff
path: root/app/assets/javascripts/components/features/follow_requests/containers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-12-26 21:33:51 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-12-26 21:33:51 +0100
commit3689c119f0ad8d523ab8deb3c2c8ed0a9c84db6e (patch)
treea3c81d415e9eb7c043bef0cbee43200ab708146b /app/assets/javascripts/components/features/follow_requests/containers
parent004382e4d09f90e5ca824996c4b20e99599bf98f (diff)
Replacing follow requests in the settings area with in-UI column
Diffstat (limited to 'app/assets/javascripts/components/features/follow_requests/containers')
-rw-r--r--app/assets/javascripts/components/features/follow_requests/containers/account_authorize_container.jsx26
1 files changed, 26 insertions, 0 deletions
diff --git a/app/assets/javascripts/components/features/follow_requests/containers/account_authorize_container.jsx b/app/assets/javascripts/components/features/follow_requests/containers/account_authorize_container.jsx
new file mode 100644
index 000000000..da1e5eaa1
--- /dev/null
+++ b/app/assets/javascripts/components/features/follow_requests/containers/account_authorize_container.jsx
@@ -0,0 +1,26 @@
+import { connect } from 'react-redux';
+import { makeGetAccount } from '../../../selectors';
+import AccountAuthorize from '../components/account_authorize';
+import { authorizeFollowRequest, rejectFollowRequest } from '../../../actions/accounts';
+
+const makeMapStateToProps = () => {
+  const getAccount = makeGetAccount();
+
+  const mapStateToProps = (state, props) => ({
+    account: getAccount(state, props.id)
+  });
+
+  return mapStateToProps;
+};
+
+const mapDispatchToProps = (dispatch, { id }) => ({
+  onAuthorize (account) {
+    dispatch(authorizeFollowRequest(id));
+  },
+
+  onReject (account) {
+    dispatch(rejectFollowRequest(id));
+  }
+});
+
+export default connect(makeMapStateToProps, mapDispatchToProps)(AccountAuthorize);