From b69e7ba74e0dc533826c6f8456b7d82c51a14e5d Mon Sep 17 00:00:00 2001 From: saseungmin Date: Tue, 1 Dec 2020 22:17:04 +0900 Subject: [PATCH] [Feature] register(sign up) validation error message - auth api catch for renders error message --- src/components/auth/AuthForm.jsx | 5 +- src/containers/auth/RegisterFormContainer.jsx | 34 ++++-- .../auth/RegisterFormContainer.test.jsx | 110 ++++++++++++++++-- .../write/WriteButtonsContainer.jsx | 15 +-- src/util/messages.js | 13 +++ src/util/utils.js | 4 + 6 files changed, 154 insertions(+), 27 deletions(-) create mode 100644 src/util/messages.js diff --git a/src/components/auth/AuthForm.jsx b/src/components/auth/AuthForm.jsx index 3f9a0ff..95e3a58 100644 --- a/src/components/auth/AuthForm.jsx +++ b/src/components/auth/AuthForm.jsx @@ -12,7 +12,7 @@ const FORM_TYPE = { }; const AuthForm = ({ - type, fields, onChange, onSubmit, + type, fields, onChange, onSubmit, error, }) => { const formType = FORM_TYPE[type]; @@ -60,6 +60,9 @@ const AuthForm = ({ onChange={handleChange} /> )} + {error && ( +
{error}
+ )}