2020-03-25 04:15:05 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import {
|
|
|
|
selectBalance,
|
|
|
|
selectTotalBalance,
|
|
|
|
selectClaimsBalance,
|
|
|
|
selectSupportsBalance,
|
|
|
|
selectTipsBalance,
|
|
|
|
selectAbandonClaimSupportError,
|
2021-10-17 10:36:14 +02:00
|
|
|
} from 'redux/selectors/wallet';
|
|
|
|
|
2021-10-08 07:51:38 +02:00
|
|
|
import { makeSelectClaimForUri } from 'redux/selectors/claims';
|
2021-10-17 10:36:14 +02:00
|
|
|
import { doSupportAbandonForClaim } from 'redux/actions/wallet';
|
2020-03-25 04:15:05 +01:00
|
|
|
import SupportsLiquidate from './view';
|
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
balance: selectBalance(state),
|
|
|
|
totalBalance: selectTotalBalance(state),
|
|
|
|
claimsBalance: selectClaimsBalance(state) || undefined,
|
|
|
|
supportsBalance: selectSupportsBalance(state) || undefined,
|
|
|
|
tipsBalance: selectTipsBalance(state) || undefined,
|
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
|
|
|
abandonClaimError: selectAbandonClaimSupportError(state),
|
|
|
|
});
|
|
|
|
|
2021-10-17 10:36:14 +02:00
|
|
|
const perform = (dispatch) => ({
|
2020-03-25 04:15:05 +01:00
|
|
|
abandonSupportForClaim: (claimId, type, keep, preview) =>
|
|
|
|
dispatch(doSupportAbandonForClaim(claimId, type, keep, preview)),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(SupportsLiquidate);
|