You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
715 B

  1. import { connect } from 'react-redux';
  2. import { makeGetAccount } from '../../../selectors';
  3. import AccountAuthorize from '../components/account_authorize';
  4. import { authorizeFollowRequest, rejectFollowRequest } from '../../../actions/accounts';
  5. const makeMapStateToProps = () => {
  6. const getAccount = makeGetAccount();
  7. const mapStateToProps = (state, props) => ({
  8. account: getAccount(state, props.id),
  9. });
  10. return mapStateToProps;
  11. };
  12. const mapDispatchToProps = (dispatch, { id }) => ({
  13. onAuthorize () {
  14. dispatch(authorizeFollowRequest(id));
  15. },
  16. onReject () {
  17. dispatch(rejectFollowRequest(id));
  18. },
  19. });
  20. export default connect(makeMapStateToProps, mapDispatchToProps)(AccountAuthorize);