2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
2018-09-24 20:17:08 -04:00
|
|
|
import { doResolveUri, selectBalance } from 'lbry-redux';
|
2018-06-12 01:11:17 -04:00
|
|
|
import {
|
|
|
|
selectPublishFormValues,
|
|
|
|
selectIsStillEditing,
|
|
|
|
selectMyClaimForUri,
|
2018-09-24 20:17:08 -04:00
|
|
|
selectIsResolvingPublishUris,
|
|
|
|
selectTakeOverAmount,
|
2018-06-12 01:11:17 -04:00
|
|
|
} from 'redux/selectors/publish';
|
2018-05-25 14:05:30 -04:00
|
|
|
import {
|
2018-04-02 09:53:29 -04:00
|
|
|
doResetThumbnailStatus,
|
2018-05-25 14:05:30 -04:00
|
|
|
doClearPublish,
|
|
|
|
doUpdatePublishForm,
|
|
|
|
doPublish,
|
|
|
|
doPrepareEdit,
|
|
|
|
} from 'redux/actions/publish';
|
2019-04-03 00:17:00 -04:00
|
|
|
import { selectUnclaimedRewardValue } from 'lbryinc';
|
2017-12-21 18:08:54 -03:00
|
|
|
import PublishPage from './view';
|
2017-05-02 15:21:00 +07:00
|
|
|
|
2018-09-24 20:17:08 -04:00
|
|
|
const select = state => ({
|
|
|
|
...selectPublishFormValues(state),
|
|
|
|
// The winning claim for a short lbry uri
|
|
|
|
amountNeededForTakeover: selectTakeOverAmount(state),
|
|
|
|
// My previously published claims under this short lbry uri
|
|
|
|
myClaimForUri: selectMyClaimForUri(state),
|
|
|
|
// If I clicked the "edit" button, have I changed the uri?
|
|
|
|
// Need this to make it easier to find the source on previously published content
|
|
|
|
isStillEditing: selectIsStillEditing(state),
|
|
|
|
balance: selectBalance(state),
|
|
|
|
isResolvingUri: selectIsResolvingPublishUris(state),
|
2019-04-03 00:17:00 -04:00
|
|
|
totalRewardValue: selectUnclaimedRewardValue(state),
|
2018-09-24 20:17:08 -04:00
|
|
|
});
|
2017-05-02 15:21:00 +07:00
|
|
|
|
2017-06-05 21:21:55 -07:00
|
|
|
const perform = dispatch => ({
|
2018-03-26 14:32:43 -07:00
|
|
|
updatePublishForm: value => dispatch(doUpdatePublishForm(value)),
|
|
|
|
clearPublish: () => dispatch(doClearPublish()),
|
2017-06-12 15:01:22 +07:00
|
|
|
resolveUri: uri => dispatch(doResolveUri(uri)),
|
2017-06-18 00:59:18 +07:00
|
|
|
publish: params => dispatch(doPublish(params)),
|
2018-06-12 23:28:06 -04:00
|
|
|
prepareEdit: (claim, uri) => dispatch(doPrepareEdit(claim, uri)),
|
2018-04-02 09:55:36 -04:00
|
|
|
resetThumbnailStatus: () => dispatch(doResetThumbnailStatus()),
|
2017-06-05 21:21:55 -07:00
|
|
|
});
|
2017-05-02 15:21:00 +07:00
|
|
|
|
2018-06-12 01:11:17 -04:00
|
|
|
export default connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(PublishPage);
|