diff --git a/client/components/Nav.js b/client/components/Nav.js index f1e931a6..687f4b7a 100644 --- a/client/components/Nav.js +++ b/client/components/Nav.js @@ -1,37 +1,44 @@ -import React from 'react'; +import React, { PropTypes } from 'react'; import { Link } from 'react-router'; -class Nav extends React.Component { - render() { - return ( - - - - - New - - - - - Save - - - - - - {this.props.user.authenticated && Hello, {this.props.user.username}!} - {!this.props.user.authenticated && Login or Sign Up} - - - - ); - } +function Nav(props) { + return ( + + + + + New + + + + + Save + + + + + + {props.user.authenticated && Hello, {props.user.username}!} + {!props.user.authenticated && Login or Sign Up} + + + + ); } +Nav.propTypes = { + createProject: PropTypes.func.isRequired, + saveProject: PropTypes.func.isRequired, + user: PropTypes.shape({ + authenticated: PropTypes.bool.isRequired, + username: PropTypes.string + }).isRequired +}; + export default Nav; diff --git a/client/modules/App/App.js b/client/modules/App/App.js index 937c7713..9aa7c1df 100644 --- a/client/modules/App/App.js +++ b/client/modules/App/App.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { PropTypes } from 'react'; import { connect } from 'react-redux'; import DevTools from './components/DevTools'; @@ -22,4 +22,8 @@ class App extends React.Component { } } +App.propTypes = { + children: PropTypes.object +}; + export default connect()(App); diff --git a/client/modules/User/components/LoginForm.js b/client/modules/User/components/LoginForm.js index a9196935..c7ae778b 100644 --- a/client/modules/User/components/LoginForm.js +++ b/client/modules/User/components/LoginForm.js @@ -31,7 +31,7 @@ function LoginForm(props) { LoginForm.propTypes = { fields: PropTypes.shape({ - username: PropTypes.string.isRequired, + email: PropTypes.string.isRequired, password: PropTypes.string.isRequired }).isRequired, handleSubmit: PropTypes.func.isRequired,
- New -
- Save -
Hello, {this.props.user.username}!
Login or Sign Up
+ New +
+ Save +
Hello, {props.user.username}!