You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

8 years ago
  1. import Drawer from './components/drawer';
  2. import ComposeFormContainer from './containers/compose_form_container';
  3. import UploadFormContainer from './containers/upload_form_container';
  4. import NavigationContainer from './containers/navigation_container';
  5. import PureRenderMixin from 'react-addons-pure-render-mixin';
  6. import SearchContainer from './containers/search_container';
  7. import { connect } from 'react-redux';
  8. import { mountCompose, unmountCompose } from '../../actions/compose';
  9. const Compose = React.createClass({
  10. propTypes: {
  11. dispatch: React.PropTypes.func.isRequired,
  12. withHeader: React.PropTypes.bool
  13. },
  14. mixins: [PureRenderMixin],
  15. componentDidMount () {
  16. this.props.dispatch(mountCompose());
  17. },
  18. componentWillUnmount () {
  19. this.props.dispatch(unmountCompose());
  20. },
  21. render () {
  22. return (
  23. <Drawer withHeader={this.props.withHeader}>
  24. <SearchContainer />
  25. <NavigationContainer />
  26. <ComposeFormContainer />
  27. <UploadFormContainer />
  28. </Drawer>
  29. );
  30. }
  31. });
  32. export default connect()(Compose);