2019-06-28 09:27:55 +02:00
|
|
|
import { connect } from 'react-redux';
|
2019-12-09 19:51:00 +01:00
|
|
|
import {
|
|
|
|
selectBalance,
|
|
|
|
selectIsStillEditing,
|
|
|
|
makeSelectPublishFormValue,
|
|
|
|
doUpdatePublishForm,
|
2019-12-26 16:37:26 +01:00
|
|
|
doClearPublish,
|
2021-03-30 07:03:31 +02:00
|
|
|
makeSelectClaimIsStreamPlaceholder,
|
2019-12-09 19:51:00 +01:00
|
|
|
} from 'lbry-redux';
|
2020-06-12 22:44:25 +02:00
|
|
|
import { doToast } from 'redux/actions/notifications';
|
2020-03-24 18:57:17 +01:00
|
|
|
import { selectFfmpegStatus } from 'redux/selectors/settings';
|
2019-06-28 09:27:55 +02:00
|
|
|
import PublishPage from './view';
|
|
|
|
|
2021-03-30 07:03:31 +02:00
|
|
|
const select = (state, props) => ({
|
2019-06-28 09:27:55 +02:00
|
|
|
name: makeSelectPublishFormValue('name')(state),
|
2020-07-28 01:12:59 +02:00
|
|
|
title: makeSelectPublishFormValue('title')(state),
|
2019-06-28 09:27:55 +02:00
|
|
|
filePath: makeSelectPublishFormValue('filePath')(state),
|
2021-03-30 07:03:31 +02:00
|
|
|
remoteUrl: makeSelectPublishFormValue('remoteFileUrl')(state),
|
2020-03-24 18:57:17 +01:00
|
|
|
optimize: makeSelectPublishFormValue('optimize')(state),
|
2019-06-28 09:27:55 +02:00
|
|
|
isStillEditing: selectIsStillEditing(state),
|
|
|
|
balance: selectBalance(state),
|
2019-10-11 02:37:18 +02:00
|
|
|
publishing: makeSelectPublishFormValue('publishing')(state),
|
2020-03-24 18:57:17 +01:00
|
|
|
ffmpegStatus: selectFfmpegStatus(state),
|
2020-03-30 20:19:32 +02:00
|
|
|
size: makeSelectPublishFormValue('fileSize')(state),
|
|
|
|
duration: makeSelectPublishFormValue('fileDur')(state),
|
|
|
|
isVid: makeSelectPublishFormValue('fileVid')(state),
|
2021-03-30 07:03:31 +02:00
|
|
|
isLivestreamClaim: makeSelectClaimIsStreamPlaceholder(props.uri)(state),
|
2019-06-28 09:27:55 +02:00
|
|
|
});
|
|
|
|
|
2021-03-30 07:03:31 +02:00
|
|
|
const perform = (dispatch) => ({
|
2019-12-26 16:37:26 +01:00
|
|
|
clearPublish: () => dispatch(doClearPublish()),
|
2021-03-30 07:03:31 +02:00
|
|
|
updatePublishForm: (value) => dispatch(doUpdatePublishForm(value)),
|
|
|
|
showToast: (message) => dispatch(doToast({ message, isError: true })),
|
2019-06-28 09:27:55 +02:00
|
|
|
});
|
|
|
|
|
2020-03-30 20:19:32 +02:00
|
|
|
export default connect(select, perform)(PublishPage);
|