lbry-desktop/ui/component/walletBalance/index.js

41 lines
1.3 KiB
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import {
selectBalance,
selectClaimsBalance,
selectSupportsBalance,
selectTipsBalance,
selectIsFetchingUtxoCounts,
selectUtxoCounts,
doFetchUtxoCounts,
doUtxoConsolidate,
selectIsConsolidatingUtxos,
selectIsMassClaimingTips,
selectPendingConsolidateTxid,
selectPendingMassClaimTxid,
} from 'lbry-redux';
2019-11-22 16:13:00 -05:00
import { doOpenModal } from 'redux/actions/app';
2020-10-02 11:03:25 -04:00
import { selectSyncHash } from 'redux/selectors/sync';
import { selectClaimedRewards } from 'redux/selectors/rewards';
import WalletBalance from './view';
2017-08-17 16:19:29 -04:00
const select = state => ({
balance: selectBalance(state),
2019-09-30 17:48:30 -04:00
claimsBalance: selectClaimsBalance(state) || 0,
supportsBalance: selectSupportsBalance(state) || 0,
tipsBalance: selectTipsBalance(state) || 0,
rewards: selectClaimedRewards(state),
2020-02-21 12:23:04 -05:00
hasSynced: Boolean(selectSyncHash(state)),
fetchingUtxoCounts: selectIsFetchingUtxoCounts(state),
consolidatingUtxos: selectIsConsolidatingUtxos(state),
massClaimingTips: selectIsMassClaimingTips(state),
utxoCounts: selectUtxoCounts(state),
consolidateIsPending: selectPendingConsolidateTxid(state),
massClaimIsPending: selectPendingMassClaimTxid(state),
2017-08-17 16:19:29 -04:00
});
2020-06-01 13:03:19 -04:00
export default connect(select, {
doOpenModal,
doFetchUtxoCounts,
doUtxoConsolidate,
2020-06-01 13:03:19 -04:00
})(WalletBalance);