2020-07-28 01:12:59 +02:00
|
|
|
import { connect } from 'react-redux';
|
2021-10-08 05:47:39 +02:00
|
|
|
import { doUpdatePublishForm } from 'redux/actions/publish';
|
|
|
|
import { selectIsStillEditing, makeSelectPublishFormValue } from 'redux/selectors/publish';
|
|
|
|
import { makeSelectStreamingUrlForUri } from 'redux/selectors/file_info';
|
2020-07-30 22:00:22 +02:00
|
|
|
import { doPlayUri } from 'redux/actions/content';
|
2020-07-29 22:30:26 +02:00
|
|
|
import PostEditor from './view';
|
2020-07-28 01:12:59 +02:00
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
filePath: makeSelectPublishFormValue('filePath')(state),
|
|
|
|
fileText: makeSelectPublishFormValue('fileText')(state),
|
2020-07-30 22:00:22 +02:00
|
|
|
streamingUrl: makeSelectStreamingUrlForUri(props.uri)(state),
|
2020-07-28 01:12:59 +02:00
|
|
|
isStillEditing: selectIsStillEditing(state),
|
|
|
|
});
|
|
|
|
|
2021-10-08 05:47:39 +02:00
|
|
|
const perform = (dispatch) => ({
|
|
|
|
updatePublishForm: (value) => dispatch(doUpdatePublishForm(value)),
|
|
|
|
fetchStreamingUrl: (uri) => dispatch(doPlayUri(uri)),
|
2020-07-28 01:12:59 +02:00
|
|
|
});
|
|
|
|
|
2020-07-29 22:30:26 +02:00
|
|
|
export default connect(select, perform)(PostEditor);
|