-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 완료버튼 추가 * 그룹생성 페이지 수정 * ci: 설정 파일 수정 * feat: 헤더 영역 추가 * remove: 버튼 삭제 * feat: dummy 데이터 파일 생성 * docs: import styled-component 삭제 * feat: tab 생성 --------- Co-authored-by: 조준호 <[email protected]>
- Loading branch information
Showing
7 changed files
with
264 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
node: true, | ||
jest: true, | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:jsx-a11y/recommended', | ||
'plugin:react-hooks/recommended', | ||
], | ||
overrides: [], | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
plugins: ['react', 'react-hooks', 'jsx-a11y'], | ||
rules: { | ||
'react/react-in-jsx-scope': 'off', | ||
}, | ||
settings: { | ||
react: { version: 'detect' }, | ||
}, | ||
extends: ['eslint:recommended', 'plugin:react/recommended'], | ||
plugins: ['react'], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
import React from 'react' | ||
import { PlusOutlined } from '@ant-design/icons' | ||
import { Form, Input, Button, Upload } from 'antd' | ||
import styled from 'styled-components' | ||
|
||
// 폼 전송 성공 시 실행되는 함수 | ||
/* Create 구현 필요 */ | ||
const onFinish = async (values) => { | ||
try { | ||
const formData = new FormData() | ||
formData.append('groupname', values.groupname) | ||
formData.append('groupdescription', values.groupdescription) | ||
if (values.fileList && values.fileList.length > 0) { | ||
formData.append('file', values.fileList[0].originFileObj) | ||
} | ||
|
||
const response = await fetch('http://localhost:3001/groups', { | ||
method: 'POST', | ||
body: formData, | ||
}) | ||
|
||
if (!response.ok) { | ||
throw new Error('서버 응답이 실패하였습니다.') | ||
} | ||
|
||
console.log('폼 데이터 전송 성공:', values.groupname) | ||
} catch (error) { | ||
console.error('폼 데이터 전송 실패:', error) | ||
} | ||
} | ||
|
||
// 폼 전송 실패 시 실행되는 함수 | ||
const onFinishFailed = (errorInfo) => { | ||
console.log('Failed:', errorInfo) | ||
} | ||
|
||
// 파일 업로드 시 실행되는 함수 | ||
const normFile = (e) => { | ||
console.log('Upload event:', e) | ||
if (Array.isArray(e)) { | ||
return e | ||
} | ||
return e && e.fileList | ||
} | ||
|
||
// 전체 폼을 감싸는 스타일드 컴포넌트 | ||
const StyledForm = styled(Form)` | ||
margin: 30px; | ||
` | ||
// 폼을 감싸는 스타일드 컴포넌트 | ||
const StyledFormWrapper = styled.div` | ||
padding: 10px; | ||
border-radius: 10px; | ||
background-color: rgba(0, 62.67, 151.94, 0.08); | ||
max-width: 800px; | ||
margin: 10px auto; | ||
` | ||
|
||
// 타이틀을 감싸는 스타일드 컴포넌트 | ||
const Title = styled.h1` | ||
margin: 10px 40px; | ||
text-align: left; | ||
font-size: 32px; | ||
font-family: 'KoPubWorld Dotum'; | ||
font-weight: 700; | ||
word-wrap: break-word; | ||
` | ||
// 폼 아이템을 감싸는 스타일드 컴포넌트 | ||
const StyledFormItems = styled(Form.Item)` | ||
.ant-form-item-label { | ||
text-align: left; | ||
margin-left: 40px; | ||
font-size: 24px; | ||
font-family: 'KoPubWorld Dotum'; | ||
font-weight: 700; | ||
word-wrap: break-word; | ||
} | ||
.ant-input { | ||
text-align: left; | ||
font-size: 14px; | ||
margin-top: 6px; | ||
} | ||
.ant-btn { | ||
height: 50px; | ||
width: 100px; | ||
font-size: 24px; | ||
} | ||
` | ||
const CreateForm = () => ( | ||
<StyledForm | ||
name="basic" | ||
labelCol={{ | ||
span: 3, | ||
}} | ||
wrapperCol={{ | ||
span: 16, | ||
}} | ||
initialValues={{ | ||
remember: true, | ||
}} | ||
onFinish={onFinish} | ||
onFinishFailed={onFinishFailed} | ||
autoComplete="off" | ||
> | ||
<StyledFormWrapper> | ||
<Title>모임 기본 정보 등록</Title> | ||
<StyledFormItems label="모임 이름" name="groupname"> | ||
<Input placeholder="ex) 한사랑산악회, 숭실대 IT대 학생회" /> | ||
</StyledFormItems> | ||
<StyledFormItems label="모임 설명" name="groupdescription"> | ||
<Input placeholder="ex) 열정 있는 사람들의 모임" /> | ||
</StyledFormItems> | ||
</StyledFormWrapper> | ||
<StyledFormWrapper> | ||
<Title>모임 회원 등록</Title> | ||
<StyledFormItems label="파일 업로드" valuePropName="fileList" getValueFromEvent={normFile}> | ||
<Upload action="/upload.do" accept=".csv, .xlsx" listType="picture-card" maxCount={1}> | ||
<button | ||
style={{ | ||
border: 0, | ||
background: 'none', | ||
}} | ||
type="button" | ||
> | ||
<PlusOutlined /> | ||
<div | ||
style={{ | ||
marginTop: 8, | ||
}} | ||
> | ||
업로드하기 | ||
</div> | ||
</button> | ||
</Upload> | ||
</StyledFormItems> | ||
</StyledFormWrapper> | ||
<StyledFormItems wrapperCol={{}}> | ||
<Button type="primary" htmlType="submit"> | ||
완료 | ||
</Button> | ||
</StyledFormItems> | ||
</StyledForm> | ||
) | ||
export default CreateForm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,43 @@ | ||
import { Menu } from 'antd' | ||
import { Link } from 'react-router-dom' | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
|
||
const StyledNavBar = styled.div` | ||
const StyledMenu = styled(Menu)` | ||
height: 200px; | ||
width: 100%; | ||
background-color: green; | ||
background-color: #003f98; | ||
display: flex; | ||
justify-content: right; | ||
padding: 40px; | ||
.ant-menu-item { | ||
height: 40px; | ||
color: white; | ||
font-size: 22px; | ||
font-weight: 700; | ||
font-family: 'KoPubWorld Dotum'; | ||
word-wrap: break-word; | ||
margin-right: 50px; | ||
} | ||
` | ||
|
||
const items = [ | ||
{ | ||
key: 'myGroups', | ||
label: <Link to="/showGroupList">나의 모임</Link>, | ||
}, | ||
{ | ||
key: 'myEvents', | ||
label: <Link to="/showEventList">나의 이벤트</Link>, | ||
}, | ||
{ | ||
key: 'myProfile', | ||
label: <Link to="/showProfile">김보안</Link>, | ||
}, | ||
] | ||
|
||
const NavBar = () => { | ||
return ( | ||
<div> | ||
<StyledNavBar /> | ||
</div> | ||
) | ||
return <StyledMenu mode="horizontal" items={items}></StyledMenu> | ||
} | ||
|
||
export default NavBar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import React from 'react' | ||
// import styled from 'styled-components' | ||
import CreateForm from '../../Components/Forms/CreateForm' | ||
//import CreateForm from '../../Components/Forms/CreateForm' | ||
|
||
const CreateGroup = () => { | ||
return <div></div> | ||
return ( | ||
<div> | ||
<CreateForm /> | ||
</div> | ||
) | ||
} | ||
|
||
export default CreateGroup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,37 @@ | ||
import React from 'react' | ||
|
||
import styled from 'styled-components' | ||
import { Tabs } from 'antd' | ||
import dummy from '../../db/data.json' | ||
const Wrapper = styled.div` | ||
padding: 10px; | ||
border-radius: 10px; | ||
background-color: rgba(0, 62.67, 151.94, 0.08); | ||
max-width: 400px; | ||
margin: 10px 60px; | ||
` | ||
const onChange = (key) => { | ||
console.log(key) | ||
} | ||
/* Read 구현 필요 */ | ||
const items = [ | ||
{ | ||
key: '1', | ||
label: '회원', | ||
children: '그룹 정보', | ||
}, | ||
{ | ||
key: '2', | ||
label: '이벤트', | ||
children: '그룹 멤버', | ||
}, | ||
] | ||
console.log(dummy) | ||
const ShowGroupDetails = () => { | ||
return <div>ShowGroupDetails 페이지</div> | ||
return ( | ||
<Wrapper> | ||
<Tabs defaultActiveKey="1" items={items} onChange={onChange}></Tabs> | ||
</Wrapper> | ||
) | ||
} | ||
|
||
export default ShowGroupDetails |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"users": [{ "userId": 1 }, { "userId": 2 }, { "userId": 3 }], | ||
|
||
"groups": [ | ||
{ | ||
"id": 1, | ||
"name": "모임1", | ||
"descript": "모임1입니다." | ||
}, | ||
{ | ||
"id": 2, | ||
"name": "모임2", | ||
"descript": "모임2입니다." | ||
}, | ||
{ | ||
"id": 3, | ||
"name": "모임3", | ||
"descript": "모임3입니다." | ||
} | ||
] | ||
} |