2020-12-04 01:10:23 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { doHideModal } from 'redux/actions/app';
|
|
|
|
import {
|
|
|
|
makeSelectClaimForUri,
|
2021-11-16 05:23:18 +01:00
|
|
|
selectTitleForUri,
|
2020-12-04 01:10:23 +01:00
|
|
|
selectRepostError,
|
|
|
|
selectRepostLoading,
|
|
|
|
selectMyClaimsWithoutChannels,
|
|
|
|
makeSelectEffectiveAmountForUri,
|
2021-11-16 05:43:28 +01:00
|
|
|
selectIsUriResolving,
|
2021-02-09 17:05:56 +01:00
|
|
|
selectFetchingMyChannels,
|
2021-10-17 10:36:14 +02:00
|
|
|
} from 'redux/selectors/claims';
|
|
|
|
|
|
|
|
import { selectBalance } from 'redux/selectors/wallet';
|
|
|
|
import {
|
|
|
|
doRepost,
|
|
|
|
doClearRepostError,
|
|
|
|
doCheckPublishNameAvailability,
|
|
|
|
doCheckPendingClaims,
|
|
|
|
} from 'redux/actions/claims';
|
2020-12-04 01:10:23 +01:00
|
|
|
import { doToast } from 'redux/actions/notifications';
|
2021-03-15 04:39:26 +01:00
|
|
|
import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app';
|
2020-12-04 01:10:23 +01:00
|
|
|
import RepostCreate from './view';
|
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
2020-12-22 16:16:39 +01:00
|
|
|
passedRepostClaim: makeSelectClaimForUri(props.name, false)(state),
|
2020-12-04 01:10:23 +01:00
|
|
|
passedRepostAmount: makeSelectEffectiveAmountForUri(props.name)(state),
|
|
|
|
enteredContentClaim: makeSelectClaimForUri(props.contentUri)(state),
|
2020-12-22 16:16:39 +01:00
|
|
|
enteredRepostClaim: makeSelectClaimForUri(props.repostUri, false)(state),
|
2020-12-04 01:10:23 +01:00
|
|
|
enteredRepostAmount: makeSelectEffectiveAmountForUri(props.repostUri)(state),
|
2021-11-16 05:23:18 +01:00
|
|
|
title: selectTitleForUri(state, props.uri),
|
2020-12-04 01:10:23 +01:00
|
|
|
balance: selectBalance(state),
|
|
|
|
error: selectRepostError(state),
|
|
|
|
reposting: selectRepostLoading(state),
|
|
|
|
myClaims: selectMyClaimsWithoutChannels(state),
|
2021-11-16 05:43:28 +01:00
|
|
|
isResolvingPassedRepost: props.name && selectIsUriResolving(state, `lbry://${props.name}`),
|
|
|
|
isResolvingEnteredRepost: props.repostUri && selectIsUriResolving(state, `lbry://${props.repostUri}`),
|
2021-02-09 17:05:56 +01:00
|
|
|
activeChannelClaim: selectActiveChannelClaim(state),
|
|
|
|
fetchingMyChannels: selectFetchingMyChannels(state),
|
2021-03-15 04:39:26 +01:00
|
|
|
incognito: selectIncognito(state),
|
2020-12-04 01:10:23 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, {
|
|
|
|
doHideModal,
|
|
|
|
doRepost,
|
|
|
|
doClearRepostError,
|
|
|
|
doToast,
|
|
|
|
doCheckPublishNameAvailability,
|
|
|
|
doCheckPendingClaims,
|
|
|
|
})(RepostCreate);
|