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