2018-04-02 18:39:00 +02:00
|
|
|
import { connect } from 'react-redux';
|
2019-06-28 09:27:55 +02:00
|
|
|
import {
|
2019-07-03 04:30:34 +02:00
|
|
|
doResolveUri,
|
2019-06-28 09:27:55 +02:00
|
|
|
selectPublishFormValues,
|
|
|
|
selectIsStillEditing,
|
|
|
|
selectMyClaimForUri,
|
|
|
|
selectIsResolvingPublishUris,
|
|
|
|
selectTakeOverAmount,
|
2019-08-29 17:19:37 +02:00
|
|
|
selectFileInfosByOutpoint,
|
2019-06-28 09:27:55 +02:00
|
|
|
doResetThumbnailStatus,
|
|
|
|
doClearPublish,
|
|
|
|
doUpdatePublishForm,
|
|
|
|
doPrepareEdit,
|
2019-07-03 04:30:34 +02:00
|
|
|
} from 'lbry-redux';
|
|
|
|
|
2018-10-29 18:23:53 +01:00
|
|
|
import { doOpenModal } from 'redux/actions/app';
|
2019-07-12 16:58:24 +02:00
|
|
|
import { doPublishDesktop } from 'redux/actions/publish';
|
2019-06-28 09:27:55 +02:00
|
|
|
import { selectUnclaimedRewardValue } from 'lbryinc';
|
|
|
|
import PublishPage from './view';
|
|
|
|
|
|
|
|
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
|
2019-08-29 17:19:37 +02:00
|
|
|
fileInfos: selectFileInfosByOutpoint(state),
|
2019-06-28 09:27:55 +02:00
|
|
|
isStillEditing: selectIsStillEditing(state),
|
|
|
|
isResolvingUri: selectIsResolvingPublishUris(state),
|
|
|
|
totalRewardValue: selectUnclaimedRewardValue(state),
|
|
|
|
});
|
2018-04-02 18:39:00 +02:00
|
|
|
|
|
|
|
const perform = dispatch => ({
|
2019-06-28 09:27:55 +02:00
|
|
|
updatePublishForm: value => dispatch(doUpdatePublishForm(value)),
|
|
|
|
clearPublish: () => dispatch(doClearPublish()),
|
|
|
|
resolveUri: uri => dispatch(doResolveUri(uri)),
|
2019-07-12 16:58:24 +02:00
|
|
|
publish: () => dispatch(doPublishDesktop()),
|
2019-06-28 09:27:55 +02:00
|
|
|
prepareEdit: (claim, uri) => dispatch(doPrepareEdit(claim, uri)),
|
|
|
|
resetThumbnailStatus: () => dispatch(doResetThumbnailStatus()),
|
2018-10-29 18:23:53 +01:00
|
|
|
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
2018-04-02 18:39:00 +02:00
|
|
|
});
|
|
|
|
|
2018-06-08 06:05:45 +02:00
|
|
|
export default connect(
|
2019-06-28 09:27:55 +02:00
|
|
|
select,
|
2018-06-08 06:05:45 +02:00
|
|
|
perform
|
2019-06-28 09:27:55 +02:00
|
|
|
)(PublishPage);
|