Replacing follow requests in the settings area with in-UI column

This commit is contained in:
Eugen Rochko
2016-12-26 21:33:51 +01:00
parent 004382e4d0
commit 3689c119f0
17 changed files with 334 additions and 87 deletions

View File

@ -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);