lbry-desktop/ui/modal/modalPublishPreview/index.js
infinite-persistence 6697c2a9ce PublishPreview: Add chan icon; fix "anonymous" label
## Issue
Closes 5721: Publish-Preview updates

## Changes
(1) Match the recent "incognito" change that sets the channel to `undefined` via `updatePublishForm`. This change would also cover `null` -- I don't think it's being used to represent something else, so showing "Anonymous" for `null` should be fine.

(2) Added channel icons, so it'll be more obvious to the user if they accidentally selected the wrong channel.
2021-03-21 21:13:35 -04:00

31 lines
1.1 KiB
JavaScript

import { connect } from 'react-redux';
import { doHideModal } from 'redux/actions/app';
import ModalPublishPreview from './view';
import {
makeSelectPublishFormValue,
selectPublishFormValues,
selectIsStillEditing,
selectMyChannelClaims,
SETTINGS,
} from 'lbry-redux';
import { selectFfmpegStatus, makeSelectClientSetting } from 'redux/selectors/settings';
import { doPublishDesktop } from 'redux/actions/publish';
import { doSetClientSetting } from 'redux/actions/settings';
const select = (state) => ({
...selectPublishFormValues(state),
myChannels: selectMyChannelClaims(state),
isVid: makeSelectPublishFormValue('fileVid')(state),
isStillEditing: selectIsStillEditing(state),
ffmpegStatus: selectFfmpegStatus(state),
enablePublishPreview: makeSelectClientSetting(SETTINGS.ENABLE_PUBLISH_PREVIEW)(state),
});
const perform = (dispatch) => ({
publish: (filePath, preview) => dispatch(doPublishDesktop(filePath, preview)),
closeModal: () => dispatch(doHideModal()),
setEnablePublishPreview: (value) => dispatch(doSetClientSetting(SETTINGS.ENABLE_PUBLISH_PREVIEW, value)),
});
export default connect(select, perform)(ModalPublishPreview);