diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-12-26 21:33:51 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-12-26 21:33:51 +0100 |
commit | 3689c119f0ad8d523ab8deb3c2c8ed0a9c84db6e (patch) | |
tree | a3c81d415e9eb7c043bef0cbee43200ab708146b /app/assets/javascripts/components/features/follow_requests/containers/account_authorize_container.jsx | |
parent | 004382e4d09f90e5ca824996c4b20e99599bf98f (diff) |
Replacing follow requests in the settings area with in-UI column
Diffstat (limited to 'app/assets/javascripts/components/features/follow_requests/containers/account_authorize_container.jsx')
-rw-r--r-- | app/assets/javascripts/components/features/follow_requests/containers/account_authorize_container.jsx | 26 |
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); |