]>
cat aescling's git repositories - mastodon.git/blob - app/javascript/mastodon/containers/account_container.js
1 import { connect
} from 'react-redux';
2 import { makeGetAccount
} from '../selectors';
3 import Account
from '../components/account';
11 } from '../actions/accounts';
13 const makeMapStateToProps
= () => {
14 const getAccount
= makeGetAccount();
16 const mapStateToProps
= (state
, props
) => ({
17 account: getAccount(state
, props
.id
),
18 me: state
.getIn(['meta', 'me']),
21 return mapStateToProps
;
24 const mapDispatchToProps
= (dispatch
) => ({
26 if (account
.getIn(['relationship', 'following'])) {
27 dispatch(unfollowAccount(account
.get('id')));
29 dispatch(followAccount(account
.get('id')));
34 if (account
.getIn(['relationship', 'blocking'])) {
35 dispatch(unblockAccount(account
.get('id')));
37 dispatch(blockAccount(account
.get('id')));
42 if (account
.getIn(['relationship', 'muting'])) {
43 dispatch(unmuteAccount(account
.get('id')));
45 dispatch(muteAccount(account
.get('id')));
50 export default connect(makeMapStateToProps
, mapDispatchToProps
)(Account
);
This page took 0.080943 seconds and 5 git commands to generate.