Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

새 그룹 생성 페이지 구현 #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
parksinhae wants to merge 13 commits into callicoder:master
base: master
Choose a base branch
Loading
from eunhye-ahn:frontend/new-group-page
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
13 commits
Select commit Hold shift + click to select a range
74c13ef
db 연결
eunhye-ahn May 15, 2025
fb6753a
그룹 생성
eunhye-ahn May 15, 2025
591b045
내 그룹 목록 조회 api
eunhye-ahn May 19, 2025
44be651
입장코드로 그룹 참여 api
eunhye-ahn May 19, 2025
1d9dfc6
그룹 상세 조회 api
eunhye-ahn May 20, 2025
4841b43
그룹 내 투표 목록 조회 api
eunhye-ahn May 21, 2025
f51663d
그룹투표생성 + 목록 조회 api
eunhye-ahn May 21, 2025
fc15eff
그룹 투표 상세조회 api
eunhye-ahn May 21, 2025
264d1c4
Merge conflict resolved
eunhye-ahn May 21, 2025
b59c69c
Resolve merge conflicts in controller and service
eunhye-ahn May 21, 2025
ea0b292
투표참여 api
eunhye-ahn May 21, 2025
7e3aec1
새 그룹 생성 폼 및 제출 처리
parksinhae May 24, 2025
bec124f
그룹 멤버 추가 로직 및 css 파일 추가
parksinhae May 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 76 additions & 7 deletions polling-app-client/package-lock.json
View file Open in desktop

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion polling-app-client/package.json
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"devDependencies": {
"babel-plugin-import": "^1.6.5",
"react-app-rewire-less": "^2.1.0",
"react-app-rewired": "^1.4.1"
"react-app-rewired": "^1.6.2"
}
}
14 changes: 14 additions & 0 deletions polling-app-client/src/new-group-page/NewGroupPage.css
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -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;
}
102 changes: 102 additions & 0 deletions polling-app-client/src/new-group-page/NewGroupPage.jsx
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
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);

try {
await axios.post('/api/groups', {
name,
description,
imageUrl,
members,
});

message.success('�׷��� ���������� �����Ǿ����Θ�!');
setName('');
setDescription('');
setImageUrl('');
setMembers([]);
setMemberInput('');
} catch (error) {
console.error(error);
message.error('�׷� ���� ����!');
} finally {
setLoading(false);
}
};

return (
<div className="new-group-container">
<h1>�� �׷� ����</h1>
<Form layout="vertical" onSubmitCapture={handleSubmit}>
<Form.Item label="�׷� �̸�">
<Input
value={name}
onChange={(e) => setName(e.target.value)}
placeholder="��: ���͵� �׷�"
/>
</Form.Item>

<Form.Item label="�׷� ����">
<Input.TextArea
value={description}
onChange={(e) => setDescription(e.target.value)}
placeholder="��: �Բ� �����Θ� ���͵��ԴΘ�."
rows={4}
/>
</Form.Item>

<Form.Item label="�̹��� URL">
<Input
value={imageUrl}
onChange={(e) => setImageUrl(e.target.value)}
placeholder="��: https://example.com/image.jpg"
/>
</Form.Item>

<Form.Item label="�׷� ��� �߰�">
<Input
value={memberInput}
onChange={(e) => setMemberInput(e.target.value)}
onPressEnter={handleAddMember}
placeholder="�̸��� �Ǵ� ����� �̸�"
/>
<Button onClick={handleAddMember} style={{ marginTop: '8px' }}>
��� �߰�
</Button>
<ul className="member-list">
{members.map((member, index) => (
<li key={index}>{member}</li>
))}
</ul>
</Form.Item>

<Form.Item>
<Button type="primary" htmlType="submit" loading={loading}>
�׷� ����
</Button>
</Form.Item>
</Form>
</div>
);
};

export default NewGroupPage;
Loading

AltStyle によって変換されたページ (->オリジナル) /