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

24 lines
744 B
JavaScript
Raw Permalink Normal View History

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