diff --git a/package-lock.json b/package-lock.json index 868b023..c6d4eb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "react-dom": "^18.2.0", "react-dropzone": "^14.2.3", "react-modal": "^3.16.1", + "react-quill": "^2.0.0", "react-router-dom": "^6.22.3", "react-scripts": "5.0.1", "react-select": "^5.8.0", @@ -4673,6 +4674,14 @@ "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.12.tgz", "integrity": "sha512-bZcOkJ6uWrL0Qb2NAWKa7TBU+mJHPzhx9jjLL1KHF+XpzEcR7EXHvjbHlGtR/IsP1vyPrehuS6XqkmaePy//mg==" }, + "node_modules/@types/quill": { + "version": "1.3.10", + "resolved": "https://registry.npmjs.org/@types/quill/-/quill-1.3.10.tgz", + "integrity": "sha512-IhW3fPW+bkt9MLNlycw8u8fWb7oO7W5URC9MfZYHBlA24rex9rs23D5DETChu1zvgVdc5ka64ICjJOgQMr6Shw==", + "dependencies": { + "parchment": "^1.1.2" + } + }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", @@ -6473,6 +6482,14 @@ "wrap-ansi": "^7.0.0" } }, + "node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", + "engines": { + "node": ">=0.8" + } + }, "node_modules/clsx": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", @@ -8654,11 +8671,21 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, + "node_modules/fast-diff": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz", + "integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==" + }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -13543,6 +13570,11 @@ "tslib": "^2.0.3" } }, + "node_modules/parchment": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz", + "integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==" + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -15205,6 +15237,75 @@ } ] }, + "node_modules/quill": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/quill/-/quill-1.3.7.tgz", + "integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==", + "dependencies": { + "clone": "^2.1.1", + "deep-equal": "^1.0.1", + "eventemitter3": "^2.0.3", + "extend": "^3.0.2", + "parchment": "^1.1.4", + "quill-delta": "^3.6.2" + } + }, + "node_modules/quill-delta": { + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-3.6.3.tgz", + "integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==", + "dependencies": { + "deep-equal": "^1.0.1", + "extend": "^3.0.2", + "fast-diff": "1.1.2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/quill-delta/node_modules/deep-equal": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.2.tgz", + "integrity": "sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg==", + "dependencies": { + "is-arguments": "^1.1.1", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.5.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/quill/node_modules/deep-equal": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.2.tgz", + "integrity": "sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg==", + "dependencies": { + "is-arguments": "^1.1.1", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.5.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/quill/node_modules/eventemitter3": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz", + "integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg==" + }, "node_modules/raf": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", @@ -15501,6 +15602,20 @@ "react-dom": "^15.5.x || ^16.x || ^17.x || ^18.x" } }, + "node_modules/react-quill": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/react-quill/-/react-quill-2.0.0.tgz", + "integrity": "sha512-4qQtv1FtCfLgoD3PXAur5RyxuUbPXQGOHgTlFie3jtxp43mXDtzCKaOgQ3mLyZfi1PUlyjycfivKelFhy13QUg==", + "dependencies": { + "@types/quill": "^1.3.10", + "lodash": "^4.17.4", + "quill": "^1.3.7" + }, + "peerDependencies": { + "react": "^16 || ^17 || ^18", + "react-dom": "^16 || ^17 || ^18" + } + }, "node_modules/react-refresh": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", diff --git a/package.json b/package.json index c60577c..26b68cf 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "react-dom": "^18.2.0", "react-dropzone": "^14.2.3", "react-modal": "^3.16.1", + "react-quill": "^2.0.0", "react-router-dom": "^6.22.3", "react-scripts": "5.0.1", "react-select": "^5.8.0", diff --git a/public/icons/file-text.svg b/public/icons/file-text.svg new file mode 100644 index 0000000..c1c659e --- /dev/null +++ b/public/icons/file-text.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/App.js b/src/App.js index cf8cd06..d7aea88 100644 --- a/src/App.js +++ b/src/App.js @@ -16,6 +16,8 @@ import TeamMemberRecruitmentNotice from "./components/TeamMemberRecruitmentNotic import RegisterMember from "./pages/RegisterMember/registerMember"; import MyTeamDetail from "./components/MyPage/MyTeamDetail/myTeamDetail"; import ResumeDetail from "./pages/ResumeDetail/resumeDetail"; +import TeamDetail from "./pages/TeamAnnouncementDetail/teamAnnouncementDetail"; +import TeamAnnouncementDetail from "./pages/TeamAnnouncementDetail/teamAnnouncementDetail"; const App = () => { const [userInfo, setUserInfo] = useRecoilState(userInfoState); @@ -53,13 +55,17 @@ const App = () => { } /> } /> } /> - } /> + } /> } /> } /> } /> } /> } /> } /> + } + /> diff --git a/src/api/applicationAPI.js b/src/api/applicationAPI.js new file mode 100644 index 0000000..463080e --- /dev/null +++ b/src/api/applicationAPI.js @@ -0,0 +1,15 @@ +import { axiosWithAuth } from "./axios"; + +export const applicationAPI = { + applyTeamAnnouncement(announcementId, resumeId) { + return axiosWithAuth.post( + `/application/${announcementId}?resume_id=${resumeId}`, + ); + }, + postNewTeamAnnouncement(data, teamId) { + return axiosWithAuth.post("/team-announcement", data); + }, + getMyApplications(page, state) { + return axiosWithAuth.get(`/application?page=${page}&state=${state}`); + }, +}; diff --git a/src/api/axios.js b/src/api/axios.js index 98fc2d8..0165c47 100644 --- a/src/api/axios.js +++ b/src/api/axios.js @@ -28,7 +28,8 @@ axiosWithAuth.interceptors.response.use( const { accessToken } = reIssueResponse.data.data; localStorage.setItem("access_token", accessToken); axiosWithAuth.defaults.headers.Authorization = `Bearer ${accessToken}`; - await axios(originRequest).then((res) => {}); + originRequest.headers.Authorization = `Bearer ${accessToken}`; + return axiosWithAuth(originRequest); // window.location.replace("/"); } else { // window.location.replace("/sign-in"); diff --git a/src/api/teamAPI.js b/src/api/teamAPI.js index cff6db5..2fdb532 100644 --- a/src/api/teamAPI.js +++ b/src/api/teamAPI.js @@ -12,7 +12,7 @@ export const teamAPI = { name: data.name, introduction: data.introduction, domain: data.domain, - location: data.location, + region: data.location, phoneNumber: data.phoneNumber, email: data.email, }), @@ -35,16 +35,15 @@ export const teamAPI = { return axiosWithAuth.get(`/team/${id}`); }, postNewTeamAnnouncement(data, teamId) { - return axiosWithAuth.post(`/team/${teamId}/announcement`, data); + return axiosWithAuth.post("/team-announcement", data); }, inviteTeamMember(data) { return axiosWithAuth.post("/team/invite", data); }, getMyTeams() { - return axiosWithAuth.get("/user/me/teams"); + return axiosWithAuth.get("/user/me/team"); }, getTeamAnnouncements(filter) { - // occupationClassifications가 비어 있는지 확인 const { occupationClassifications, ...rest } = filter; const params = { ...rest, @@ -59,4 +58,25 @@ export const teamAPI = { }, }); }, + getResumeAnnouncements(filter) { + const { occupationClassifications, ...rest } = filter; + const params = { + ...rest, + occupationClassifications: + occupationClassifications.length > 0 ? occupationClassifications : "", + }; + + return axiosWithAuth.get("/resume-announcement", { + params, + paramsSerializer: (params) => { + return qs.stringify(params, { arrayFormat: "repeat" }); + }, + }); + }, + getTeamParticipantsByTeamId(id) { + return axiosWithAuth.get(`/team/${id}/participant`); + }, + getTeamAnnouncementById(id) { + return axiosWithAuth.get(`/team-announcement/${id}`); + }, }; diff --git a/src/api/testDummyData/memberTestData.js b/src/api/testDummyData/memberTestData.js index a6e2bac..ded6691 100644 --- a/src/api/testDummyData/memberTestData.js +++ b/src/api/testDummyData/memberTestData.js @@ -9,6 +9,7 @@ const memberTestData = [ "React와 JavaScript 경험이 있는 열정적인 프론트엔드 개발자입니다.", skill1: "React", skill2: "JavaScript", + occupationClassifications: [], }, { id: 2, @@ -19,6 +20,7 @@ const memberTestData = [ introduction: "Node.js와 MongoDB에 능숙한 백엔드 개발자입니다.", skill1: "Node.js", skill2: "MongoDB", + occupationClassifications: [], }, { id: 3, @@ -29,6 +31,7 @@ const memberTestData = [ introduction: "프론트엔드와 백엔드 기술에 능숙한 풀스택 개발자입니다.", skill1: "React", skill2: "Node.js", + occupationClassifications: [], }, { id: 4, @@ -40,6 +43,7 @@ const memberTestData = [ "사용자 중심 설계에 열정을 가진 창의적인 UI/UX 디자이너입니다.", skill1: "Adobe XD", skill2: "Figma", + occupationClassifications: [], }, { id: 5, @@ -50,6 +54,7 @@ const memberTestData = [ introduction: "iOS와 Android 개발에 능숙한 경험 많은 모바일 개발자입니다.", skill1: "iOS", skill2: "Android", + occupationClassifications: [], }, { id: 6, @@ -61,6 +66,7 @@ const memberTestData = [ "머신러닝과 데이터 분석에 대한 배경을 가진 데이터 과학자입니다.", skill1: "Python", skill2: "TensorFlow", + occupationClassifications: [], }, ]; diff --git a/src/api/testDummyData/teamTestData.js b/src/api/testDummyData/teamTestData.js index 08512a1..600ba26 100644 --- a/src/api/testDummyData/teamTestData.js +++ b/src/api/testDummyData/teamTestData.js @@ -11,6 +11,7 @@ const teamTestData = [ category1: "웹 개발", category2: "인공지능", like: false, + occupationClassifications: [], }, { id: 2, @@ -24,6 +25,7 @@ const teamTestData = [ category1: "앱 개발", category2: "데이터 분석", like: true, + occupationClassifications: [], }, { id: 3, @@ -36,6 +38,7 @@ const teamTestData = [ category1: "게임 개발", category2: "블록체인", like: true, + occupationClassifications: [], }, { id: 4, @@ -49,6 +52,7 @@ const teamTestData = [ category1: "데이터 사이언스", category2: "클라우드 컴퓨팅", like: true, + occupationClassifications: [], }, { id: 5, @@ -61,6 +65,7 @@ const teamTestData = [ category1: "로봇공학", category2: "인터넷 of Things (IoT)", like: false, + occupationClassifications: [], }, { id: 6, @@ -74,6 +79,7 @@ const teamTestData = [ category1: "소프트웨어 개발", category2: "머신 러닝", like: false, + occupationClassifications: [], }, ]; diff --git a/src/components/Card/memberCard.js b/src/components/Card/memberCard.js index 2197a63..4f33731 100644 --- a/src/components/Card/memberCard.js +++ b/src/components/Card/memberCard.js @@ -13,6 +13,42 @@ import { Title, } from "./styles"; +const occupationOptions = { + design_ui_ux: "UI/UX 디자인", + design_illustration_character: "일러스트/캐릭터 디자인", + design_movie_motion_graphic: "영화/모션그래픽 디자인", + design_product_package: "제품/패키지 디자인", + design_passion: "열정 디자인", + design_crafts: "공예 디자인", + design_graphic: "그래픽 디자인", + development_frontend: "프론트엔드 개발", + development_backend: "백엔드 개발", + development_ai: "AI 개발", + development_devops: "DevOps 개발", + development_security: "보안 개발", + development_game: "게임 개발", + development_embedded: "임베디드 개발", + development_dba: "DBA", + plan: "기획", + media_editing_movie: "영화 편집", + media_filming_movie: "영화 촬영", + media_pd: "PD", + media_photographer: "사진작가", + media_sound_engineer: "음향 엔지니어", + marketing_management: "마케팅 관리", + marketing_promotion: "마케팅 홍보", + marketing_consulting: "마케팅 컨설팅", + translation_english: "영어 번역", + translation_japanese: "일본어 번역", + translation_chinese: "중국어 번역", + translation_spanish: "스페인어 번역", + translation_arabic: "아랍어 번역", + translation_hindi: "힌디어 번역", + translation_french: "프랑스어 번역", + translation_etc: "기타 번역", + etc: "기타", +}; + const MemberCard = ({ data }) => { return ( @@ -59,8 +95,11 @@ const MemberCard = ({ data }) => {
- {data.skill1} - {data.skill2} + {data.occupationClassifications.map((item, index) => { + return ( + {occupationOptions[item]} + ); + })}
diff --git a/src/components/Card/styles.js b/src/components/Card/styles.js index e55ad1c..64c9979 100644 --- a/src/components/Card/styles.js +++ b/src/components/Card/styles.js @@ -4,6 +4,7 @@ export const Container = styled.div` padding: 28px; display: flex; flex-direction: column; + justify-content: space-between; border-radius: 24px; border: 1px solid #c9c9c9; background-color: #ffffff; diff --git a/src/components/Card/teamCard.js b/src/components/Card/teamCard.js index ab007ff..3352fc1 100644 --- a/src/components/Card/teamCard.js +++ b/src/components/Card/teamCard.js @@ -1,3 +1,4 @@ +import { useNavigate } from "react-router-dom"; import { ButtonBox, Container, @@ -13,58 +14,108 @@ import { Title, } from "./styles"; +const occupationOptions = { + design_ui_ux: "UI/UX 디자인", + design_illustration_character: "일러스트/캐릭터 디자인", + design_movie_motion_graphic: "영화/모션그래픽 디자인", + design_product_package: "제품/패키지 디자인", + design_passion: "열정 디자인", + design_crafts: "공예 디자인", + design_graphic: "그래픽 디자인", + development_frontend: "프론트엔드 개발", + development_backend: "백엔드 개발", + development_ai: "AI 개발", + development_devops: "DevOps 개발", + development_security: "보안 개발", + development_game: "게임 개발", + development_embedded: "임베디드 개발", + development_dba: "DBA", + plan: "기획", + media_editing_movie: "영화 편집", + media_filming_movie: "영화 촬영", + media_pd: "PD", + media_photographer: "사진작가", + media_sound_engineer: "음향 엔지니어", + marketing_management: "마케팅 관리", + marketing_promotion: "마케팅 홍보", + marketing_consulting: "마케팅 컨설팅", + translation_english: "영어 번역", + translation_japanese: "일본어 번역", + translation_chinese: "중국어 번역", + translation_spanish: "스페인어 번역", + translation_arabic: "아랍어 번역", + translation_hindi: "힌디어 번역", + translation_french: "프랑스어 번역", + translation_etc: "기타 번역", + etc: "기타", +}; + const TeamCard = ({ data }) => { + const navigate = useNavigate(); + + const clickTeamCard = () => { + navigate(`${data.id}`); + }; return ( - -
- + +
- {data.title} -
-
- {data.recruitmentStatus ? ( - 모집 중 - ) : ( - 모집 마감 - )} - 1시간 전 -
-
- QWER{data.teamName} - SEOUL{data.location} + +
+ {data.title} +
+
+ {data.recruitmentStatus ? ( + 모집 중 + ) : ( + 모집 마감 + )} + 1시간 전 +
+
+ QWER{data.teamId} + {data.region} +
+
+ {data.summary} +
+
-
- {data.description} +
+ + + {data.occupationClassifications.map((item, index) => { + return ( + + {occupationOptions[item]} + + ); + })} + + +
-
- - - UI/UX 디자이너{data.category1} - 프론트엔드{data.category2} - 프론트엔드{data.category2} - 프론트엔드{data.category2} - 프론트엔드{data.category2} - 프론트엔드{data.category2} - - - ); }; diff --git a/src/components/CardGrid/memberCardGrid.js b/src/components/CardGrid/memberCardGrid.js index 6b51c05..306a52f 100644 --- a/src/components/CardGrid/memberCardGrid.js +++ b/src/components/CardGrid/memberCardGrid.js @@ -1,12 +1,11 @@ import MemberCard from "../Card/memberCard"; -import { GridContainer, Title } from "./styles"; +import { GridContainer } from "./styles"; const MemberCardGrid = (props) => { return (
- AI 팀원 추천 {props.cardDatas.map((item) => ( diff --git a/src/components/CardGrid/teamCardGrid.js b/src/components/CardGrid/teamCardGrid.js index 63cf5ad..2baf35f 100644 --- a/src/components/CardGrid/teamCardGrid.js +++ b/src/components/CardGrid/teamCardGrid.js @@ -1,12 +1,11 @@ import TeamCard from "../Card/teamCard"; -import { GridContainer, Title } from "./styles"; +import { GridContainer } from "./styles"; const TeamCardGrid = (props) => { return (
- AI 팀 추천 {props.cardDatas.map((item) => ( diff --git a/src/components/ContestDetail/contestDetail.js b/src/components/ContestDetail/contestDetail.js index a1e9f66..e5111c4 100644 --- a/src/components/ContestDetail/contestDetail.js +++ b/src/components/ContestDetail/contestDetail.js @@ -1,5 +1,5 @@ // CompetitionDetail.js -import React from "react"; +import React, { useState } from "react"; import { Container, Header, @@ -12,9 +12,18 @@ import { Tag, Divider, FooterNote, + DescriptionWrapper, + MoreButton, + MoreButtonText, } from "./styles"; const ContestDetail = ({ data }) => { + const [isExpanded, setIsExpanded] = useState(false); + + const toggleDescription = () => { + setIsExpanded(!isExpanded); + }; + return (
{data.title}
@@ -57,7 +66,12 @@ const ContestDetail = ({ data }) => {
상세 내용
-
{data.description}
+ + {data.description} + + + {isExpanded ? "접기" : "더보기"} + ※ 주최사 홈페이지의 공모요강을 확인하시기 바랍니다. diff --git a/src/components/ContestDetail/styles.js b/src/components/ContestDetail/styles.js index 1232ed5..077e2bb 100644 --- a/src/components/ContestDetail/styles.js +++ b/src/components/ContestDetail/styles.js @@ -36,6 +36,7 @@ export const Details = styled.div` display: flex; flex-direction: column; justify-content: space-between; + margin-left: 80px; `; export const DetailItem = styled.div` @@ -85,3 +86,40 @@ export const FilterText = styled.label` cursor: pointer; padding: 0 10px; `; + +export const DescriptionWrapper = styled.div` + max-height: ${(props) => (props.isExpanded ? "none" : "300px")}; + overflow: hidden; + position: relative; + transition: max-height 0.3s ease; + + &::after { + content: ""; + display: ${(props) => (props.isExpanded ? "none" : "block")}; + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 50%; + background: linear-gradient(to bottom, transparent, white); + } +`; + +export const MoreButton = styled.button` + display: ${(props) => (props.isExpanded ? "none" : "visible")}; + background: #fafafa; + border: none; + cursor: pointer; + padding: 16px; + text-align: center; + margin-top: 10px; + + &:hover { + text-decoration: underline; + } +`; + +export const MoreButtonText = styled.label` + font-size: 20px; + color: #292929; +`; diff --git a/src/components/MyPage/MyFavorites/styles.js b/src/components/MyPage/MyFavorites/styles.js index b93a260..f578901 100644 --- a/src/components/MyPage/MyFavorites/styles.js +++ b/src/components/MyPage/MyFavorites/styles.js @@ -90,4 +90,5 @@ export const CardContainter = styled.div` display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; + overflow: scroll; `; diff --git a/src/components/MyPage/MyPageSideBar/myPageSideBar.js b/src/components/MyPage/MyPageSideBar/myPageSideBar.js index 659e935..8b3c0c6 100644 --- a/src/components/MyPage/MyPageSideBar/myPageSideBar.js +++ b/src/components/MyPage/MyPageSideBar/myPageSideBar.js @@ -49,9 +49,6 @@ const MyPageSideBar = ({ return ( sideButtonClick(index)}> - {curPage === index && ( - - )} {item} ); diff --git a/src/components/MyPage/MyPageSideBar/styles.js b/src/components/MyPage/MyPageSideBar/styles.js index 01b5f9b..aabdd34 100644 --- a/src/components/MyPage/MyPageSideBar/styles.js +++ b/src/components/MyPage/MyPageSideBar/styles.js @@ -1,4 +1,17 @@ -import styled from "styled-components"; +import styled, { css } from "styled-components"; + +const sharedStyles = css` + width: 200px; + height: 60px; + border: none; + border-radius: 12px; + font-size: 20px; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + transition: background-color 0.3s ease; +`; export const Container = styled.div` margin-right: 60px; @@ -13,40 +26,21 @@ export const Container = styled.div` `; export const SelectPage = styled.button` - width: 200px; - height: 60px; - border: none; - border-radius: 12px; - font-size: 20px; + ${sharedStyles} + color: #0f0f0f; font-weight: 600; - background-color: #ffffff; - display: flex; - align-items: center; - justify-content: center; - cursor: pointer; - - transition: background-color 0.3s ease; + background-color: #f2f2f2; &:hover { - background-color: #e6e6e6; + background-color: #f2f2f2; } `; export const NotSelectPage = styled.button` - width: 200px; - height: 60px; - border: none; - border-radius: 12px; - font-size: 20px; + ${sharedStyles} font-weight: 400; color: #c9c9c9; background-color: #ffffff; - display: flex; - align-items: center; - justify-content: center; - cursor: pointer; - - transition: background-color 0.3s ease; &:hover { - background-color: #e6e6e6; + background-color: #f2f2f2; } `; diff --git a/src/components/MyPage/MySupport/mySupport.js b/src/components/MyPage/MySupport/mySupport.js index c005eab..b85a831 100644 --- a/src/components/MyPage/MySupport/mySupport.js +++ b/src/components/MyPage/MySupport/mySupport.js @@ -1,4 +1,4 @@ -import { useState, useEffect } from "react"; +import { useState, useEffect, useRef } from "react"; import { Container, Title, @@ -9,11 +9,15 @@ import { import { ReactComponent as CheckCircleOff } from "../../../assets/myPage/CheckCircleOff.svg"; import { ReactComponent as CheckCircleOn } from "../../../assets/myPage/CheckCircleOn.svg"; import MySupportCard from "../../MyPageCard/MySupportCard/mySupportCard"; -import supportTestData from "../../../api/testDummyData/supportTestData"; +import { applicationAPI } from "../../../api/applicationAPI"; import { ReactComponent as Line } from "../../../assets/myPage/myInfoVector1.svg"; const MySupport = ({ innerRef }) => { + const [applications, setApplications] = useState([]); + const [filteredApplications, setFilteredApplications] = useState([]); const [isCompleted, setIsCompleted] = useState(false); + const [page, setPage] = useState(1); + const [visible, setVisible] = useState({ step0: false, step1: false, @@ -58,9 +62,29 @@ const MySupport = ({ innerRef }) => { EndAnimation, }; + const fetchApplications = async (page, state) => { + try { + const response = await applicationAPI.getMyApplications(page, state); + console.log(response.data.data); + setApplications(response.data.data.content); + setFilteredApplications(response.data.data.content); + } catch (err) { + console.log(err); + } + }; + useEffect(() => { StartAnimation(); - }, []); + fetchApplications(0, "all"); + }, [page]); + + useEffect(() => { + if (isCompleted) { + setFilteredApplications(applications.filter((app) => !app.isCompleted)); + } else { + setFilteredApplications(applications); + } + }, [isCompleted, applications]); return ( @@ -84,7 +108,7 @@ const MySupport = ({ innerRef }) => {
- {supportTestData.map((item) => ( + {filteredApplications.map((item) => ( ))} diff --git a/src/components/MyPage/MyTeam/myTeam.js b/src/components/MyPage/MyTeam/myTeam.js index fad23b5..ad0f436 100644 --- a/src/components/MyPage/MyTeam/myTeam.js +++ b/src/components/MyPage/MyTeam/myTeam.js @@ -1,4 +1,4 @@ -import { useState, useEffect } from "react"; +import { useState, useEffect, useRef } from "react"; import { Container, Title, @@ -13,11 +13,11 @@ import { ReactComponent as CheckCircleOff } from "../../../assets/myPage/CheckCi import { ReactComponent as CheckCircleOn } from "../../../assets/myPage/CheckCircleOn.svg"; import { ReactComponent as Cross } from "../../../assets/myPage/Cross.svg"; import MyTeamCard from "../../MyPageCard/MyTeamCard/myTeamCard"; -import MyTeamTestData from "../../../api/testDummyData/myTeamTestData"; import { teamAPI } from "../../../api/teamAPI"; const MyTeam = ({ setIsCreateTeam, innerRef }) => { const [myTeams, setMyTeams] = useState([]); + const [filteredTeams, setFilteredTeams] = useState([]); const [isMyTeam, setIsMyTeam] = useState(false); const [visible, setVisible] = useState({ @@ -28,6 +28,7 @@ const MyTeam = ({ setIsCreateTeam, innerRef }) => { const MyTeamBtn = () => { setIsMyTeam(!isMyTeam); + console.log(filteredTeams); }; const StartAnimation = () => { @@ -69,6 +70,7 @@ const MyTeam = ({ setIsCreateTeam, innerRef }) => { const response = await teamAPI.getMyTeams(); console.log(response.data.data); setMyTeams(response.data.data); + setFilteredTeams(response.data.data); } catch (err) { console.log(err); } finally { @@ -81,6 +83,14 @@ const MyTeam = ({ setIsCreateTeam, innerRef }) => { getMyTeams(); }, []); + useEffect(() => { + if (isMyTeam) { + setFilteredTeams(myTeams.filter((team) => team.isOwner)); + } else { + setFilteredTeams(myTeams); + } + }, [isMyTeam, myTeams]); + return ( 팀관리 @@ -98,7 +108,7 @@ const MyTeam = ({ setIsCreateTeam, innerRef }) => { > {isMyTeam ? : } - 나의 팀만 보기 + 내가 팀장인 팀만 보기
@@ -109,8 +119,8 @@ const MyTeam = ({ setIsCreateTeam, innerRef }) => { 팀 생성 - {myTeams.map((item) => ( - + {filteredTeams.map((item) => ( + ))} diff --git a/src/components/MyPage/MyTeam/styles.js b/src/components/MyPage/MyTeam/styles.js index 0b1e491..a994007 100644 --- a/src/components/MyPage/MyTeam/styles.js +++ b/src/components/MyPage/MyTeam/styles.js @@ -78,14 +78,14 @@ export const CreateTeamButton = styled.button` `; export const CardContainter = styled.div` + display: grid; + grid-template-columns: repeat(2, 1fr); margin-left: auto; margin-right: auto; margin-top: 30px; margin-bottom: 50px; width: 767px; height: 600px; - display: flex; - flex-wrap: wrap; gap: 20px; overflow-y: auto; `; diff --git a/src/components/MyPage/MyTeamDetail/myTeamDetail.js b/src/components/MyPage/MyTeamDetail/myTeamDetail.js index 4f3d4cd..0f7fd66 100644 --- a/src/components/MyPage/MyTeamDetail/myTeamDetail.js +++ b/src/components/MyPage/MyTeamDetail/myTeamDetail.js @@ -1,17 +1,20 @@ import React, { useEffect, useState } from "react"; import { useParams } from "react-router-dom"; import { teamAPI } from "../../../api/teamAPI"; -import Select from "react-select"; import { Container, Title, Details, + DetailsWrapper, InviteContainer, InviteInput, InviteButton, SelectedEmail, SelectedEmailList, CloseButton, + LogoImage, + DetailsTitle, + DetailsContent, } from "./styles"; import Navigation from "../../Navigation/navigation"; @@ -85,15 +88,22 @@ const MyTeamDetail = () => {
+ {teamDetails.name} -
-

Email: {teamDetails.email}

-

FormationDate: {teamDetails.formationDate}

-

id: {teamDetails.id}

-

Introduction: {teamDetails.introduction}

-

phoneNumber: {teamDetails.phoneNumber}

-

logo: {teamDetails.logo}

-
+ +
+ Email + {teamDetails.email} + Formation Date + {teamDetails.formationDate} + ID + {teamDetails.id} + Introduction + {teamDetails.introduction} + Phone Number + {teamDetails.phoneNumber} +
+
{ const [teamName, setTeamName] = useState(""); - const [teamDescription, setTeamDescription] = useState(""); + const [teamIntroduction, setTeamIntroduction] = useState(""); + const [teamContent, setTeamContent] = useState(""); const [domain, setDomain] = useState(""); const [location, setLocation] = useState(""); const [phoneNumber, setPhoneNumber] = useState(""); @@ -40,7 +41,8 @@ const MyTeamPage = ({ setIsCreateTeam }) => { const registerTeam = async () => { if ( !teamName || - !teamDescription || + !teamIntroduction || + !teamContent || !domain || !location || !phoneNumber || @@ -48,7 +50,9 @@ const MyTeamPage = ({ setIsCreateTeam }) => { ) { setErrors({ teamName: teamName ? "" : "팀명을 입력해 주세요", - teamDescription: teamDescription ? "" : "팀 상세 소개를 입력해 주세요", + teamIntroduction: teamIntroduction + ? "" + : "팀 상세 소개를 입력해 주세요", domain: domain ? "" : "분야를 선택해 주세요", location: location ? "" : "활동 지역을 선택해 주세요", phoneNumber: phoneNumber ? "" : "연락처를 입력해 주세요", @@ -57,7 +61,8 @@ const MyTeamPage = ({ setIsCreateTeam }) => { } else { const data = { name: teamName, - introduction: teamDescription, + introduction: teamIntroduction, + content: teamContent, domain: domain, location: location, phoneNumber: phoneNumber, @@ -80,21 +85,23 @@ const MyTeamPage = ({ setIsCreateTeam }) => { return ( 신규 팀 등록 - - -
+ +
- 프로필 설정
{ style={{ width: "200px", height: "200px" }} /> ) : ( -

- 사진을 여기에 드래그 하거나 클릭하여 업로드하세요 1:1 비율 권장 -

+
+

+ 팀 로고 등록 +

+
)}
-
- 팀 상세 소개 - handleChange(e.target.value, setTeamDescription)} - /> -
-
- - {errors.teamDescription && ( -
{errors.teamDescription}
- )} -
- 팀명 - handleChange(e.target.value, setTeamName)} - /> - {errors.teamName && ( -
{errors.teamName}
- )} - 활동 지역 - handleChange(e.target.value, setLocation)} +
- - - - - - - - - - - - - - - - - - - {errors.location && ( -
{errors.location}
- )} -
+
+ 팀명 + 분야 + 활동 지역 + 연락처 + 이메일 +
+
+ handleChange(e.target.value, setTeamName)} + /> + {errors.teamName && ( +
{errors.teamName}
+ )} -
- 분야 - handleChange(e.target.value, setDomain)} - > - - - - - {errors.domain &&
{errors.domain}
} - - 연락처 - handleChange(e.target.value, setPhoneNumber)} - /> - {errors.phoneNumber && ( -
{errors.phoneNumber}
- )} - - 이메일 - handleChange(e.target.value, setEmail)} - /> - {errors.email &&
{errors.email}
} + handleChange(e.target.value, setDomain)} + > + + + + + {errors.domain && ( +
{errors.domain}
+ )} + + handleChange(e.target.value, setLocation)} + > + + + + + + + + + + + + + + + + + + + {errors.location && ( +
{errors.location}
+ )} + + handleChange(e.target.value, setPhoneNumber)} + /> + {errors.phoneNumber && ( +
{errors.phoneNumber}
+ )} + + handleChange(e.target.value, setEmail)} + /> + {errors.email && ( +
{errors.email}
+ )} +
+
- - 등록하기 - + 한줄 소개 + handleChange(e.target.value, setTeamIntroduction)} + /> +
+ +
+ 상세 소개 + handleChange(e.target.value, setTeamContent)} + /> +
+ +
+ + 등록하기 + +
); }; diff --git a/src/components/MyPage/MyTeamPage/styled.js b/src/components/MyPage/MyTeamPage/styled.js index 8353083..c4ce483 100644 --- a/src/components/MyPage/MyTeamPage/styled.js +++ b/src/components/MyPage/MyTeamPage/styled.js @@ -9,11 +9,10 @@ export const Container = styled.div` display: flex; flex-direction: column; align-items: flex-start; + padding: 40px; `; export const Title = styled.label` - margin-left: 36px; - margin-top: 30px; font-size: 24px; font-weight: 700; `; @@ -34,7 +33,8 @@ export const Tag = styled.label` `; export const Input = styled.input` - width: 332px; + margin-left: 50px; + width: 300px; height: 36px; border: 1.9px solid; border-radius: 6px; @@ -42,7 +42,8 @@ export const Input = styled.input` `; export const Sel = styled.select` - width: 332px; + margin-left: 50px; + width: 300px; height: 36px; border: 1.9px solid; border-radius: 6px; @@ -50,14 +51,10 @@ export const Sel = styled.select` `; export const Explanation = styled.textarea` - width: 350px; - height: 229px; + width: 100%; border: 1.9px solid; border-radius: 6px; border-color: #c9c9c9; - padding-top: 15px; - padding-left: 18px; - padding-right: 10px; resize: none; `; diff --git a/src/components/MyPageCard/MySupportCard/mySupportCard.js b/src/components/MyPageCard/MySupportCard/mySupportCard.js index 1ead382..227d8f7 100644 --- a/src/components/MyPageCard/MySupportCard/mySupportCard.js +++ b/src/components/MyPageCard/MySupportCard/mySupportCard.js @@ -9,29 +9,38 @@ import { Fail, } from "./styles"; -import { ReactComponent as CenterLine } from "../../../assets/myPage/SupportCenterLine.svg"; - const MySupportCard = ({ data }) => { return ( - {data.projectName} - - {data.teamName} / {data.region} - - {data.date} - | {data.time} +
+ {data.projectName} +
+ + {data.teamName} / {data.region} + + {data.state} + | {data.createDate} +
+
- - - {data.introduction} - {data.pass ? 합격 : 불합격} + > + {data.introduction} +
+ qwe + {data.pass ? 합격 : 불합격} +
+
); }; diff --git a/src/components/MyPageCard/MySupportCard/styles.js b/src/components/MyPageCard/MySupportCard/styles.js index d7bbe1c..de24bcf 100644 --- a/src/components/MyPageCard/MySupportCard/styles.js +++ b/src/components/MyPageCard/MySupportCard/styles.js @@ -1,65 +1,46 @@ import styled from "styled-components"; export const Containter = styled.div` - position: relative; - width: 780px; - height: 106px; - border: 1.9px solid; + display: flex; + flex-direction: column; + border: 2px solid; border-radius: 11px; border-color: #c9c9c9; + padding: 20px; `; export const ProjectName = styled.label` - position: absolute; - left: 21px; - top: 12px; font-size: 17px; font-weight: 700; color: #6d758f; `; export const TeamAndRegion = styled.label` - position: absolute; - left: 126px; - top: 17px; font-size: 11px; font-weight: 600; color: #6d758f; `; export const DateLabel = styled.label` - position: absolute; - right: 56px; - top: 17px; font-size: 12px; font-weight: 500; color: #7c7c7c; `; export const TimeLabel = styled.label` - position: absolute; - right: 16px; - top: 17px; font-size: 12px; font-weight: 400; color: #9a9a9a; `; export const Introduction = styled.label` - position: absolute; - left: 21px; - top: 53px; font-size: 15px; font-weight: 400; - font-color: #6d758f; + color: #6d758f; `; export const Pass = styled.div` - position: absolute; - right: 18px; - top: 54px; - width: 64px; - height: 34px; + width: 80px; border: 2px solid; border-radius: 8px; border-color: #376fff; @@ -73,11 +54,7 @@ export const Pass = styled.div` `; export const Fail = styled.div` - position: absolute; - right: 18px; - top: 54px; - width: 64px; - height: 34px; + width: 80px; border: 2px solid; border-radius: 8px; border-color: #ff3737; diff --git a/src/components/MyPageCard/MyTeamCard/myTeamCard.js b/src/components/MyPageCard/MyTeamCard/myTeamCard.js index f0ab3bd..0fc3548 100644 --- a/src/components/MyPageCard/MyTeamCard/myTeamCard.js +++ b/src/components/MyPageCard/MyTeamCard/myTeamCard.js @@ -11,6 +11,7 @@ import { Introduction, TeamMemberButtton, EditButton, + Button, } from "./styles"; import { ReactComponent as MemberCenterLine } from "../../../assets/myPage/MemberCenterLine.svg"; import { useNavigate } from "react-router-dom"; @@ -43,28 +44,27 @@ const MyTeamCard = ({ data }) => { return ( - {data.name} - [{data.name}] - [{data.region}] - - - {data.recruitment ? "모집중" : "모집완료"} - - | {formatFormationDate(data.formationDate)} - - - - {data.introduction} - + {data.name} + {data.introduction} +
+
- 팀원 관리 - 소개 페이지 수정 + > + + +
); }; diff --git a/src/components/MyPageCard/MyTeamCard/styles.js b/src/components/MyPageCard/MyTeamCard/styles.js index 0e66fb4..65a211e 100644 --- a/src/components/MyPageCard/MyTeamCard/styles.js +++ b/src/components/MyPageCard/MyTeamCard/styles.js @@ -1,88 +1,32 @@ import styled from "styled-components"; export const Containter = styled.div` - position: relative; - width: 360px; - height: 246px; - border: 1.9px solid; + display: flex; + flex-direction: column; + border: 2px solid; border-radius: 11px; border-color: #c9c9c9; + padding: 20px; + justify-content: space-between; `; -export const ProejctName = styled.label` - position: absolute; - left: 24px; - top: 19px; +export const TeamName = styled.label` font-size: 17px; font-weight: 700; color: #6d758f; `; -export const TeamName = styled.label` - position: absolute; - left: 24px; - top: 57px; - font-size: 11px; - font-weight: 600; - color: #6d758f; -`; - -export const Region = styled.label` - position: absolute; - left: 24px; - top: 71px; - font-size: 11px; - font-weight: 600; - color: #6d758f; -`; - -export const Recruitment = styled.label` - position: absolute; - right: 76px; - top: 24px; - font-size: 11px; - font-weight: 400; -`; - -export const RecruitmentTime = styled.label` - position: absolute; - width: 45px; - font-size: 11px; - font-weight: 400; - color: #6d758f; -`; - export const Introduction = styled.label` - position: absolute; - left: 26px; - top: 108px; font-size: 15px; font-weight: 400; color: #6d758f; `; -export const TeamMemberButtton = styled.button` - position: absolute; - left: 14px; - top: 201px; - width: 159px; - height: 32px; - border: 2px solid; - border-radius: 4px; - border-color: #376fff; - font-size: 14px; - font-weight: 400; - color: #376fff; - background-color: #ffffff; +export const Button = styled.button` + all: unset; cursor: pointer; -`; - -export const EditButton = styled.button` - position: absolute; - right: 14px; - top: 201px; - width: 159px; - height: 32px; + width: 100%; + height: 30px; border: 2px solid; border-radius: 4px; border-color: #376fff; diff --git a/src/components/Navigation/navigation.js b/src/components/Navigation/navigation.js index 98c4755..70f9fb9 100644 --- a/src/components/Navigation/navigation.js +++ b/src/components/Navigation/navigation.js @@ -44,7 +44,7 @@ const Navigation = (props) => { { - navigate("/team"); + navigate("/teamannouncement"); }} > 팀구하기 diff --git a/src/pages/ContestDetailPage/contestDetailPage.js b/src/pages/ContestDetailPage/contestDetailPage.js index 7465437..2624de0 100644 --- a/src/pages/ContestDetailPage/contestDetailPage.js +++ b/src/pages/ContestDetailPage/contestDetailPage.js @@ -17,7 +17,7 @@ const ContestDetailPage = () => { }} > - + {/* */}
); diff --git a/src/pages/Main/main.js b/src/pages/Main/main.js index 51e4390..1976d64 100644 --- a/src/pages/Main/main.js +++ b/src/pages/Main/main.js @@ -22,12 +22,12 @@ const Main = (props) => { > -
+ {/*
-
+
*/}
diff --git a/src/pages/MemberSearch/memberSearch.js b/src/pages/MemberSearch/memberSearch.js index 86d0879..bd89168 100644 --- a/src/pages/MemberSearch/memberSearch.js +++ b/src/pages/MemberSearch/memberSearch.js @@ -1,24 +1,53 @@ -import { useState } from "react"; -import TeamCardGrid from "../../components/CardGrid/teamCardGrid"; +import React, { useState, useEffect } from "react"; +import MemberCardGrid from "../../components/CardGrid/memberCardGrid"; import Introduce from "../../components/Introduce/introduce"; import Navigation from "../../components/Navigation/navigation"; import PaginationComponent from "../../components/PagenationComponent/pagenationComponent"; import SideNavigation from "../../components/SideNavigation/sideNavigation"; -import memberTestData2 from "../../api/testDummyData/memberTestDats2"; -import memberTestData3 from "../../api/testDummyData/memberTestData3"; -import MemberCardGrid from "../../components/CardGrid/memberCardGrid"; +import { jobCategories } from "../../api/testDummyData/jobPosition"; import { WriteButton } from "../../components/SideNavigation/styles"; import { useNavigate } from "react-router-dom"; -import { jobCategories } from "../../api/testDummyData/jobPosition"; import Footer from "../../components/Footer/footer"; +import { teamAPI } from "../../api/teamAPI"; +import { useRecoilValue } from "recoil"; +import { occupationClassificationsState } from "../../states/occupationState"; +import { Title } from "../RegisterMember/styles"; + const MemberSearch = () => { - const [currentPage, setCurrentPage] = useState(1); const navigate = useNavigate(); + const [currentPage, setCurrentPage] = useState(1); + const [announcements, setAnnouncements] = useState([]); + const [totalPages, setTotalPages] = useState(1); + const occupationClassifications = useRecoilValue( + occupationClassificationsState, + ); + + const fetchResumeAnnouncements = async (page) => { + try { + const filter = { + page: page - 1, + size: 10, + occupationClassifications: + occupationClassifications.length > 0 ? occupationClassifications : "", + }; + + const response = await teamAPI.getResumeAnnouncements(filter); + setAnnouncements(response.data.data.content); + setTotalPages(response.data.data.totalPages); + console.log(response.data.data.content); + } catch (error) { + console.error("Error fetching resume announcements:", error); + } + }; + + useEffect(() => { + fetchResumeAnnouncements(currentPage); + }, [currentPage, occupationClassifications]); const handlePageChange = (pageNumber) => { setCurrentPage(pageNumber); - // 추가적인 페이지 변경 처리 로직 }; + return (
@@ -42,11 +71,9 @@ const MemberSearch = () => {
-
- -
-
- +
+ 팀원 추천 +
{ }} > diff --git a/src/pages/MyPage/myPage.js b/src/pages/MyPage/myPage.js index 87bc8a9..f5f0224 100644 --- a/src/pages/MyPage/myPage.js +++ b/src/pages/MyPage/myPage.js @@ -29,10 +29,8 @@ const MyPage = (props) => { return (
-
-
- 마이페이지 +
{ const [title, setTitle] = useState(""); + const [summary, setSummary] = useState(""); const [description, setDescription] = useState(""); const [vacancies, setVacancies] = useState(0); + const [teamId, setTeamId] = useState(0); const [occupationClassifications, setOccupationClassifications] = useState( [], ); @@ -66,6 +89,7 @@ const RegisterMember = ({ setIsCreateTeam }) => { const [expiredDate, setExpiredDate] = useState(new Date()); const [location, setLocation] = useState(""); const [errors, setErrors] = useState({}); + const [teamList, setTeamList] = useState([]); const navigate = useNavigate(); const handleChange = (value, setter) => { @@ -79,12 +103,16 @@ const RegisterMember = ({ setIsCreateTeam }) => { !vacancies || !occupationClassifications || !publish || - !expiredDate + !expiredDate || + !location || + !teamId || + !summary ) { alert("모든 항목을 채워주세요"); return; } const data = { + teamId: teamId.value, title: title, description: description, vacancies: vacancies, @@ -93,40 +121,49 @@ const RegisterMember = ({ setIsCreateTeam }) => { ), publish: publish, expiredDate: expiredDate.toISOString(), + region: location.label, + summary: summary, }; console.log(data); teamAPI - .postNewTeamAnnouncement(data, 2) + .postNewTeamAnnouncement(data) .then((res) => { console.log(res); - navigate("/team"); + navigate("/teamannouncement"); }) .catch((err) => { console.log(err); }); }; + useEffect(() => { + teamAPI + .getMyTeams() + .then((res) => { + const teamList = res.data.data.filter((team) => team.isOwner); + setTeamList( + teamList.map((team) => ({ value: team.id, label: team.name })), + ); + }) + .catch((err) => { + console.log(err); + }); + }, []); + + useEffect(() => { + console.log(description); + }, [description]); + return (
-
- 팀 모집 공고 -
- - 팀원 모집 공고 - + 팀원 모집 공고 { marginRight: "auto", }} /> - - 공고 제목 + 공고 제목 handleChange(e.target.value, setTitle)} /> -
- 프로필 설정 - 팀 상세 소개 -
-
- - handleChange(e.target.value, setDescription)} - /> -
- -
+
모집 분야 @@ -175,40 +200,94 @@ const RegisterMember = ({ setIsCreateTeam }) => { onChange={(selected) => setOccupationClassifications(selected)} styles={{ marginTop: "10px", width: "330px" }} /> - 모집 마감일 +
+
+ 팀 선택 + setLocation(selected)} + styles={{ marginTop: "10px", width: "330px" }} + /> +
+
+ 모집 마감일 setExpiredDate(date)} dateFormat="yyyy-MM-dd" - style={{ marginTop: "10px", width: "330px" }} />
+
모집 인원 handleChange(e.target.value, setVacancies)} - style={{ marginTop: "10px", width: "330px" }} - /> - 활동지역 - handleChange(e.target.value, setLocation)} - style={{ marginTop: "10px", width: "330px" }} />
+ 한줄 요약 + handleChange(e.target.value, setSummary)} + /> +
+ 팀 상세 소개 +
+ + + - - 등록하기 - +
+ + 등록하기 + +