2019-06-28 09:27:55 +02:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import {
|
|
|
|
makeSelectPublishFormValue,
|
|
|
|
selectIsStillEditing,
|
|
|
|
selectMyClaimForUri,
|
2021-08-05 22:44:52 +02:00
|
|
|
selectTakeOverAmount,
|
2019-07-03 04:30:34 +02:00
|
|
|
doUpdatePublishForm,
|
|
|
|
doPrepareEdit,
|
|
|
|
} from 'lbry-redux';
|
2021-02-09 17:05:56 +01:00
|
|
|
import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app';
|
|
|
|
import { doSetActiveChannel } from 'redux/actions/app';
|
2019-06-28 09:27:55 +02:00
|
|
|
import PublishPage from './view';
|
|
|
|
|
2021-02-24 07:02:19 +01:00
|
|
|
const select = (state) => ({
|
2019-06-28 09:27:55 +02:00
|
|
|
name: makeSelectPublishFormValue('name')(state),
|
2021-02-24 07:02:19 +01:00
|
|
|
uri: makeSelectPublishFormValue('uri')(state),
|
2019-06-28 09:27:55 +02:00
|
|
|
isStillEditing: selectIsStillEditing(state),
|
|
|
|
myClaimForUri: selectMyClaimForUri(state),
|
2021-02-09 17:05:56 +01:00
|
|
|
activeChannelClaim: selectActiveChannelClaim(state),
|
|
|
|
incognito: selectIncognito(state),
|
2021-08-05 22:44:52 +02:00
|
|
|
amountNeededForTakeover: selectTakeOverAmount(state),
|
2019-06-28 09:27:55 +02:00
|
|
|
});
|
|
|
|
|
2021-02-24 07:02:19 +01:00
|
|
|
const perform = (dispatch) => ({
|
|
|
|
updatePublishForm: (value) => dispatch(doUpdatePublishForm(value)),
|
2019-06-28 09:27:55 +02:00
|
|
|
prepareEdit: (claim, uri) => dispatch(doPrepareEdit(claim, uri)),
|
2021-02-24 07:02:19 +01:00
|
|
|
setActiveChannel: (claimId) => dispatch(doSetActiveChannel(claimId)),
|
2019-06-28 09:27:55 +02:00
|
|
|
});
|
|
|
|
|
2021-02-09 17:05:56 +01:00
|
|
|
export default connect(select, perform)(PublishPage);
|