From b66c67fc50275b5c03f23a099ffe6d831e0134ed Mon Sep 17 00:00:00 2001 From: varenik163 Date: Sun, 27 Aug 2017 15:40:01 +0400 Subject: [PATCH 1/2] HT_1 --- .idea/workspace.xml | 507 ++++++++++++--------------- src/components/Root.js | 2 + src/components/people/AddUserForm.js | 44 +++ src/components/routes/PeoplePage.js | 36 ++ src/ducks/people.js | 35 ++ src/redux/reducer.js | 4 +- 6 files changed, 342 insertions(+), 286 deletions(-) create mode 100644 src/components/people/AddUserForm.js create mode 100644 src/components/routes/PeoplePage.js create mode 100644 src/ducks/people.js diff --git a/.idea/workspace.xml b/.idea/workspace.xml index eee0d88..3d9788b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,11 +1,13 @@ - + + + + - - - + + @@ -17,14 +19,49 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -32,28 +69,64 @@ - - + + - - + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -65,33 +138,35 @@ - - + + + false + + false + false + true true @@ -100,11 +175,12 @@ - - @@ -256,7 +252,7 @@ - @@ -302,7 +305,8 @@ - @@ -423,14 +427,6 @@ - - - - - - - - @@ -441,22 +437,30 @@ - + - - + + - + - + - - + + + + + + + + + + - + diff --git a/src/components/people/AddUserForm.js b/src/components/people/AddUserForm.js index cef1921..dd62157 100644 --- a/src/components/people/AddUserForm.js +++ b/src/components/people/AddUserForm.js @@ -34,6 +34,16 @@ const validate = ({email}) => { if (!email) errors.email = 'email is required' else if (!emailValidator.validate(email)) errors.email = 'invalid email' + /*тут бы еще хотелось проверять, есть ли уже такой e-mail, но я вот не знаю как лучше подрубить стор? + как то так? + export default connect(state => ({..}))(reduxForm({ + form: 'addPeople', + validate + })(AddUserForm)) + * + * */ + + return errors }