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

33 lines
962 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2019-12-09 19:51:00 +01:00
import {
selectBalance,
selectIsStillEditing,
makeSelectPublishFormValue,
doUpdatePublishForm,
doToast,
doClearPublish,
2019-12-09 19:51:00 +01:00
} from 'lbry-redux';
import { selectFfmpegStatus } from 'redux/selectors/settings';
import PublishPage from './view';
const select = state => ({
name: makeSelectPublishFormValue('name')(state),
filePath: makeSelectPublishFormValue('filePath')(state),
optimize: makeSelectPublishFormValue('optimize')(state),
isStillEditing: selectIsStillEditing(state),
balance: selectBalance(state),
publishing: makeSelectPublishFormValue('publishing')(state),
ffmpegStatus: selectFfmpegStatus(state),
});
const perform = dispatch => ({
clearPublish: () => dispatch(doClearPublish()),
updatePublishForm: value => dispatch(doUpdatePublishForm(value)),
2019-12-09 19:51:00 +01:00
showToast: message => dispatch(doToast({ message, isError: true })),
});
export default connect(
select,
perform
)(PublishPage);