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.
27 lines
729 B
27 lines
729 B
8 years ago
|
import { connect } from 'react-redux';
|
||
7 years ago
|
import { makeGetAccount } from 'flavours/glitch/selectors';
|
||
8 years ago
|
import AccountAuthorize from '../components/account_authorize';
|
||
7 years ago
|
import { authorizeFollowRequest, rejectFollowRequest } from 'flavours/glitch/actions/accounts';
|
||
8 years ago
|
|
||
|
const makeMapStateToProps = () => {
|
||
|
const getAccount = makeGetAccount();
|
||
|
|
||
|
const mapStateToProps = (state, props) => ({
|
||
8 years ago
|
account: getAccount(state, props.id),
|
||
8 years ago
|
});
|
||
|
|
||
|
return mapStateToProps;
|
||
|
};
|
||
|
|
||
|
const mapDispatchToProps = (dispatch, { id }) => ({
|
||
7 years ago
|
onAuthorize () {
|
||
8 years ago
|
dispatch(authorizeFollowRequest(id));
|
||
|
},
|
||
|
|
||
7 years ago
|
onReject () {
|
||
8 years ago
|
dispatch(rejectFollowRequest(id));
|
||
8 years ago
|
},
|
||
8 years ago
|
});
|
||
|
|
||
|
export default connect(makeMapStateToProps, mapDispatchToProps)(AccountAuthorize);
|