mastodon/app/javascript/flavours/glitch/features/follow_requests/containers/account_authorize_container.js

29 lines
731 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import { authorizeFollowRequest, rejectFollowRequest } from 'flavours/glitch/actions/accounts';
2017-12-04 01:26:40 -06:00
import { makeGetAccount } from 'flavours/glitch/selectors';
import AccountAuthorize from '../components/account_authorize';
const makeMapStateToProps = () => {
const getAccount = makeGetAccount();
const mapStateToProps = (state, props) => ({
account: getAccount(state, props.id),
});
return mapStateToProps;
};
const mapDispatchToProps = (dispatch, { id }) => ({
2017-06-23 09:05:04 -05:00
onAuthorize () {
dispatch(authorizeFollowRequest(id));
},
2017-06-23 09:05:04 -05:00
onReject () {
dispatch(rejectFollowRequest(id));
},
});
export default connect(makeMapStateToProps, mapDispatchToProps)(AccountAuthorize);