From 0c54f372c1ab6fbea587f9d983b8283325e7d811 Mon Sep 17 00:00:00 2001 From: catarak Date: Tue, 14 Jun 2016 14:46:40 -0400 Subject: [PATCH] store signup in redux --- server/controllers/user.controller.js | 5 ++++- shared/components/Nav/Nav.jsx | 3 ++- shared/components/SignupForm/SignupForm.jsx | 8 ++++---- shared/containers/IDEView/IDEView.jsx | 5 +++-- shared/redux/actions/user.js | 4 +++- shared/redux/reducers/user.js | 5 +++-- styles/base/_reset.scss | 2 +- styles/components/_signup.scss | 4 ++++ 8 files changed, 24 insertions(+), 12 deletions(-) diff --git a/server/controllers/user.controller.js b/server/controllers/user.controller.js index 3cc91484..0aff0670 100644 --- a/server/controllers/user.controller.js +++ b/server/controllers/user.controller.js @@ -24,7 +24,10 @@ export function createUser(req, res, next) { if (err) { return next(err); } - res.json({success: true}); + res.json({ + email: req.user.email, + username: req.user.username + }); }); }); }); diff --git a/shared/components/Nav/Nav.jsx b/shared/components/Nav/Nav.jsx index 92e5424c..d458674a 100644 --- a/shared/components/Nav/Nav.jsx +++ b/shared/components/Nav/Nav.jsx @@ -7,7 +7,8 @@ class Nav extends React.Component { diff --git a/shared/components/SignupForm/SignupForm.jsx b/shared/components/SignupForm/SignupForm.jsx index 2caad118..8868d58d 100644 --- a/shared/components/SignupForm/SignupForm.jsx +++ b/shared/components/SignupForm/SignupForm.jsx @@ -5,19 +5,19 @@ class SignupForm extends React.Component { const {fields: { username, email, password, confirmPassword }, handleSubmit} = this.props; return (
-

+

-

+

-

+

-

+

diff --git a/shared/containers/IDEView/IDEView.jsx b/shared/containers/IDEView/IDEView.jsx index 3df366e7..945fe1a4 100644 --- a/shared/containers/IDEView/IDEView.jsx +++ b/shared/containers/IDEView/IDEView.jsx @@ -12,7 +12,7 @@ class IDEView extends React.Component { render() { return (
-