From de51069bb236f48549f171b998a5e537d15413ba Mon Sep 17 00:00:00 2001 From: Cho SeungYeon <111514472+layout-SY@users.noreply.github.com> Date: Fri, 30 May 2025 17:52:27 +0900 Subject: [PATCH 1/9] =?UTF-8?q?feat=20:=20=EA=B4=80=EB=A6=AC=EC=9E=90=20?= =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EB=A0=88?= =?UTF-8?q?=EC=9D=B4=EC=95=84=EC=9B=83=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/mainCard/MainCard.styled.ts | 40 +++++++++++++++++++ src/components/admin/mainCard/MainCard.tsx | 26 ++++++++++++ .../mainCard/graphCard/GraphCard.styled.ts | 3 ++ .../admin/mainCard/graphCard/GraphCard.tsx | 8 ++++ .../admin/adminInquiries/AdminInquiries.tsx | 2 +- src/pages/admin/adminMain/AdminMain.styled.ts | 19 +++++++++ src/pages/admin/adminMain/AdminMain.tsx | 37 +++++++++++++++-- 7 files changed, 131 insertions(+), 4 deletions(-) create mode 100644 src/components/admin/mainCard/MainCard.styled.ts create mode 100644 src/components/admin/mainCard/MainCard.tsx create mode 100644 src/components/admin/mainCard/graphCard/GraphCard.styled.ts create mode 100644 src/components/admin/mainCard/graphCard/GraphCard.tsx create mode 100644 src/pages/admin/adminMain/AdminMain.styled.ts diff --git a/src/components/admin/mainCard/MainCard.styled.ts b/src/components/admin/mainCard/MainCard.styled.ts new file mode 100644 index 00000000..b0e9b17e --- /dev/null +++ b/src/components/admin/mainCard/MainCard.styled.ts @@ -0,0 +1,40 @@ +import styled from 'styled-components'; + +export const Container = styled.div` + display: flex; + flex-direction: column; + border: 1px solid #ccc; + border-radius: ${({ theme }) => theme.borderRadius.primary}; +`; + +export const CardHeader = styled.div` + min-height: 50px; + display: flex; + justify-content: space-between; + align-items: center; +`; + +export const Title = styled.h3` + margin-left: 20px; +`; + +export const ShowAllArea = styled.div` + display: flex; + margin-left: 10px; + margin-right: 10px; +`; + +export const ShowAllButton = styled.button` + font-size: 13px; + margin-right: 6px; +`; + +export const ArrowRight = styled.img` + font-size: 13px; +`; + +export const Line = styled.hr``; + +export const Wrapper = styled.div``; + +export const MainContent = styled.div``; diff --git a/src/components/admin/mainCard/MainCard.tsx b/src/components/admin/mainCard/MainCard.tsx new file mode 100644 index 00000000..5d4df4a3 --- /dev/null +++ b/src/components/admin/mainCard/MainCard.tsx @@ -0,0 +1,26 @@ +import * as S from './MainCard.styled'; +import arrowRight from '../../../assets/ArrowRight.svg'; + +interface MainCardProps { + children: React.ReactNode; +} + +const MainCard = ({ children }: MainCardProps) => { + return ( + + + 공지시항 + + 전체 보기 + + + + + + {children} + + + ); +}; + +export default MainCard; diff --git a/src/components/admin/mainCard/graphCard/GraphCard.styled.ts b/src/components/admin/mainCard/graphCard/GraphCard.styled.ts new file mode 100644 index 00000000..c3389834 --- /dev/null +++ b/src/components/admin/mainCard/graphCard/GraphCard.styled.ts @@ -0,0 +1,3 @@ +import styled from 'styled-components'; + +export const Container = styled.div``; diff --git a/src/components/admin/mainCard/graphCard/GraphCard.tsx b/src/components/admin/mainCard/graphCard/GraphCard.tsx new file mode 100644 index 00000000..0ceef919 --- /dev/null +++ b/src/components/admin/mainCard/graphCard/GraphCard.tsx @@ -0,0 +1,8 @@ +import React from 'react'; +import * as S from './GraphCard.styled'; + +const GraphCard = () => { + return GraphCard Component; +}; + +export default GraphCard; diff --git a/src/pages/admin/adminInquiries/AdminInquiries.tsx b/src/pages/admin/adminInquiries/AdminInquiries.tsx index 2d180680..09a40280 100644 --- a/src/pages/admin/adminInquiries/AdminInquiries.tsx +++ b/src/pages/admin/adminInquiries/AdminInquiries.tsx @@ -1,4 +1,4 @@ -import * as S from './AdminInquires.styled'; +import * as S from './AdminInquiries.styled'; export default function AdminInquires() { return ; diff --git a/src/pages/admin/adminMain/AdminMain.styled.ts b/src/pages/admin/adminMain/AdminMain.styled.ts new file mode 100644 index 00000000..39d65d55 --- /dev/null +++ b/src/pages/admin/adminMain/AdminMain.styled.ts @@ -0,0 +1,19 @@ +import styled from 'styled-components'; + +export const Container = styled.div` + padding: 50px; + min-height: 100vh; +`; + +export const Wrapper = styled.div` + display: grid; + grid-template-columns: repeat(3, 1fr); + grid-auto-rows: minmax(350px, auto); + gap: 20px; + + @media (max-width: 768px) { + grid-template-columns: 1fr; + } +`; + +export const GraphArea = styled.div``; diff --git a/src/pages/admin/adminMain/AdminMain.tsx b/src/pages/admin/adminMain/AdminMain.tsx index c0ccc4cf..97b9629b 100644 --- a/src/pages/admin/adminMain/AdminMain.tsx +++ b/src/pages/admin/adminMain/AdminMain.tsx @@ -1,3 +1,34 @@ -export default function AdminMain() { - return
; -} +import React from 'react'; +import * as S from './AdminMain.styled'; +import MainCard from '../../../components/admin/mainCard/MainCard'; +import AdminInquires from '../adminInquiries/AdminInquiries'; +import GraphCard from '../../../components/admin/mainCard/graphCard/GraphCard'; +import AdminAllUser from '../adminAllUser/AdminAllUser'; +import AdminReports from '../adminReports/AdminReports'; +import AdminNotice from '../adminNotice/AdminNotice'; + +const Main = () => { + return ( + + + + + + + + + + + + + + + + + + + + ); +}; + +export default Main; From 56e054c7c998fd7b1866a9ab9657c653f52230d4 Mon Sep 17 00:00:00 2001 From: Cho SeungYeon <111514472+layout-SY@users.noreply.github.com> Date: Sat, 31 May 2025 00:03:11 +0900 Subject: [PATCH 2/9] =?UTF-8?q?feat=20:=20=EA=B4=80=EB=A6=AC=EC=9E=90=20?= =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EA=B0=81=20?= =?UTF-8?q?=EC=B9=B4=EB=93=9C=EB=B3=84=20=EC=97=AD=ED=95=A0=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/line.svg | 3 ++ .../admin/mainCard/MainCard.styled.ts | 3 +- src/components/admin/mainCard/MainCard.tsx | 17 ++++--- .../allUserPreview/AllUserPreview.styled.ts | 3 ++ .../allUserPreview/AllUserPreview.tsx | 8 ++++ .../inquiresPreview/InquiresPreview.styled.ts | 3 ++ .../inquiresPreview/InquiresPreview.tsx | 8 ++++ .../reportsPreview/ReportsPreview.styled.ts | 3 ++ .../reportsPreview/ReportsPreview.tsx | 8 ++++ .../NotificationItem/NotificationItem.tsx | 2 +- src/constants/admin/mainItems.ts | 45 +++++++++++++++++++ src/pages/admin/adminMain/AdminMain.tsx | 32 +++++-------- 12 files changed, 107 insertions(+), 28 deletions(-) create mode 100644 src/assets/line.svg create mode 100644 src/components/admin/previewComponent/allUserPreview/AllUserPreview.styled.ts create mode 100644 src/components/admin/previewComponent/allUserPreview/AllUserPreview.tsx create mode 100644 src/components/admin/previewComponent/inquiresPreview/InquiresPreview.styled.ts create mode 100644 src/components/admin/previewComponent/inquiresPreview/InquiresPreview.tsx create mode 100644 src/components/admin/previewComponent/reportsPreview/ReportsPreview.styled.ts create mode 100644 src/components/admin/previewComponent/reportsPreview/ReportsPreview.tsx create mode 100644 src/constants/admin/mainItems.ts diff --git a/src/assets/line.svg b/src/assets/line.svg new file mode 100644 index 00000000..f805946b --- /dev/null +++ b/src/assets/line.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/admin/mainCard/MainCard.styled.ts b/src/components/admin/mainCard/MainCard.styled.ts index b0e9b17e..501d40b3 100644 --- a/src/components/admin/mainCard/MainCard.styled.ts +++ b/src/components/admin/mainCard/MainCard.styled.ts @@ -1,3 +1,4 @@ +import { Link } from 'react-router-dom'; import styled from 'styled-components'; export const Container = styled.div` @@ -18,7 +19,7 @@ export const Title = styled.h3` margin-left: 20px; `; -export const ShowAllArea = styled.div` +export const ShowAllArea = styled(Link)` display: flex; margin-left: 10px; margin-right: 10px; diff --git a/src/components/admin/mainCard/MainCard.tsx b/src/components/admin/mainCard/MainCard.tsx index 5d4df4a3..6fa48641 100644 --- a/src/components/admin/mainCard/MainCard.tsx +++ b/src/components/admin/mainCard/MainCard.tsx @@ -1,19 +1,24 @@ import * as S from './MainCard.styled'; import arrowRight from '../../../assets/ArrowRight.svg'; +import React from 'react'; interface MainCardProps { + title: string; + moreLink?: string; children: React.ReactNode; } -const MainCard = ({ children }: MainCardProps) => { +const MainCard = ({ title, moreLink, children }: MainCardProps) => { return ( - 공지시항 - - 전체 보기 - - + {title} + {moreLink && ( + + 전체 보기 + + + )} diff --git a/src/components/admin/previewComponent/allUserPreview/AllUserPreview.styled.ts b/src/components/admin/previewComponent/allUserPreview/AllUserPreview.styled.ts new file mode 100644 index 00000000..c3389834 --- /dev/null +++ b/src/components/admin/previewComponent/allUserPreview/AllUserPreview.styled.ts @@ -0,0 +1,3 @@ +import styled from 'styled-components'; + +export const Container = styled.div``; diff --git a/src/components/admin/previewComponent/allUserPreview/AllUserPreview.tsx b/src/components/admin/previewComponent/allUserPreview/AllUserPreview.tsx new file mode 100644 index 00000000..fba6c2f3 --- /dev/null +++ b/src/components/admin/previewComponent/allUserPreview/AllUserPreview.tsx @@ -0,0 +1,8 @@ +import React from 'react'; +import * as S from './AllUserPreview.styled'; + +const AllUserPreview = () => { + return AllUserPreview Component; +}; + +export default AllUserPreview; diff --git a/src/components/admin/previewComponent/inquiresPreview/InquiresPreview.styled.ts b/src/components/admin/previewComponent/inquiresPreview/InquiresPreview.styled.ts new file mode 100644 index 00000000..c3389834 --- /dev/null +++ b/src/components/admin/previewComponent/inquiresPreview/InquiresPreview.styled.ts @@ -0,0 +1,3 @@ +import styled from 'styled-components'; + +export const Container = styled.div``; diff --git a/src/components/admin/previewComponent/inquiresPreview/InquiresPreview.tsx b/src/components/admin/previewComponent/inquiresPreview/InquiresPreview.tsx new file mode 100644 index 00000000..25aba453 --- /dev/null +++ b/src/components/admin/previewComponent/inquiresPreview/InquiresPreview.tsx @@ -0,0 +1,8 @@ +import React from 'react'; +import * as S from './InquiresPreview.styled'; + +const InquiresPreview = () => { + return InquiresPreview Component; +}; + +export default InquiresPreview; diff --git a/src/components/admin/previewComponent/reportsPreview/ReportsPreview.styled.ts b/src/components/admin/previewComponent/reportsPreview/ReportsPreview.styled.ts new file mode 100644 index 00000000..c3389834 --- /dev/null +++ b/src/components/admin/previewComponent/reportsPreview/ReportsPreview.styled.ts @@ -0,0 +1,3 @@ +import styled from 'styled-components'; + +export const Container = styled.div``; diff --git a/src/components/admin/previewComponent/reportsPreview/ReportsPreview.tsx b/src/components/admin/previewComponent/reportsPreview/ReportsPreview.tsx new file mode 100644 index 00000000..d3964ed7 --- /dev/null +++ b/src/components/admin/previewComponent/reportsPreview/ReportsPreview.tsx @@ -0,0 +1,8 @@ +import React from 'react'; +import * as S from './ReportsPreview.styled'; + +const ReportsPreview = () => { + return ReportsPreview Component; +}; + +export default ReportsPreview; diff --git a/src/components/common/header/Notification/NotificationItem/NotificationItem.tsx b/src/components/common/header/Notification/NotificationItem/NotificationItem.tsx index 11cd27d5..9c9b7c9c 100644 --- a/src/components/common/header/Notification/NotificationItem/NotificationItem.tsx +++ b/src/components/common/header/Notification/NotificationItem/NotificationItem.tsx @@ -16,7 +16,7 @@ const NotificationItem = ({ item }: NotificationItemProps) => { return ( - {item.content} + {item.content} | {timeAgo(item.createdAt)} diff --git a/src/constants/admin/mainItems.ts b/src/constants/admin/mainItems.ts new file mode 100644 index 00000000..d83a2a41 --- /dev/null +++ b/src/constants/admin/mainItems.ts @@ -0,0 +1,45 @@ +import GraphCard from '../../components/admin/mainCard/graphCard/GraphCard'; +import AllUserPreview from '../../components/admin/previewComponent/allUserPreview/AllUserPreview'; +import InquiresPreview from '../../components/admin/previewComponent/inquiresPreview/InquiresPreview'; +import NoticePreview from '../../components/admin/previewComponent/noticePreview/NoticePreview'; +import ReportsPreview from '../../components/admin/previewComponent/reportsPreview/ReportsPreview'; +import { ADMIN_ROUTE } from '../routes'; + +export interface CardItem { + key: string; + title: string; + link?: string; + Component: React.FC; +} + +export const cardList: CardItem[] = [ + { + key: 'notice', + title: '공지사항', + link: `${ADMIN_ROUTE.notice}`, + Component: NoticePreview, + }, + { + key: 'inquires', + title: '문의 확인', + link: `${ADMIN_ROUTE.inquiries}`, + Component: InquiresPreview, + }, + { + key: 'reports', + title: '신고 검토', + link: `${ADMIN_ROUTE.reports}`, + Component: ReportsPreview, + }, + { + key: 'allUsers', + title: '전체 회원 조회', + link: `${ADMIN_ROUTE.allUser}`, + Component: AllUserPreview, + }, + { + key: 'Graph', + title: '방문자 현황', + Component: GraphCard, + }, +]; diff --git a/src/pages/admin/adminMain/AdminMain.tsx b/src/pages/admin/adminMain/AdminMain.tsx index 97b9629b..85afe1dc 100644 --- a/src/pages/admin/adminMain/AdminMain.tsx +++ b/src/pages/admin/adminMain/AdminMain.tsx @@ -1,31 +1,23 @@ import React from 'react'; import * as S from './AdminMain.styled'; import MainCard from '../../../components/admin/mainCard/MainCard'; -import AdminInquires from '../adminInquiries/AdminInquiries'; -import GraphCard from '../../../components/admin/mainCard/graphCard/GraphCard'; -import AdminAllUser from '../adminAllUser/AdminAllUser'; -import AdminReports from '../adminReports/AdminReports'; -import AdminNotice from '../adminNotice/AdminNotice'; +import { cardList } from '../../../constants/admin/mainItems'; const Main = () => { return ( - - - - - - - - - - - - - - - + {cardList.map(({ key, title, link, Component }) => ( + + {title === '방문자 현황' ? ( + + + + ) : ( + + )} + + ))} ); From 5b73b26cf2f6c7f94a0abbc848e2fb056c13596d Mon Sep 17 00:00:00 2001 From: Cho SeungYeon <111514472+layout-SY@users.noreply.github.com> Date: Sat, 31 May 2025 00:03:19 +0900 Subject: [PATCH 3/9] =?UTF-8?q?feat=20:=20=EA=B3=B5=EC=A7=80=EC=82=AC?= =?UTF-8?q?=ED=95=AD=20API=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../noticePreview/NoticePreview.styled.ts | 22 +++++++++++++++++++ .../noticePreview/NoticePreview.tsx | 21 ++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/components/admin/previewComponent/noticePreview/NoticePreview.styled.ts create mode 100644 src/components/admin/previewComponent/noticePreview/NoticePreview.tsx diff --git a/src/components/admin/previewComponent/noticePreview/NoticePreview.styled.ts b/src/components/admin/previewComponent/noticePreview/NoticePreview.styled.ts new file mode 100644 index 00000000..be3dbe3e --- /dev/null +++ b/src/components/admin/previewComponent/noticePreview/NoticePreview.styled.ts @@ -0,0 +1,22 @@ +import styled from 'styled-components'; + +export const Container = styled.div` + display: flex; + flex-direction: column; + padding: 20px; +`; + +export const Wrapper = styled.div` + display: flex; +`; + +export const Dot = styled.img` + margin-right: 7px; +`; + +export const NoticeTitle = styled.p` + font-size: 18px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +`; diff --git a/src/components/admin/previewComponent/noticePreview/NoticePreview.tsx b/src/components/admin/previewComponent/noticePreview/NoticePreview.tsx new file mode 100644 index 00000000..8824bbc6 --- /dev/null +++ b/src/components/admin/previewComponent/noticePreview/NoticePreview.tsx @@ -0,0 +1,21 @@ +import React from 'react'; +import * as S from './NoticePreview.styled'; +import { useGetNotice } from '../../../../hooks/user/useGetNotice'; +import line from '../../../../assets/line.svg'; + +const NoticePreview = () => { + const { noticeData } = useGetNotice({ keyword: '', page: 1 }); + + return ( + + {noticeData?.notices.map((notice) => ( + + + {notice.title} + + ))} + + ); +}; + +export default NoticePreview; From 603f8e6897411c62d21a8bb4819369b3e6461e8a Mon Sep 17 00:00:00 2001 From: Cho SeungYeon <111514472+layout-SY@users.noreply.github.com> Date: Sat, 31 May 2025 22:01:18 +0900 Subject: [PATCH 4/9] =?UTF-8?q?feat=20:=20=ED=8F=89=EA=B0=80=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C=EB=90=9C=20=EB=A9=A4=EB=B2=84=EC=9D=98=20=EC=A0=90?= =?UTF-8?q?=EC=88=98=20=EA=B8=B0=EB=A1=9D=20=EB=B3=B4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluation/EvaluationContent.styled.ts | 4 +- .../user/evaluation/EvaluationContent.tsx | 40 ++++++++++++++----- .../user/evaluationHooks/useEvaluationStep.ts | 31 +++++++++++++- src/models/evaluation.ts | 1 + 4 files changed, 62 insertions(+), 14 deletions(-) diff --git a/src/components/user/evaluation/EvaluationContent.styled.ts b/src/components/user/evaluation/EvaluationContent.styled.ts index ca40c6c3..4a02b1a8 100644 --- a/src/components/user/evaluation/EvaluationContent.styled.ts +++ b/src/components/user/evaluation/EvaluationContent.styled.ts @@ -177,10 +177,10 @@ export const CompletedButton = styled.button<{ $active?: boolean }>` color: ${({ $active }) => ($active ? '#fff' : '#999')}; border: none; border-radius: 4px; - cursor: ${({ $active }) => ($active ? 'pointer' : 'default')}; + cursor: pointer; transition: background-color 0.2s; &:hover { - background-color: ${({ $active }) => ($active ? '#2f4a6b' : '#e0e0e0')}; + background-color: '#e0e0e0'}; } `; diff --git a/src/components/user/evaluation/EvaluationContent.tsx b/src/components/user/evaluation/EvaluationContent.tsx index f66f1c14..af773eef 100644 --- a/src/components/user/evaluation/EvaluationContent.tsx +++ b/src/components/user/evaluation/EvaluationContent.tsx @@ -17,9 +17,11 @@ const EvaluationContent = ({ const { step, notDone, + completedMember, handleClickLeftUser, handleClickOption, handleNextStep, + handleCompletedMember, currentScores, isNotFill, } = useEvaluationStep({ projectId, memberList }); @@ -42,18 +44,24 @@ const EvaluationContent = ({ - {notDone[step]?.nickname}님 평가하기 - - 제출하기 - + + {completedMember + ? `${completedMember.nickname}님 평가 결과` + : `${notDone[step]?.nickname}님 평가하기`} + + {!completedMember && ( + + 제출하기 + + )} - {isNotFill && ( + {isNotFill && completedMember && ( 모든 질문에 답변해주세요. )} @@ -78,6 +86,7 @@ const EvaluationContent = ({ handleClickOption(questionNumber, optionValue) } value={optionValue + 1} + disabled={!!completedMember} /> {optionValue + 1} {label} @@ -94,7 +103,16 @@ const EvaluationContent = ({ {memberList .filter((memberData) => memberData.evaluated) .map((memberData) => ( - + + handleCompletedMember( + memberData.userId, + memberData.nickname, + memberData.scores + ) + } + > {memberData.nickname} ))} diff --git a/src/hooks/user/evaluationHooks/useEvaluationStep.ts b/src/hooks/user/evaluationHooks/useEvaluationStep.ts index 3292496b..22e7b18c 100644 --- a/src/hooks/user/evaluationHooks/useEvaluationStep.ts +++ b/src/hooks/user/evaluationHooks/useEvaluationStep.ts @@ -17,6 +17,11 @@ const useEvaluationStep = ({ const [notDone, setNotDone] = useState([]); const [progress, setProgress] = useState[]>([]); const [isNotFill, setIsNotFill] = useState(false); + const [completedMember, setCompletedMember] = useState<{ + userId: number; + nickname: string; + scores: number[]; + } | null>(null); const { createEvaluation } = usePostEvaluation(projectId); @@ -33,6 +38,7 @@ const useEvaluationStep = ({ setStep(0); setIsNotFill(false); + setCompletedMember(null); }, [memberList, questionLength]); const user = notDone[step]?.userId; @@ -43,6 +49,10 @@ const useEvaluationStep = ({ }; const handleClickOption = (questionNumber: number, optionValue: number) => { + if (completedMember) { + return; + } + const realValue = optionValue + 1; setProgress((prev) => @@ -57,7 +67,12 @@ const useEvaluationStep = ({ ) ); }; + const handleNextStep = () => { + if (completedMember) { + return; + } + if (user == null) return; const record = progress.find((r) => user in r); @@ -78,16 +93,30 @@ const useEvaluationStep = ({ } }; + const handleCompletedMember = ( + userId: number, + nickname: string, + scores: number[] + ) => { + setCompletedMember({ userId, nickname, scores }); + }; + const currentScores = useMemo(() => { + if (completedMember) { + return completedMember.scores; + } + const record = progress.find((r) => user in r); return record ? record[user] : Array(questionLength).fill(0); - }, [progress, questionLength, user]); + }, [progress, questionLength, user, completedMember]); return { step, + completedMember, handleClickLeftUser, handleClickOption, handleNextStep, + handleCompletedMember, notDone, currentScores, isNotFill, diff --git a/src/models/evaluation.ts b/src/models/evaluation.ts index 239114e0..36247dd3 100644 --- a/src/models/evaluation.ts +++ b/src/models/evaluation.ts @@ -12,5 +12,6 @@ export interface apiMemberList { export interface MemberList { userId: number; nickname: string; + scores: number[]; evaluated: boolean; } From b1f903cfdae295fbcbd7dae6709d00cae31ae138 Mon Sep 17 00:00:00 2001 From: Cho SeungYeon <111514472+layout-SY@users.noreply.github.com> Date: Sat, 31 May 2025 22:22:29 +0900 Subject: [PATCH 5/9] =?UTF-8?q?feat=20:=20"=ED=8F=89=EA=B0=80=EC=99=84?= =?UTF-8?q?=EB=A3=8C"=EB=90=9C=20=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8?= =?UTF-8?q?=EB=8A=94=20"=ED=8F=89=EA=B0=80=EC=99=84=EB=A3=8C"=20=ED=91=9C?= =?UTF-8?q?=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/myProjectList.api.ts | 3 ++- src/api/mypage.api.ts | 4 +++- src/components/user/evaluation/EvaluationContent.tsx | 6 +++++- src/components/user/manageProjects/Card.styled.ts | 5 +++-- src/components/user/manageProjects/Card.tsx | 4 +++- src/components/user/mypage/joinedProject/Project.styled.ts | 5 +++-- src/components/user/mypage/joinedProject/Project.tsx | 4 +++- src/models/manageMyProject.ts | 1 + src/models/userProject.ts | 1 + src/pages/user/evaluation/Evaluation.tsx | 6 +++++- 10 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/api/myProjectList.api.ts b/src/api/myProjectList.api.ts index 798eda6b..40c0f43c 100644 --- a/src/api/myProjectList.api.ts +++ b/src/api/myProjectList.api.ts @@ -5,7 +5,8 @@ import type { import { httpClient } from './http.api'; export const getMyProjectLists = async () => { - const response = await httpClient.get(`/project/my`); + const response = await httpClient.get(`/user/project`); + console.log(response); return response.data; }; diff --git a/src/api/mypage.api.ts b/src/api/mypage.api.ts index 594a2593..ea03a835 100644 --- a/src/api/mypage.api.ts +++ b/src/api/mypage.api.ts @@ -55,7 +55,9 @@ export const patchMyProfileImg = async (file: File) => { export const getMyJoinedProjectList = async () => { try { - const response = await httpClient.get('/user/project'); + const response = await httpClient.get( + '/user/joinProject' + ); return response.data; } catch (error) { diff --git a/src/components/user/evaluation/EvaluationContent.tsx b/src/components/user/evaluation/EvaluationContent.tsx index af773eef..4e3a790c 100644 --- a/src/components/user/evaluation/EvaluationContent.tsx +++ b/src/components/user/evaluation/EvaluationContent.tsx @@ -7,12 +7,14 @@ interface EvaluationContentProps { projectId: number; projectName: string; memberList: MemberList[]; + isAllEvaluated: boolean; } const EvaluationContent = ({ projectId, projectName, memberList, + isAllEvaluated, }: EvaluationContentProps) => { const { step, @@ -45,7 +47,9 @@ const EvaluationContent = ({ - {completedMember + {isAllEvaluated + ? '평가가 완료 되었습니다. ' + : completedMember ? `${completedMember.nickname}님 평가 결과` : `${notDone[step]?.nickname}님 평가하기`} diff --git a/src/components/user/manageProjects/Card.styled.ts b/src/components/user/manageProjects/Card.styled.ts index 5afca4a2..3b883a43 100644 --- a/src/components/user/manageProjects/Card.styled.ts +++ b/src/components/user/manageProjects/Card.styled.ts @@ -91,11 +91,12 @@ export const RecruitmentEnd = styled.span` font-weight: 800; `; -export const EvaluateButton = styled(Link)` +export const EvaluateButton = styled(Link)<{ $isCompleted: boolean }>` display: inline-flex; flex-shrink: 0; padding: 0.2rem 0.65rem; - background-color: #3e5879; + background-color: ${({ $isCompleted }) => + $isCompleted ? `#2ADE1D` : `#3e5879`}; font-size: 0.9rem; color: ${({ theme }) => theme.color.white}; border-radius: 10px; diff --git a/src/components/user/manageProjects/Card.tsx b/src/components/user/manageProjects/Card.tsx index 10da8a64..a1690221 100644 --- a/src/components/user/manageProjects/Card.tsx +++ b/src/components/user/manageProjects/Card.tsx @@ -22,8 +22,10 @@ function Card({ project }: CardProps) { - 평가하기 + {project.isAllEvaluated ? '평가완료' : '평가하기'} )} {project.isDone && 모집 종료} diff --git a/src/components/user/mypage/joinedProject/Project.styled.ts b/src/components/user/mypage/joinedProject/Project.styled.ts index db2726d1..960b02d6 100644 --- a/src/components/user/mypage/joinedProject/Project.styled.ts +++ b/src/components/user/mypage/joinedProject/Project.styled.ts @@ -144,11 +144,12 @@ export const SkillArea = styled.div` } `; -export const EvaluateButton = styled(Link)` +export const EvaluateButton = styled(Link)<{ $isCompleted: boolean }>` display: inline-flex; flex-shrink: 0; padding: 0.2rem 0.65rem; - background-color: #3e5879; + background-color: ${({ $isCompleted }) => + $isCompleted ? `#2ADE1D` : `#3e5879`}; font-size: 0.9rem; color: ${({ theme }) => theme.color.white}; border-radius: 10px; diff --git a/src/components/user/mypage/joinedProject/Project.tsx b/src/components/user/mypage/joinedProject/Project.tsx index 5dac04cc..859d6e2b 100644 --- a/src/components/user/mypage/joinedProject/Project.tsx +++ b/src/components/user/mypage/joinedProject/Project.tsx @@ -43,8 +43,10 @@ const Project = ({ project, canEvaluate }: ProjectProps) => { - 평가하기 + {project.isAllEvaluated ? '평가완료' : '평가하기'} )} diff --git a/src/models/manageMyProject.ts b/src/models/manageMyProject.ts index c546b866..249eea34 100644 --- a/src/models/manageMyProject.ts +++ b/src/models/manageMyProject.ts @@ -20,6 +20,7 @@ export interface ManagedProject { positions: PositionTag[]; skills: SkillTag[]; canEvaluate: boolean; + isAllEvaluated: boolean; } export interface MethodType { diff --git a/src/models/userProject.ts b/src/models/userProject.ts index da9d676f..d2c67097 100644 --- a/src/models/userProject.ts +++ b/src/models/userProject.ts @@ -10,6 +10,7 @@ export interface JoinedProject { totalMember: number; skills: Omit[]; canEvaluate: boolean; + isAllEvaluated: boolean; } export interface ApiJoinedProject extends ApiCommonType { diff --git a/src/pages/user/evaluation/Evaluation.tsx b/src/pages/user/evaluation/Evaluation.tsx index a3f12145..995bc5a8 100644 --- a/src/pages/user/evaluation/Evaluation.tsx +++ b/src/pages/user/evaluation/Evaluation.tsx @@ -1,4 +1,4 @@ -import { useParams } from 'react-router-dom'; +import { useLocation, useParams } from 'react-router-dom'; import * as S from './Evaluation.styled'; import useGetCompletedEvaluation from '../../../hooks/user/evaluationHooks/useGetEvaluation'; import LoadingSpinner from '../../../components/common/loadingSpinner/LoadingSpinner'; @@ -9,6 +9,9 @@ import { useModal } from '../../../hooks/useModal'; const Evaluation = () => { const { projectId: projectIdParam } = useParams(); const projectId = Number(projectIdParam); + const location = useLocation(); + const isAllEvaluated = location.state as boolean; + const { isOpen, message, handleModalOpen, handleModalClose, handleConfirm } = useModal(); @@ -28,6 +31,7 @@ const Evaluation = () => { projectId={projectId} projectName={memberList.projectName} memberList={memberList.userData!} + isAllEvaluated={isAllEvaluated} /> Date: Sat, 31 May 2025 22:23:06 +0900 Subject: [PATCH 6/9] =?UTF-8?q?feat=20:=20=ED=9A=8C=EC=9B=90=EC=9D=98=20?= =?UTF-8?q?=ED=83=9C=EA=B7=B8=20=EC=A1=B4=EC=9E=AC=20=EC=9C=A0=EB=AC=B4=20?= =?UTF-8?q?=ED=83=80=EC=9E=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/auth.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/models/auth.ts b/src/models/auth.ts index 458676e5..bd5787a2 100644 --- a/src/models/auth.ts +++ b/src/models/auth.ts @@ -20,6 +20,7 @@ export interface UserData { email: string; nickname: string; admin: boolean; + hasRequiredTags: boolean; } export interface ApiOauth extends ApiCommonType { From 84125c192c887e255e20a5d81234951017b28167 Mon Sep 17 00:00:00 2001 From: Cho SeungYeon <111514472+layout-SY@users.noreply.github.com> Date: Sat, 31 May 2025 22:24:10 +0900 Subject: [PATCH 7/9] =?UTF-8?q?fix=20:=20=EB=9D=BC=EC=9A=B0=ED=8C=85=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/AppRoutes.tsx | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/src/routes/AppRoutes.tsx b/src/routes/AppRoutes.tsx index d1b80a73..b65e2c7a 100644 --- a/src/routes/AppRoutes.tsx +++ b/src/routes/AppRoutes.tsx @@ -1,19 +1,11 @@ -import { - createBrowserRouter, - Navigate, - Outlet, - RouterProvider, -} from 'react-router-dom'; +import { Navigate, Outlet } from 'react-router-dom'; import { lazy, Suspense } from 'react'; import LoadingSpinner from '../components/common/loadingSpinner/LoadingSpinner'; import useAuthStore from '../store/authStore'; import ProtectRoute from '../components/common/ProtectRoute'; import NotFoundPage from '../pages/notFoundPage/NotFoundPage'; import QueryErrorBoundary from '../components/common/error/QueryErrorBoundary'; -import { ToastProvider } from '../components/common/Toast/ToastProvider'; -import NotificationInitializer from '../components/user/notificationLive/NotificationInitializer'; -import { NotificationProvider } from '../components/user/notificationLive/NotificationProvider'; -import { ADMIN_ROUTE, ROUTES } from '../constants/routes'; +import { ROUTES } from '../constants/routes'; const Login = lazy(() => import('../pages/login/Login')); const LoginSuccess = lazy(() => import('../pages/login/LoginSuccess')); const LoginApi = lazy(() => import('../pages/login/LoginApi')); @@ -384,22 +376,7 @@ export const AppRoutes = () => { }; }); - const router = createBrowserRouter([ - { - element: ( - - - - - - - ), - - children: [...newRouteList, { path: '*', element: }], - }, - ]); - - return ; + return newRouteList; }; export default AppRoutes; From b8e5abe5d529ef6e4d0f75e020d40a7be5726816 Mon Sep 17 00:00:00 2001 From: Cho SeungYeon <111514472+layout-SY@users.noreply.github.com> Date: Sun, 1 Jun 2025 00:31:43 +0900 Subject: [PATCH 8/9] =?UTF-8?q?refactor=20:=20=EB=A6=AC=EB=B7=B0=20?= =?UTF-8?q?=EC=82=AC=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/myProjectList.api.ts | 1 - src/components/admin/mainCard/MainCard.styled.ts | 4 +--- .../previewComponent/noticePreview/NoticePreview.tsx | 2 +- .../common/header/Notification/Notification.styled.ts | 8 ++++++-- .../common/header/Notification/Notification.tsx | 4 ++-- .../NotificationItem/NotificationItem.styled.ts | 5 +---- .../user/evaluation/EvaluationContent.styled.ts | 2 +- src/components/user/evaluation/EvaluationContent.tsx | 2 +- src/hooks/user/useNotification.ts | 5 ++--- src/pages/user/evaluation/Evaluation.tsx | 3 ++- 10 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/api/myProjectList.api.ts b/src/api/myProjectList.api.ts index 40c0f43c..1cd347b3 100644 --- a/src/api/myProjectList.api.ts +++ b/src/api/myProjectList.api.ts @@ -6,7 +6,6 @@ import { httpClient } from './http.api'; export const getMyProjectLists = async () => { const response = await httpClient.get(`/user/project`); - console.log(response); return response.data; }; diff --git a/src/components/admin/mainCard/MainCard.styled.ts b/src/components/admin/mainCard/MainCard.styled.ts index 501d40b3..efea22e6 100644 --- a/src/components/admin/mainCard/MainCard.styled.ts +++ b/src/components/admin/mainCard/MainCard.styled.ts @@ -30,9 +30,7 @@ export const ShowAllButton = styled.button` margin-right: 6px; `; -export const ArrowRight = styled.img` - font-size: 13px; -`; +export const ArrowRight = styled.img``; export const Line = styled.hr``; diff --git a/src/components/admin/previewComponent/noticePreview/NoticePreview.tsx b/src/components/admin/previewComponent/noticePreview/NoticePreview.tsx index 8824bbc6..a5efc202 100644 --- a/src/components/admin/previewComponent/noticePreview/NoticePreview.tsx +++ b/src/components/admin/previewComponent/noticePreview/NoticePreview.tsx @@ -9,7 +9,7 @@ const NoticePreview = () => { return ( {noticeData?.notices.map((notice) => ( - + {notice.title} diff --git a/src/components/common/header/Notification/Notification.styled.ts b/src/components/common/header/Notification/Notification.styled.ts index d703886f..a5d6e4c8 100644 --- a/src/components/common/header/Notification/Notification.styled.ts +++ b/src/components/common/header/Notification/Notification.styled.ts @@ -6,8 +6,6 @@ export const Container = styled.div` overflow: hidden; display: flex; flex-direction: column; - justify-content: center; - align-items: center; padding: 3px; `; @@ -40,6 +38,12 @@ export const Arrow = styled.img` margin-bottom: 3px; `; +export const NoAlarmContainer = styled.div` + display: flex; + justify-content: center; + align-items: center; +`; + export const NonContentsMessage = styled.p` display: flex; justify-content: center; diff --git a/src/components/common/header/Notification/Notification.tsx b/src/components/common/header/Notification/Notification.tsx index 8265e347..25a262ad 100644 --- a/src/components/common/header/Notification/Notification.tsx +++ b/src/components/common/header/Notification/Notification.tsx @@ -13,9 +13,9 @@ const Notification = () => { if (!AlarmData) { return ( - + 알림이 없습니다. - + ); } diff --git a/src/components/common/header/Notification/NotificationItem/NotificationItem.styled.ts b/src/components/common/header/Notification/NotificationItem/NotificationItem.styled.ts index ce92af65..e243f3f8 100644 --- a/src/components/common/header/Notification/NotificationItem/NotificationItem.styled.ts +++ b/src/components/common/header/Notification/NotificationItem/NotificationItem.styled.ts @@ -1,13 +1,12 @@ import styled, { css } from 'styled-components'; export const Container = styled.div` - padding: 8px 0; + padding: 10px; font-size: 14px; `; export const TypeArea = styled.div` display: flex; - margin-left: 6px; `; export const Type = styled.p``; @@ -22,13 +21,11 @@ export const ItemContent = styled.p` white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - margin-left: 6px; `; export const Time = styled.span` color: #999; font-size: 12px; - margin-left: 6px; margin-right: 5px; `; diff --git a/src/components/user/evaluation/EvaluationContent.styled.ts b/src/components/user/evaluation/EvaluationContent.styled.ts index 4a02b1a8..0955b21a 100644 --- a/src/components/user/evaluation/EvaluationContent.styled.ts +++ b/src/components/user/evaluation/EvaluationContent.styled.ts @@ -181,6 +181,6 @@ export const CompletedButton = styled.button<{ $active?: boolean }>` transition: background-color 0.2s; &:hover { - background-color: '#e0e0e0'}; + background-color: '#e0e0e0'; } `; diff --git a/src/components/user/evaluation/EvaluationContent.tsx b/src/components/user/evaluation/EvaluationContent.tsx index 4e3a790c..c428ce41 100644 --- a/src/components/user/evaluation/EvaluationContent.tsx +++ b/src/components/user/evaluation/EvaluationContent.tsx @@ -65,7 +65,7 @@ const EvaluationContent = ({ )} - {isNotFill && completedMember && ( + {isNotFill && !completedMember && ( 모든 질문에 답변해주세요. )} diff --git a/src/hooks/user/useNotification.ts b/src/hooks/user/useNotification.ts index c0980469..476bdaba 100644 --- a/src/hooks/user/useNotification.ts +++ b/src/hooks/user/useNotification.ts @@ -45,7 +45,6 @@ const useNotification = () => { const event = e as MessageEvent; try { const eventData: AlarmLive = JSON.parse(event.data); - console.log(eventData); if (eventData) { queryClient.invalidateQueries({ @@ -56,11 +55,11 @@ const useNotification = () => { setSignal(eventData); showToast(eventData, 3000); } catch (error) { - console.error(error); + console.error('SSE 메시지 파싱 실패:', error); } }); eventSource.onerror = (e) => { - console.error(e); + console.error('SSE 연결 오류:', e); }; } diff --git a/src/pages/user/evaluation/Evaluation.tsx b/src/pages/user/evaluation/Evaluation.tsx index 995bc5a8..d52fa1e2 100644 --- a/src/pages/user/evaluation/Evaluation.tsx +++ b/src/pages/user/evaluation/Evaluation.tsx @@ -10,7 +10,8 @@ const Evaluation = () => { const { projectId: projectIdParam } = useParams(); const projectId = Number(projectIdParam); const location = useLocation(); - const isAllEvaluated = location.state as boolean; + const isAllEvaluated = + typeof location.state === 'boolean' ? location.state : false; const { isOpen, message, handleModalOpen, handleModalClose, handleConfirm } = useModal(); From 405cbabfa817728a99d49f1a0265f8245f940abb Mon Sep 17 00:00:00 2001 From: Cho SeungYeon Date: Sun, 1 Jun 2025 22:09:58 +0900 Subject: [PATCH 9/9] Update MainCard.styled.ts --- src/components/admin/mainCard/MainCard.styled.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/admin/mainCard/MainCard.styled.ts b/src/components/admin/mainCard/MainCard.styled.ts index efea22e6..44e6d803 100644 --- a/src/components/admin/mainCard/MainCard.styled.ts +++ b/src/components/admin/mainCard/MainCard.styled.ts @@ -25,7 +25,7 @@ export const ShowAllArea = styled(Link)` margin-right: 10px; `; -export const ShowAllButton = styled.button` +export const ShowAllButton = styled.span` font-size: 13px; margin-right: 6px; `;