2019-06-28 09:27:55 +02:00
|
|
|
import { connect } from 'react-redux';
|
2021-10-17 10:36:14 +02:00
|
|
|
import { selectBalance } from 'redux/selectors/wallet';
|
|
|
|
import { selectIsStillEditing, makeSelectPublishFormValue } from 'redux/selectors/publish';
|
|
|
|
import { doUpdatePublishForm, doClearPublish } from 'redux/actions/publish';
|
2021-11-16 04:52:35 +01:00
|
|
|
import { selectIsStreamPlaceholderForUri } from 'redux/selectors/claims';
|
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';
|
2022-07-11 16:12:37 +02:00
|
|
|
import PostPage from './view';
|
2019-06-28 09:27:55 +02:00
|
|
|
|
2021-04-14 06:06:11 +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-04-14 06:06:11 +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-11-16 04:52:35 +01:00
|
|
|
isLivestreamClaim: selectIsStreamPlaceholderForUri(state, props.uri),
|
2019-06-28 09:27:55 +02:00
|
|
|
});
|
|
|
|
|
2022-05-19 16:41:32 +02:00
|
|
|
const perform = {
|
|
|
|
doClearPublish,
|
|
|
|
doUpdatePublishForm,
|
|
|
|
doToast,
|
|
|
|
};
|
2019-06-28 09:27:55 +02:00
|
|
|
|
2022-07-11 16:12:37 +02:00
|
|
|
export default connect(select, perform)(PostPage);
|