-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: 답변 수정 API 타입 변경 * refactor: AnswerGroup 컴포넌트 유형별로 분리 * refactor: Props로 받은 인자로 수정 api 연결 * refactor: 불필요 코드 제거 * refactor: 로딩중일 때 바로 리턴 * refactor: 빌드 오류 수정 * refactor: 리뷰 진행 중일 떄는 정제,수정, 취합된 답변 제거 * refactor: 정제,저장 버튼 오른쪽으로 이동 * refactor: 정제 시 저장 요청 안가게 설정
- Loading branch information
Showing
10 changed files
with
281 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/pages/CreatedReviewManagePage/components/AnswerGroup/RenderHexaStat.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { nanoid } from 'nanoid' | ||
import { BasicProfile } from '@/assets/images' | ||
import { Answer } from '.' | ||
|
||
const RenderHexaStat = ({ | ||
value, | ||
answers, | ||
}: { | ||
value: Answer | ||
answers: Answer[] | ||
}) => { | ||
const filteredAnswers = answers.filter((answer) => answer.name === value.name) | ||
|
||
return ( | ||
<> | ||
<div> | ||
<h2 className="mb-[0.81rem] flex h-[1.375rem] w-[3rem] items-center justify-center bg-gray-300 text-sm text-white"> | ||
{value?.name} | ||
</h2> | ||
</div> | ||
<div className="flex"> | ||
{filteredAnswers.map((value) => ( | ||
<div className="flex w-3/6 flex-wrap gap-[0.31rem]" key={nanoid()}> | ||
<img | ||
src={BasicProfile} | ||
className="avatar h-[1.25rem] w-[1.25rem] border dark:bg-white dark:fill-white" | ||
/> | ||
<p className="text-sm">{value?.userName}</p> | ||
<p className="text-sm text-sub-wine">{value?.value}</p> | ||
</div> | ||
))} | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export default RenderHexaStat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/pages/CreatedReviewManagePage/components/AnswerGroup/RenderStarRatingAnswer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { StarRatingList } from '@/components' | ||
import { BasicProfile } from '@/assets/images' | ||
|
||
interface StarRatingAnswerProps { | ||
value?: string | number | null | ||
userName?: string | ||
} | ||
|
||
const RenderStarRatingAnswer = ({ value, userName }: StarRatingAnswerProps) => { | ||
return ( | ||
<div> | ||
<h3 className="flex items-center"> | ||
<img | ||
src={BasicProfile} | ||
className="avatar h-[1.25rem] w-[1.25rem] border dark:bg-white dark:fill-white" | ||
/> | ||
<p className="ml-[1.31rem] text-sm">{userName}</p> | ||
</h3> | ||
<div className="ml-[42.96px] mt-[0.5rem] text-base leading-5 md:mt-[0.62rem]"> | ||
<StarRatingList rate={Number(value)} fixed={true} /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default RenderStarRatingAnswer |
41 changes: 41 additions & 0 deletions
41
src/pages/CreatedReviewManagePage/components/AnswerGroup/RenderSubjectiveAnswer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { BasicProfile } from '@/assets/images' | ||
import RenderRefinedSubjective from './RenderRefinedSubjective' | ||
import { Answer } from './' | ||
|
||
interface RenderSubjeciveAnswerProps { | ||
reviewStatus?: 'END' | 'DEADLINE' | 'PROCEEDING' | ||
role?: 'responser' | 'receiver' | ||
value: Answer | ||
isLastAnswer: boolean | ||
text: string | ||
questionId: number | ||
reviewId: number | ||
userId: string | ||
} | ||
|
||
const RenderSubjectiveAnswer = ({ | ||
reviewStatus, | ||
role, | ||
value, | ||
isLastAnswer, | ||
...rest | ||
}: RenderSubjeciveAnswerProps) => ( | ||
<> | ||
<h3 className="flex items-center "> | ||
<img | ||
src={BasicProfile} | ||
className="avatar h-[1.25rem] w-[1.25rem] border dark:bg-white dark:fill-white" | ||
/> | ||
<p className="ml-[1.31rem] text-sm">{value?.userName}</p> | ||
</h3> | ||
<p className="ml-[42.96px] mt-[0.5rem] break-all text-base leading-5 md:mt-[0.62rem]"> | ||
{value?.value} | ||
</p> | ||
|
||
{isLastAnswer && role !== 'responser' && reviewStatus !== 'PROCEEDING' && ( | ||
<RenderRefinedSubjective {...rest} /> | ||
)} | ||
</> | ||
) | ||
|
||
export default RenderSubjectiveAnswer |
Oops, something went wrong.