logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

account_authorize_container.js (715B)


  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);