import React, { Component, PropTypes } from 'react';
import fetchData from '../../actions/fetchData';
import Toast from '../../components/Toast';
import Modals from '../Modals';
import SocketEvents from '../../utils/socketEvents';
import t from '../../utils/types';
import './Main.scss';

import MainNav from '../MainNav';

export default class Main extends Component {
  static propTypes = {
    site: t.site.isRequired,
    socket: PropTypes.object.isRequired,
    ui: PropTypes.object.isRequired,
    user: t.user.isRequired,
    location: PropTypes.object.isRequired,
    children: PropTypes.object.isRequired,
    dispatch: PropTypes.func.isRequired,
  };

  componentDidMount() {
    const { dispatch, socket } = this.props;

    fetchData();

    const events = new SocketEvents(socket, dispatch);
    events.listen();
  }

  render() {
    const { ui, dispatch, site, user } = this.props;

    const isFetching = Object.keys(this.props).some(key => this.props[key].isFetching);
    if (isFetching) return null;

    return (
      <main className="main">
        <MainNav siteName={site.siteName} user={user} />
        {React.cloneElement(this.props.children, {
          ...this.props,
          key: this.props.location.pathname,
        })}

        <div className="toasts">
          {ui.toasts.map(t => <Toast dispatch={dispatch} key={t.dateCreated} {...t} />)}
        </div>
        <Modals {...this.props} />
      </main>
    );
  }
}

@@ -402,29 +402,18 @@
 : t.site
-.isRequired
 ,%0A
+
     sock
@@ -498,27 +498,16 @@
 : t.user
-.isRequired
 ,%0A    lo
@@ -631,14 +631,77 @@
 ed,%0A
-
   %7D;%0A%0A
+  static defaultProps = %7B%0A    site: null,%0A    user: null,%0A  %7D%0A%0A
   co

Remove two more required prop warnings