lbry-desktop/ui/page/rewards/index.js

30 lines
704 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2019-10-14 16:18:16 -04:00
import {
selectFetchingRewards,
selectUnclaimedRewards,
selectClaimedRewards,
selectUser,
doRewardList,
doUserFetch,
} from 'lbryinc';
import { selectDaemonSettings } from 'redux/selectors/settings';
import RewardsPage from './view';
2017-05-26 12:53:32 +04:00
2018-07-10 22:54:50 -04:00
const select = state => ({
daemonSettings: selectDaemonSettings(state),
2017-12-13 18:36:30 -03:00
fetching: selectFetchingRewards(state),
rewards: selectUnclaimedRewards(state),
2018-07-10 22:54:50 -04:00
claimed: selectClaimedRewards(state),
2017-12-13 18:36:30 -03:00
user: selectUser(state),
});
2017-05-26 12:53:32 +04:00
2017-06-23 12:29:40 +07:00
const perform = dispatch => ({
fetchRewards: () => dispatch(doRewardList()),
2019-10-14 16:18:16 -04:00
fetchUser: () => dispatch(doUserFetch()),
2017-06-23 12:29:40 +07:00
});
2018-07-10 22:54:50 -04:00
export default connect(
select,
perform
)(RewardsPage);