-
Notifications
You must be signed in to change notification settings - Fork 0
참여한/생성한 프로젝트의 "평가완료" 추가 ( issue #316 ) #326
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
Changes from all commits
fb8d35e
de51069
56e054c
5b73b26
603f8e6
b1f903c
58af55f
84125c1
b8e5abe
62f90a5
405cbab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { Link } from 'react-router-dom'; | ||
| 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(Link)` | ||
| display: flex; | ||
| margin-left: 10px; | ||
| margin-right: 10px; | ||
| `; | ||
|
|
||
| export const ShowAllButton = styled.span` | ||
| font-size: 13px; | ||
| margin-right: 6px; | ||
| `; | ||
|
|
||
| export const ArrowRight = styled.img``; | ||
|
|
||
| export const Line = styled.hr``; | ||
|
|
||
| export const Wrapper = styled.div``; | ||
|
|
||
| export const MainContent = styled.div``; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| 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 = ({ title, moreLink, children }: MainCardProps) => { | ||
| return ( | ||
| <S.Container> | ||
| <S.CardHeader> | ||
| <S.Title>{title}</S.Title> | ||
| {moreLink && ( | ||
| <S.ShowAllArea to={moreLink}> | ||
| <S.ShowAllButton>전체 보기</S.ShowAllButton> | ||
| <S.ArrowRight src={arrowRight} /> | ||
| </S.ShowAllArea> | ||
| )} | ||
| </S.CardHeader> | ||
| <S.Line /> | ||
| <S.Wrapper> | ||
| <S.MainContent>{children}</S.MainContent> | ||
| </S.Wrapper> | ||
| </S.Container> | ||
| ); | ||
| }; | ||
|
|
||
| export default MainCard; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import styled from 'styled-components'; | ||
|
|
||
| export const Container = styled.div``; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import React from 'react'; | ||
| import * as S from './GraphCard.styled'; | ||
|
|
||
| const GraphCard = () => { | ||
| return <S.Container>GraphCard Component</S.Container>; | ||
| }; | ||
|
|
||
| export default GraphCard; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import styled from 'styled-components'; | ||
|
|
||
| export const Container = styled.div``; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import React from 'react'; | ||
| import * as S from './AllUserPreview.styled'; | ||
|
|
||
| const AllUserPreview = () => { | ||
| return <S.Container>AllUserPreview Component</S.Container>; | ||
| }; | ||
|
|
||
| export default AllUserPreview; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import styled from 'styled-components'; | ||
|
|
||
| export const Container = styled.div``; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import React from 'react'; | ||
| import * as S from './InquiresPreview.styled'; | ||
|
|
||
| const InquiresPreview = () => { | ||
| return <S.Container>InquiresPreview Component</S.Container>; | ||
| }; | ||
|
|
||
| export default InquiresPreview; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; | ||
| `; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 ( | ||
| <S.Container> | ||
| {noticeData?.notices.map((notice) => ( | ||
| <S.Wrapper key={notice.id}> | ||
| <S.Dot src={line} /> | ||
| <S.NoticeTitle>{notice.title}</S.NoticeTitle> | ||
| </S.Wrapper> | ||
| ))} | ||
| </S.Container> | ||
| ); | ||
| }; | ||
|
|
||
| export default NoticePreview; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import styled from 'styled-components'; | ||
|
|
||
| export const Container = styled.div``; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import React from 'react'; | ||
| import * as S from './ReportsPreview.styled'; | ||
|
|
||
| const ReportsPreview = () => { | ||
| return <S.Container>ReportsPreview Component</S.Container>; | ||
| }; | ||
|
|
||
| export default ReportsPreview; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ const NotificationItem = ({ item }: NotificationItemProps) => { | |
| return ( | ||
| <Link to={route} onClick={close}> | ||
| <S.Container> | ||
| <S.ItemContent>{item.content}</S.ItemContent> | ||
| <S.ItemContent>{item.content} | </S.ItemContent> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 구분자 추가 목적은 이해하지만 더 나은 방법을 고려해보세요. 알림 내용 뒤에 구분자를 추가한 목적은 이해하지만, 하드코딩된 문자열 대신 CSS나 스타일드 컴포넌트를 통해 시각적 구분을 구현하는 것을 권장합니다. CSS pseudo-element를 활용한 대안: - <S.ItemContent>{item.content} | </S.ItemContent>
+ <S.ItemContent>{item.content}</S.ItemContent>그리고 styled 컴포넌트에서: export const ItemContent = styled.div`
&::after {
content: ' | ';
color: ${({ theme }) => theme.colors.gray};
}
`;이 방법의 장점:
🤖 Prompt for AI Agents |
||
| <S.TypeArea> | ||
| <S.Time>{timeAgo(item.createdAt)}</S.Time> | ||
| <S.TypeFilter> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,19 +7,23 @@ interface EvaluationContentProps { | |||||||||||||||||||||||||||||||||||||
| projectId: number; | ||||||||||||||||||||||||||||||||||||||
| projectName: string; | ||||||||||||||||||||||||||||||||||||||
| memberList: MemberList[]; | ||||||||||||||||||||||||||||||||||||||
| isAllEvaluated: boolean; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| const EvaluationContent = ({ | ||||||||||||||||||||||||||||||||||||||
| projectId, | ||||||||||||||||||||||||||||||||||||||
| projectName, | ||||||||||||||||||||||||||||||||||||||
| memberList, | ||||||||||||||||||||||||||||||||||||||
| isAllEvaluated, | ||||||||||||||||||||||||||||||||||||||
| }: EvaluationContentProps) => { | ||||||||||||||||||||||||||||||||||||||
| const { | ||||||||||||||||||||||||||||||||||||||
| step, | ||||||||||||||||||||||||||||||||||||||
| notDone, | ||||||||||||||||||||||||||||||||||||||
| completedMember, | ||||||||||||||||||||||||||||||||||||||
| handleClickLeftUser, | ||||||||||||||||||||||||||||||||||||||
| handleClickOption, | ||||||||||||||||||||||||||||||||||||||
| handleNextStep, | ||||||||||||||||||||||||||||||||||||||
| handleCompletedMember, | ||||||||||||||||||||||||||||||||||||||
| currentScores, | ||||||||||||||||||||||||||||||||||||||
| isNotFill, | ||||||||||||||||||||||||||||||||||||||
| } = useEvaluationStep({ projectId, memberList }); | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -42,18 +46,26 @@ const EvaluationContent = ({ | |||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| <S.MainContent> | ||||||||||||||||||||||||||||||||||||||
| <S.Header> | ||||||||||||||||||||||||||||||||||||||
| <S.Title>{notDone[step]?.nickname}님 평가하기</S.Title> | ||||||||||||||||||||||||||||||||||||||
| <S.SubmitButton | ||||||||||||||||||||||||||||||||||||||
| size='primary' | ||||||||||||||||||||||||||||||||||||||
| schema='primary' | ||||||||||||||||||||||||||||||||||||||
| radius='primary' | ||||||||||||||||||||||||||||||||||||||
| onClick={handleNextStep} | ||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||
| 제출하기 | ||||||||||||||||||||||||||||||||||||||
| </S.SubmitButton> | ||||||||||||||||||||||||||||||||||||||
| <S.Title> | ||||||||||||||||||||||||||||||||||||||
| {isAllEvaluated | ||||||||||||||||||||||||||||||||||||||
| ? '평가가 완료 되었습니다. ' | ||||||||||||||||||||||||||||||||||||||
| : completedMember | ||||||||||||||||||||||||||||||||||||||
| ? `${completedMember.nickname}님 평가 결과` | ||||||||||||||||||||||||||||||||||||||
| : `${notDone[step]?.nickname}님 평가하기`} | ||||||||||||||||||||||||||||||||||||||
| </S.Title> | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+49
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 조건부 제목 렌더링 로직 개선 필요 현재 조건부 렌더링 로직이 복잡하고 우선순위가 명확하지 않습니다. <S.Title>
- {isAllEvaluated
- ? '평가가 완료 되었습니다. '
- : completedMember
- ? `${completedMember.nickname}님 평가 결과`
- : `${notDone[step]?.nickname}님 평가하기`}
+ {(() => {
+ if (completedMember) {
+ return `${completedMember.nickname}님 평가 결과`;
+ }
+ if (isAllEvaluated) {
+ return '평가가 완료되었습니다.';
+ }
+ return `${notDone[step]?.nickname}님 평가하기`;
+ })()}
</S.Title>이렇게 하면 우선순위가 명확해집니다: 완료된 멤버 선택 > 전체 평가 완료 > 일반 평가 진행 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
| {!completedMember && ( | ||||||||||||||||||||||||||||||||||||||
| <S.SubmitButton | ||||||||||||||||||||||||||||||||||||||
| size='primary' | ||||||||||||||||||||||||||||||||||||||
| schema='primary' | ||||||||||||||||||||||||||||||||||||||
| radius='primary' | ||||||||||||||||||||||||||||||||||||||
| onClick={handleNextStep} | ||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||
| 제출하기 | ||||||||||||||||||||||||||||||||||||||
| </S.SubmitButton> | ||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||
| </S.Header> | ||||||||||||||||||||||||||||||||||||||
| <S.MessageContainer> | ||||||||||||||||||||||||||||||||||||||
| {isNotFill && ( | ||||||||||||||||||||||||||||||||||||||
| {isNotFill && !completedMember && ( | ||||||||||||||||||||||||||||||||||||||
| <S.ErrorMessage>모든 질문에 답변해주세요.</S.ErrorMessage> | ||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||
| </S.MessageContainer> | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -78,6 +90,7 @@ const EvaluationContent = ({ | |||||||||||||||||||||||||||||||||||||
| handleClickOption(questionNumber, optionValue) | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| value={optionValue + 1} | ||||||||||||||||||||||||||||||||||||||
| disabled={!!completedMember} | ||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||
| <S.RadioLabel>{optionValue + 1}</S.RadioLabel> | ||||||||||||||||||||||||||||||||||||||
| <S.OptionLabel>{label}</S.OptionLabel> | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -94,7 +107,16 @@ const EvaluationContent = ({ | |||||||||||||||||||||||||||||||||||||
| {memberList | ||||||||||||||||||||||||||||||||||||||
| .filter((memberData) => memberData.evaluated) | ||||||||||||||||||||||||||||||||||||||
| .map((memberData) => ( | ||||||||||||||||||||||||||||||||||||||
| <S.CompletedButton key={memberData.userId}> | ||||||||||||||||||||||||||||||||||||||
| <S.CompletedButton | ||||||||||||||||||||||||||||||||||||||
| key={memberData.userId} | ||||||||||||||||||||||||||||||||||||||
| onClick={() => | ||||||||||||||||||||||||||||||||||||||
| handleCompletedMember( | ||||||||||||||||||||||||||||||||||||||
| memberData.userId, | ||||||||||||||||||||||||||||||||||||||
| memberData.nickname, | ||||||||||||||||||||||||||||||||||||||
| memberData.scores | ||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||
| {memberData.nickname} | ||||||||||||||||||||||||||||||||||||||
| </S.CompletedButton> | ||||||||||||||||||||||||||||||||||||||
| ))} | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
API 엔드포인트 변경을 확인했습니다.
엔드포인트가
/project/my에서/user/project로 변경되었습니다. 백엔드 API 구조 변경에 따른 것으로 보입니다.다른 파일에서 기존 엔드포인트를 사용하는 곳이 있는지 확인해보겠습니다:
🏁 Script executed:
Length of output: 65
기존
/project/my엔드포인트 사용처를 다시 한 번 전체 파일(.ts, .tsx)에서 확인합니다:🏁 Script executed:
Length of output: 128
/project/my엔드포인트 교체 및 디버깅 로그 제거 필요다음 두 군데를 수정해주세요:
console.log(response)제거${import.meta.env.VITE_API_BASE_URL}/project/my→${import.meta.env.VITE_API_BASE_URL}/user/project로 엔드포인트 변경🤖 Prompt for AI Agents