import React from 'react'; import PreviewDropzone from './PreviewDropzone.jsx'; import PublishTitleInput from './PublishTitleInput.jsx'; import ChannelSelector from './ChannelSelector.jsx'; import PublishUrlInput from './PublishUrlInput.jsx'; import PublishThumbnailInput from './PublishThumbnailInput.jsx'; import PublishMetadataInputs from './PublishMetadataInputs.jsx'; import AnonymousOrChannelSelect from './AnonymousOrChannelSelect.jsx'; import { selectFile, clearFile, updateLoggedInChannel } from '../actions'; import { connect } from 'react-redux'; import { getCookie } from '../utils/cookies.js'; class PublishForm extends React.Component { constructor (props) { super(props); // set defaults this.state = { error : null, showMetadataInputs: false, }; this.publish = this.publish.bind(this); } componentWillMount () { // check for whether a channel is already logged in const loggedInChannelName = getCookie('channel_name'); const loggedInChannelShortId = getCookie('short_channel_id'); const loggedInChannelLongId = getCookie('long_channel_id'); console.log(`channel cookies found: ${loggedInChannelName} ${loggedInChannelShortId} ${loggedInChannelLongId}`); this.props.onChannelLogin(loggedInChannelName, loggedInChannelShortId, loggedInChannelLongId); } publish () { // publish the asset } render () { return (
{ (this.props.fileType === 'video/mp4') && }

By clicking 'Upload', you affirm that you have the rights to publish this content to the LBRY network, and that you understand the properties of publishing it to a decentralized, user-controlled network. Read more.

); } }; const mapStateToProps = state => { return { fileType: state.file.type, claim : state.claim, }; }; const mapDispatchToProps = dispatch => { return { onFileSelect: (file) => { dispatch(selectFile(file)); }, onFileClear: () => { dispatch(clearFile()); }, onChannelLogin: (name, shortId, longId) => { dispatch(updateLoggedInChannel(name, shortId, longId)); }, }; }; export default connect(mapStateToProps, mapDispatchToProps)(PublishForm);