lbry-desktop/ui/component/postEditor/index.js

21 lines
838 B
JavaScript
Raw Permalink Normal View History

import { connect } from 'react-redux';
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';
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),
isStillEditing: selectIsStillEditing(state),
});
const perform = (dispatch) => ({
updatePublishForm: (value) => dispatch(doUpdatePublishForm(value)),
fetchStreamingUrl: (uri) => dispatch(doPlayUri(uri)),
});
2020-07-29 22:30:26 +02:00
export default connect(select, perform)(PostEditor);