Co-authored-by: tobi <tobi.smethurst@protonmail.com> Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/88 Co-authored-by: Zoë Bijl <moiety@noreply.codeberg.org> Co-committed-by: Zoë Bijl <moiety@noreply.codeberg.org>
29 lines
708 B
JavaScript
29 lines
708 B
JavaScript
import { connect } from "react-redux";
|
|
|
|
import { authorizeFollowRequest, rejectFollowRequest } from "mastodon/actions/accounts";
|
|
import { makeGetAccount } from "mastodon/selectors";
|
|
|
|
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);
|