From 6ae0c07daeea0e03c832b3aa0f838778627431d8 Mon Sep 17 00:00:00 2001
From: Jules Laplace <jules@okfoc.us>
Date: Mon, 20 Mar 2017 04:48:32 +0100
Subject: view app as a different user

---
 client/components/LoggedOutView.jsx | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

(limited to 'client/components/LoggedOutView.jsx')

diff --git a/client/components/LoggedOutView.jsx b/client/components/LoggedOutView.jsx
index 0773059..b176edb 100644
--- a/client/components/LoggedOutView.jsx
+++ b/client/components/LoggedOutView.jsx
@@ -20,21 +20,27 @@ export default class LoggedOutView extends React.Component {
     this.setState({ modal: '' })
   }
   render() {
-    const loginVisible = this.state.modal == 'login'
-    const signupVisible = this.state.modal == 'signup'
-    return (
-      <div>
-        <Welcome
-          onLoginClick={this.showLogin}
-          onSignupClick={this.showSignup} />
+    if (this.state.modal == 'login') {
+      return (
         <LoginForm
-          visible={loginVisible}
+          visible={true}
           onClose={this.closeModal} />
+      )
+    }
+    else if (this.state.modal == 'signup') {
+      return (
         <SignupForm
-          visible={signupVisible}
+          visible={true}
           onClose={this.closeModal} />
-      </div>
-    )
+      )
+    }
+    else {
+      return (
+        <Welcome
+          onLoginClick={this.showLogin}
+          onSignupClick={this.showSignup} />
+      )
+    }
   }
 }
 
@@ -95,6 +101,7 @@ class LoginForm extends React.Component {
         <form onSubmit={this.handleSubmit}>
           <input type='email'
                  name='email'
+                 autoFocus
                  placeholder='Email address'
                  onChange={this.updateState}
           /><br/>
@@ -159,6 +166,7 @@ class SignupForm extends React.Component {
         <form onSubmit={this.handleSubmit}>
           <input type='email'
                  name='email'
+                 autoFocus
                  placeholder='Email address'
                  onChange={this.updateState}
           /><br/>
@@ -171,7 +179,7 @@ class SignupForm extends React.Component {
                  name='goal'
                  min='0'
                  max='100000'
-                 placeholder='Calorie Goal'
+                 placeholder='Goal'
                  onChange={this.updateState}
           /><br/>
           <input type='submit'
-- 
cgit v1.2.3-70-g09d2

