The code powering m.abunchtell.com https://m.abunchtell.com
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 

27 rader
706 B

  1. import { connect } from 'react-redux';
  2. import { makeGetAccount } from 'mastodon/selectors';
  3. import FollowRequest from '../components/follow_request';
  4. import { authorizeFollowRequest, rejectFollowRequest } from 'mastodon/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)(FollowRequest);