2016-11-21 04:52:11 -05:00
|
|
|
import Drawer from './components/drawer';
|
2016-11-13 13:08:52 -05:00
|
|
|
import ComposeFormContainer from './containers/compose_form_container';
|
2016-11-21 04:52:11 -05:00
|
|
|
import UploadFormContainer from './containers/upload_form_container';
|
|
|
|
import NavigationContainer from './containers/navigation_container';
|
|
|
|
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
2016-10-15 06:06:30 -04:00
|
|
|
import SuggestionsContainer from './containers/suggestions_container';
|
2016-11-21 04:52:11 -05:00
|
|
|
import SearchContainer from './containers/search_container';
|
2016-10-15 06:06:30 -04:00
|
|
|
import { fetchSuggestions } from '../../actions/suggestions';
|
2016-11-21 04:52:11 -05:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { mountCompose, unmountCompose } from '../../actions/compose';
|
2016-10-12 07:17:17 -04:00
|
|
|
|
|
|
|
const Compose = React.createClass({
|
|
|
|
|
2016-10-15 06:06:30 -04:00
|
|
|
propTypes: {
|
|
|
|
dispatch: React.PropTypes.func.isRequired
|
|
|
|
},
|
|
|
|
|
2016-10-12 07:17:17 -04:00
|
|
|
mixins: [PureRenderMixin],
|
|
|
|
|
2016-10-15 06:06:30 -04:00
|
|
|
componentDidMount () {
|
2016-11-21 04:52:11 -05:00
|
|
|
this.props.dispatch(mountCompose());
|
2016-10-15 06:06:30 -04:00
|
|
|
this.props.dispatch(fetchSuggestions());
|
|
|
|
},
|
|
|
|
|
2016-11-21 04:52:11 -05:00
|
|
|
componentWillUnmount () {
|
|
|
|
this.props.dispatch(unmountCompose());
|
|
|
|
},
|
|
|
|
|
2016-10-12 07:17:17 -04:00
|
|
|
render () {
|
|
|
|
return (
|
|
|
|
<Drawer>
|
|
|
|
<div style={{ flex: '1 1 auto' }}>
|
2016-11-13 07:04:18 -05:00
|
|
|
<SearchContainer />
|
2016-10-12 07:17:17 -04:00
|
|
|
<NavigationContainer />
|
|
|
|
<ComposeFormContainer />
|
|
|
|
<UploadFormContainer />
|
|
|
|
</div>
|
|
|
|
|
2016-10-15 06:06:30 -04:00
|
|
|
<SuggestionsContainer />
|
2016-10-12 07:17:17 -04:00
|
|
|
</Drawer>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2016-10-15 06:06:30 -04:00
|
|
|
export default connect()(Compose);
|