Skip to content

Commit

Permalink
use const for state/props
Browse files Browse the repository at this point in the history
  • Loading branch information
echenley committed Sep 19, 2015
1 parent 8944633 commit 4d8116d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions src/js/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import LoginLinks from './components/LoginLinks';
import ProfileLink from './components/ProfileLink';
import Icon from './components/Icon';

let App = React.createClass({
const App = React.createClass({

propTypes: {
children: React.PropTypes.object
Expand All @@ -50,7 +50,7 @@ let App = React.createClass({
},

onModalUpdate(newModalState) {
let oldModalState = this.state.modal;
const oldModalState = this.state.modal;

function onKeyUp(e) {
// esc key closes modal
Expand Down Expand Up @@ -89,8 +89,8 @@ let App = React.createClass({
return null;
}

let modalInner;
let modalProps = {
let modalInner = null;
const modalProps = {
user: this.state.user,
errorMessage: modal.errorMessage
};
Expand All @@ -112,7 +112,7 @@ let App = React.createClass({
},

render() {
let { user, modal } = this.state;
const { user, modal } = this.state;

return (
<div className="wrapper full-height">
Expand Down
8 changes: 4 additions & 4 deletions src/js/components/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Login = React.createClass({

login(e) {
e.preventDefault();
let { email, password } = this.state;
const { email, password } = this.state;

this.setState({
submitted: true
Expand All @@ -53,10 +53,10 @@ const Login = React.createClass({
},

render() {
let { submitted, email, password } = this.state;
let { errorMessage } = this.props;
const { submitted, email, password } = this.state;
const { errorMessage } = this.props;

let error = errorMessage && (
const error = errorMessage && (
<div className="error modal-form-error">{ errorMessage }</div>
);

Expand Down
4 changes: 2 additions & 2 deletions src/js/components/Modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Modal = React.createClass({
},

render() {
let { hideModal } = this.props;
const { hideModal, children } = this.props;

return (
<div className="modal-overlay" onClick={ hideModal }>
Expand All @@ -23,7 +23,7 @@ const Modal = React.createClass({
<Icon svg={ require('../../svg/close.svg') } />
<span className="sr-only">Hide Modal</span>
</a>
{ this.props.children }
{ children }
</div>
</div>
);
Expand Down
10 changes: 5 additions & 5 deletions src/js/components/Register.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const Register = React.createClass({

registerUser(e) {
e.preventDefault();
let { username, email, password } = this.state;
const { username, email, password } = this.state;

if (!username) {
return Actions.modalError('NO_USERNAME');
Expand All @@ -52,7 +52,7 @@ const Register = React.createClass({
submitted: true
});

let loginData = {
const loginData = {
email: email,
password: password
};
Expand All @@ -61,10 +61,10 @@ const Register = React.createClass({
},

render() {
let { submitted, username, email, password } = this.state;
let { errorMessage } = this.props;
const { submitted, username, email, password } = this.state;
const { errorMessage } = this.props;

let error = errorMessage && (
const error = errorMessage && (
<div className="error modal-form-error">{ errorMessage }</div>
);

Expand Down

0 comments on commit 4d8116d

Please sign in to comment.