Skip to content
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

REV-381/최종 리뷰 결과 반영 안되는 문제 해결 #93

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading