2021-03-29 11:35:30 -07:00
|
|
|
import { connect } from 'react-redux';
|
2022-01-10 14:25:06 -08:00
|
|
|
|
2021-03-29 11:35:30 -07:00
|
|
|
import { authorizeFollowRequest, rejectFollowRequest } from 'soapbox/actions/accounts';
|
2022-01-10 14:17:52 -08:00
|
|
|
import { makeGetAccount } from 'soapbox/selectors';
|
2022-01-10 14:25:06 -08:00
|
|
|
|
2022-01-10 14:01:24 -08:00
|
|
|
import FollowRequest from '../components/follow_request';
|
2021-03-29 11:35:30 -07:00
|
|
|
|
|
|
|
const makeMapStateToProps = () => {
|
|
|
|
const getAccount = makeGetAccount();
|
|
|
|
|
|
|
|
const mapStateToProps = (state, props) => ({
|
|
|
|
account: getAccount(state, props.id),
|
|
|
|
});
|
|
|
|
|
|
|
|
return mapStateToProps;
|
|
|
|
};
|
|
|
|
|
|
|
|
const mapDispatchToProps = (dispatch, { id }) => ({
|
|
|
|
onAuthorize() {
|
|
|
|
dispatch(authorizeFollowRequest(id));
|
|
|
|
},
|
|
|
|
|
|
|
|
onReject() {
|
|
|
|
dispatch(rejectFollowRequest(id));
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(makeMapStateToProps, mapDispatchToProps)(FollowRequest);
|