2019-12-01 17:25:29 +01:00
|
|
|
import { connect } from 'react-redux';
|
2023-05-23 17:15:17 +02:00
|
|
|
|
|
|
|
import { authorizeFollowRequest, rejectFollowRequest } from 'mastodon/actions/accounts';
|
2019-12-01 17:25:29 +01:00
|
|
|
import { makeGetAccount } from 'mastodon/selectors';
|
2023-05-23 17:15:17 +02:00
|
|
|
|
2019-12-01 17:25:29 +01:00
|
|
|
import FollowRequest from '../components/follow_request';
|
|
|
|
|
|
|
|
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);
|