lbry-desktop/src/ui/page/publish/index.js

45 lines
1.4 KiB
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2018-09-25 02:17:08 +02:00
import { doResolveUri, selectBalance } from 'lbry-redux';
2018-06-12 07:11:17 +02:00
import {
selectPublishFormValues,
selectIsStillEditing,
selectMyClaimForUri,
2018-09-25 02:17:08 +02:00
selectIsResolvingPublishUris,
selectTakeOverAmount,
2018-06-12 07:11:17 +02:00
} from 'redux/selectors/publish';
2018-05-25 20:05:30 +02:00
import {
doResetThumbnailStatus,
2018-05-25 20:05:30 +02:00
doClearPublish,
doUpdatePublishForm,
doPublish,
doPrepareEdit,
} from 'redux/actions/publish';
import PublishPage from './view';
2017-05-02 10:21:00 +02:00
2018-09-25 02:17:08 +02: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),
});
2017-05-02 10:21:00 +02:00
2017-06-06 06:21:55 +02:00
const perform = dispatch => ({
2018-03-26 23:32:43 +02:00
updatePublishForm: value => dispatch(doUpdatePublishForm(value)),
clearPublish: () => dispatch(doClearPublish()),
resolveUri: uri => dispatch(doResolveUri(uri)),
2017-06-17 19:59:18 +02:00
publish: params => dispatch(doPublish(params)),
prepareEdit: (claim, uri) => dispatch(doPrepareEdit(claim, uri)),
2018-04-02 15:55:36 +02:00
resetThumbnailStatus: () => dispatch(doResetThumbnailStatus()),
2017-06-06 06:21:55 +02:00
});
2017-05-02 10:21:00 +02:00
2018-06-12 07:11:17 +02:00
export default connect(
select,
perform
)(PublishPage);