From e567bac5f87cb69d5e7547cfc2fdbb1ded631fb9 Mon Sep 17 00:00:00 2001 From: saseungmin Date: Wed, 25 Nov 2020 00:30:58 +0900 Subject: [PATCH] [Feature] onChange All Write Fields in Write Page - All Write page test success --- fixtures/write-form.js | 14 ++++ src/components/write/WriteForm.jsx | 64 +++++++++++++++++ src/components/write/WriteForm.test.jsx | 55 +++++++++++++++ src/containers/write/TagsFormContainer.jsx | 1 + src/containers/write/WriteFormContainer.jsx | 32 +++++++++ .../write/WriteFormContainer.test.jsx | 69 +++++++++++++++++++ src/pages/WritePage.jsx | 16 +---- src/reducers/slice.js | 4 +- 8 files changed, 240 insertions(+), 15 deletions(-) create mode 100644 fixtures/write-form.js create mode 100644 src/components/write/WriteForm.jsx create mode 100644 src/components/write/WriteForm.test.jsx create mode 100644 src/containers/write/WriteFormContainer.jsx create mode 100644 src/containers/write/WriteFormContainer.test.jsx diff --git a/fixtures/write-form.js b/fixtures/write-form.js new file mode 100644 index 0000000..6d5cb55 --- /dev/null +++ b/fixtures/write-form.js @@ -0,0 +1,14 @@ +const writeForm = { + title: '스터디를 소개합니다.1', + contents: '우리는 이것저것 합니다.1', + moderatorId: 'user1', + applyEndDate: '2020-11-26', + participants: [], + personnel: 10, + tags: [ + 'JavaScript', + 'Algorithm', + ], +}; + +export default writeForm; diff --git a/src/components/write/WriteForm.jsx b/src/components/write/WriteForm.jsx new file mode 100644 index 0000000..9a4cdd7 --- /dev/null +++ b/src/components/write/WriteForm.jsx @@ -0,0 +1,64 @@ +import React from 'react'; + +import styled from '@emotion/styled'; + +const WriteFormWrapper = styled.div``; + +const WriteForm = ({ onChange, fields }) => { + const { + title, applyEndDate, personnel, contents, + } = fields; + + const handleChange = (e) => { + const { name, value } = e.target; + + onChange({ name, value }); + }; + + return ( + +
+ +
+
+ + +
+
+ + +
+
+ {/* TODO: 추후 draft.js를 사용하여 변경 예정 */} +