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

25 lines
963 B
JavaScript
Raw Permalink Normal View History

2018-04-02 18:39:00 +02:00
import { connect } from 'react-redux';
import { selectPublishFormValues, selectMyClaimForUri } from 'redux/selectors/publish';
import { selectFileInfosByOutpoint } from 'redux/selectors/file_info';
import { doUpdatePublishForm, doResetThumbnailStatus } from 'redux/actions/publish';
import { doOpenModal } from 'redux/actions/app';
import PublishPage from './view';
const select = (state, props) => {
const publishFormFields = selectPublishFormValues(state);
return {
...publishFormFields,
thumbnail: props.thumbnail || publishFormFields.thumbnail,
fileInfos: selectFileInfosByOutpoint(state),
myClaimForUri: selectMyClaimForUri(state),
};
};
2018-04-02 18:39:00 +02:00
const perform = (dispatch) => ({
updatePublishForm: (value) => dispatch(doUpdatePublishForm(value)),
resetThumbnailStatus: () => dispatch(doResetThumbnailStatus()),
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
2018-04-02 18:39:00 +02:00
});
export default connect(select, perform)(PublishPage);