diff options
| author | Jules Laplace <jules@okfoc.us> | 2017-03-20 04:48:32 +0100 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2017-03-20 04:48:32 +0100 |
| commit | 6ae0c07daeea0e03c832b3aa0f838778627431d8 (patch) | |
| tree | bb14c7ccff4743afd36e7175c094eb5521ab25f2 /client/components/LoggedOutView.jsx | |
| parent | 50eaaa9dfaa2d4aa1230e7a6b371a60c1df8a1ab (diff) | |
view app as a different user
Diffstat (limited to 'client/components/LoggedOutView.jsx')
| -rw-r--r-- | client/components/LoggedOutView.jsx | 32 |
1 files changed, 20 insertions, 12 deletions
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' |
