Date: Sun, 25 May 2025 03:33:58 +0900
Subject: [PATCH 11/12] =?UTF-8?q?=EC=83=88=20=EA=B7=B8=EB=A3=B9=20?=
=?UTF-8?q?=EC=83=9D=EC=84=B1=20=ED=8F=BC=20=EB=B0=8F=20=EC=A0=9C=EC=B6=9C?=
=?UTF-8?q?=20=EC=B2=98=EB=A6=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/new-group-page/NewGroupPage.jsx | 74 +++++++++++++++++++
1 file changed, 74 insertions(+)
create mode 100644 polling-app-client/src/new-group-page/NewGroupPage.jsx
diff --git a/polling-app-client/src/new-group-page/NewGroupPage.jsx b/polling-app-client/src/new-group-page/NewGroupPage.jsx
new file mode 100644
index 00000000..f5e02d42
--- /dev/null
+++ b/polling-app-client/src/new-group-page/NewGroupPage.jsx
@@ -0,0 +1,74 @@
+import React, { useState } from 'react';
+import { Input, Button, Form, message } from 'antd';
+import axios from 'axios';
+
+const NewGroupPage = () => {
+ const [name, setName] = useState('');
+ const [description, setDescription] = useState('');
+ const [imageUrl, setImageUrl] = useState('');
+ const [loading, setLoading] = useState(false);
+
+ const handleSubmit = async (e) => {
+ e.preventDefault();
+ setLoading(true);
+
+ try {
+ await axios.post('/api/groups', {
+ name,
+ description,
+ imageUrl,
+ });
+
+ message.success(' Ǿϴ!');
+ // Էâ ʱȭ
+ setName('');
+ setDescription('');
+ setImageUrl('');
+ } catch (error) {
+ console.error(error);
+ message.error(' !');
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ return (
+
+
+
+ setName(e.target.value)}
+ placeholder=": ͵ "
+ />
+
+
+
+ setDescription(e.target.value)}
+ placeholder=": Բ ϴ ͵Դϴ."
+ rows={4}
+ />
+
+
+
+ setImageUrl(e.target.value)}
+ placeholder=": https://example.com/image.jpg"
+ />
+
+
+
+
+
+
+
+ );
+};
+
+export default NewGroupPage;
From bec124f88f8cf661006c753f782b31546b8a4ccb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EB=B0=95=EC=8B=A0=ED=98=9C?=
Date: Sun, 25 May 2025 12:59:24 +0900
Subject: [PATCH 12/12] =?UTF-8?q?=EA=B7=B8=EB=A3=B9=20=EB=A9=A4=EB=B2=84?=
=?UTF-8?q?=20=EC=B6=94=EA=B0=80=20=EB=A1=9C=EC=A7=81=20=EB=B0=8F=20css=20?=
=?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=B6=94=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/new-group-page/NewGroupPage.css | 14 ++++++++
.../src/new-group-page/NewGroupPage.jsx | 32 +++++++++++++++++--
2 files changed, 44 insertions(+), 2 deletions(-)
create mode 100644 polling-app-client/src/new-group-page/NewGroupPage.css
diff --git a/polling-app-client/src/new-group-page/NewGroupPage.css b/polling-app-client/src/new-group-page/NewGroupPage.css
new file mode 100644
index 00000000..46b48796
--- /dev/null
+++ b/polling-app-client/src/new-group-page/NewGroupPage.css
@@ -0,0 +1,14 @@
+.new-group-container {
+ max-width: 600px;
+ margin: 0 auto;
+ padding: 20px;
+}
+
+.member-list {
+ margin-top: 10px;
+ padding-left: 20px;
+}
+
+.member-list li {
+ margin-bottom: 4px;
+}
diff --git a/polling-app-client/src/new-group-page/NewGroupPage.jsx b/polling-app-client/src/new-group-page/NewGroupPage.jsx
index f5e02d42..f01fa59e 100644
--- a/polling-app-client/src/new-group-page/NewGroupPage.jsx
+++ b/polling-app-client/src/new-group-page/NewGroupPage.jsx
@@ -1,13 +1,22 @@
import React, { useState } from 'react';
import { Input, Button, Form, message } from 'antd';
import axios from 'axios';
+import './NewGroupPage.css'; // CSS и import
const NewGroupPage = () => {
const [name, setName] = useState('');
const [description, setDescription] = useState('');
const [imageUrl, setImageUrl] = useState('');
+ const [members, setMembers] = useState([]);
+ const [memberInput, setMemberInput] = useState('');
const [loading, setLoading] = useState(false);
+ const handleAddMember = () => {
+ if (memberInput.trim() === '') return;
+ setMembers([...members, memberInput.trim()]);
+ setMemberInput('');
+ };
+
const handleSubmit = async (e) => {
e.preventDefault();
setLoading(true);
@@ -17,13 +26,15 @@ const NewGroupPage = () => {
name,
description,
imageUrl,
+ members,
});
message.success(' Ǿϴ!');
- // Էâ ʱȭ
setName('');
setDescription('');
setImageUrl('');
+ setMembers([]);
+ setMemberInput('');
} catch (error) {
console.error(error);
message.error(' !');
@@ -33,7 +44,7 @@ const NewGroupPage = () => {
};
return (
-