Skip to content

Commit

Permalink
refactor: 최종 리뷰 결과 반영 안되는 문제 해결 (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
khj0426 authored Nov 29, 2023
1 parent f8bc6d3 commit cebd276
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 18 deletions.
36 changes: 22 additions & 14 deletions src/components/UserList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface UserListProps {
onClickUser?: ({ id, name }: { id: string; name: string }) => void
hasDrawer?: boolean
ResponserList?: number[]
questionType?: 'PROCEEDING' | 'DEADLINE' | 'END'
}

const UserList = ({
Expand All @@ -23,6 +24,7 @@ const UserList = ({
onClickUser,
hasDrawer,
ResponserList,
questionType,
}: UserListProps) => {
const handleClick = (id: string, name: string) => {
onClickUser && onClickUser({ id, name })
Expand Down Expand Up @@ -60,13 +62,17 @@ const UserList = ({
className="flex items-center justify-between px-3 py-2 text-sm md:text-lg"
>
<div className="flex items-center gap-2">
{responserCount && responserCount[index] && (
<span
className={`dot ${
hasSavedResult(user.id) ? 'bg-blue-600' : 'bg-red-600'
}`}
></span>
)}
{responserCount &&
responserCount[index] &&
questionType !== 'PROCEEDING' && (
<span
className={`dot ${
hasSavedResult(user.id)
? 'bg-blue-600'
: 'bg-red-600'
}`}
></span>
)}
<Profile name={user.name} />
</div>
<div className="text-xs text-gray-300 dark:text-gray-100 md:text-sm">
Expand All @@ -90,13 +96,15 @@ const UserList = ({
className="flex items-center justify-between px-3 py-2 text-sm md:text-lg"
>
<div className="flex items-center gap-2">
{responserCount && responserCount[index] && (
<span
className={`dot ${
hasSavedResult(user.id) ? 'bg-blue-600' : 'bg-red-600'
}`}
></span>
)}
{responserCount &&
responserCount[index] &&
questionType !== 'PROCEEDING' && (
<span
className={`dot ${
hasSavedResult(user.id) ? 'bg-blue-600' : 'bg-red-600'
}`}
></span>
)}
<Profile name={user.name} />
</div>
<div className="text-xs text-gray-300 dark:text-gray-100 md:text-sm">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import { useResponseReviewByUser } from '../../hooks'
interface AllResponseReviewByResponseProps {
reviewId: string
ResponserList?: number[]
questionOption?: 'PROCEEDING' | 'DEADLINE' | 'END'
}
const AllResponseReviewByResponser = ({
reviewId,
ResponserList,
questionOption,
}: AllResponseReviewByResponseProps) => {
const { data: responseByReceiver } = useGetAllResponseByReceiver({
reviewId,
Expand Down Expand Up @@ -68,6 +70,7 @@ const AllResponseReviewByResponser = ({
(value) => value.responserCount,
)}
ResponserList={ResponserList}
questionType={questionOption}
/>
<Suspense fallback={<div className="spinner"></div>}>
{selectedUser.id && (
Expand Down
8 changes: 4 additions & 4 deletions src/pages/CreatedReviewManagePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ const CreatedReviewManagePage = () => {
}

const handleClickSendSurvey = () => {
if (
!checkAllReceiverReceived?.success ||
getReviewQuestion?.status === 'END'
) {
if (getReviewQuestion?.status === 'END') {
//NOTE - 토스트 처리

return
Expand Down Expand Up @@ -109,6 +106,9 @@ const CreatedReviewManagePage = () => {
}
>
<AllResponseReviewByReceiver
questionOption={
getReviewQuestion.status as 'END' | 'DEADLINE' | 'PROCEEDING'
}
reviewId={reviewId}
ResponserList={
getReviewQuestion.status === 'END'
Expand Down

0 comments on commit cebd276

Please sign in to comment.