diff --git a/react/components/ChannelSelector.jsx b/react/components/ChannelSelector.jsx index 08e78274..068af619 100644 --- a/react/components/ChannelSelector.jsx +++ b/react/components/ChannelSelector.jsx @@ -1,6 +1,6 @@ import React from 'react'; -import ChannelLoginForm from './ChannelLoginForm.jsx'; -import ChannelCreateForm from './ChannelCreateForm.jsx'; +import ChannelLoginForm from '../containers/ChannelLoginForm.jsx'; +import ChannelCreateForm from '../containers/ChannelCreateForm.jsx'; import { connect } from 'react-redux'; const LOGIN = 'login'; @@ -16,7 +16,7 @@ class ChannelSelector extends React.Component { this.selectOption = this.selectOption.bind(this); } componentWillMount () { - console.log('ChannelSelector will mount.'); + console.log('ChannelSelector will mount'); if (this.props.loggedInChannelName) { this.selectOption(this.props.loggedInChannelName); } diff --git a/react/components/Preview.jsx b/react/components/Preview.jsx index 8b246fdd..e6a8248f 100644 --- a/react/components/Preview.jsx +++ b/react/components/Preview.jsx @@ -11,9 +11,7 @@ class Preview extends React.Component { } componentWillMount () { console.log('Preview will mount'); - if (this.props.file) { - this.previewFile(this.props.file); - } + this.previewFile(this.props.file); } componentWillReceiveProps (newProps) { console.log('Preview will receive props', newProps); @@ -44,11 +42,4 @@ class Preview extends React.Component { } }; -const mapStateToProps = state => { - return { - file : state.file, - thumbnail: state.metadata.thumbnail, - }; -}; - -export default connect(mapStateToProps, null)(Preview); +export default Preview; diff --git a/react/components/UrlMiddle.jsx b/react/components/PublishUrlMiddle.jsx similarity index 100% rename from react/components/UrlMiddle.jsx rename to react/components/PublishUrlMiddle.jsx diff --git a/react/components/AnonymousOrChannelSelect.jsx b/react/containers/AnonymousOrChannelSelect.jsx similarity index 96% rename from react/components/AnonymousOrChannelSelect.jsx rename to react/containers/AnonymousOrChannelSelect.jsx index da93a88d..ab2c2efd 100644 --- a/react/components/AnonymousOrChannelSelect.jsx +++ b/react/containers/AnonymousOrChannelSelect.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { setPublishInChannel } from '../actions'; +import { setPublishInChannel } from '../actions/index'; import { connect } from 'react-redux'; class AnonymousOrChannelSelect extends React.Component { diff --git a/react/components/ChannelCreateForm.jsx b/react/containers/ChannelCreateForm.jsx similarity index 98% rename from react/components/ChannelCreateForm.jsx rename to react/containers/ChannelCreateForm.jsx index f289ec5a..008f2d0b 100644 --- a/react/components/ChannelCreateForm.jsx +++ b/react/containers/ChannelCreateForm.jsx @@ -1,6 +1,6 @@ import React from 'react'; import {connect} from 'react-redux'; -import {updateLoggedInChannel} from '../actions'; +import {updateLoggedInChannel} from '../actions/index'; import { makeGetRequest, makePostRequest } from '../utils/xhr.js'; import { setUserCookies } from '../utils/cookies.js'; import { replaceChannelSelectionInNavBar } from '../utils/pageUpdate.js'; @@ -10,8 +10,8 @@ class ChannelCreateForm extends React.Component { super(props); this.state = { error : null, - channel : null, - password: null, + channel : '', + password: '', status : null, }; this.cleanseChannelInput = this.cleanseChannelInput.bind(this); diff --git a/react/components/ChannelLoginForm.jsx b/react/containers/ChannelLoginForm.jsx similarity index 97% rename from react/components/ChannelLoginForm.jsx rename to react/containers/ChannelLoginForm.jsx index b23ea0f8..47beaf34 100644 --- a/react/components/ChannelLoginForm.jsx +++ b/react/containers/ChannelLoginForm.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { makePostRequest } from '../utils/xhr.js'; import { connect } from 'react-redux'; -import { updateLoggedInChannel } from '../actions'; +import { updateLoggedInChannel } from '../actions/index'; import { setUserCookies } from '../utils/cookies.js'; import { replaceChannelSelectionInNavBar } from '../utils/pageUpdate.js'; @@ -10,8 +10,8 @@ class ChannelLoginForm extends React.Component { super(props); this.state = { error : null, - name : null, - password: null, + name : '', + password: '', }; this.handleInput = this.handleInput.bind(this); this.loginToChannel = this.loginToChannel.bind(this); diff --git a/react/components/PreviewDropzone.jsx b/react/containers/Dropzone.jsx similarity index 91% rename from react/components/PreviewDropzone.jsx rename to react/containers/Dropzone.jsx index 49432db1..16dbeb53 100644 --- a/react/components/PreviewDropzone.jsx +++ b/react/containers/Dropzone.jsx @@ -1,12 +1,12 @@ import React from 'react'; // import PropTypes from 'prop-types'; -import { selectFile } from '../actions'; +import { selectFile } from '../actions/index'; import { connect } from 'react-redux'; -import Preview from './Preview.jsx'; +import Preview from '../components/Preview.jsx'; import { validateFile } from '../utils/file.js'; -class PreviewDropzone extends React.Component { +class Dropzone extends React.Component { constructor (props) { super(props); this.state = { @@ -95,7 +95,11 @@ class PreviewDropzone extends React.Component {