Skip to content

Commit

Permalink
fix: 유저 질문 답변 목록 에러 수정 (#142)
Browse files Browse the repository at this point in the history
* fix: error

* fix: 이전 질문 목록 버그 수정
  • Loading branch information
Andrevile authored Aug 25, 2024
1 parent 9c0620d commit 7300c1d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ export const AnsweredQuestionsContainer = forwardRef<Ref>((_, ref) => {

const checkboxRefs = useRef<(HTMLInputElement | null)[]>([]);

if (answersLength === 0) {
return <EmptyView title="아직 답변한 릴레이 질문이 없어요" style={{ height: '300px' }} />;
}

const handleModify = () => {
const checkedIds = checkboxRefs.current
.filter((checkbox) => checkbox?.checked)
Expand All @@ -46,6 +42,10 @@ export const AnsweredQuestionsContainer = forwardRef<Ref>((_, ref) => {
onMutate: handleModify,
}));

if (answersLength === 0) {
return <EmptyView title="아직 답변한 릴레이 질문이 없어요" style={{ height: '300px' }} />;
}

return (
<section>
<If condition={isModifyPage}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const PreviousQuestionItem = ({ meetingId, question }: PreviousQuestionIt
listStyle: 'none',
}}
>
<Link href={`${meetingId}/question-result/${meetingQuestionId}`} css={{ display: 'flex' }}>
<Link href={`/${meetingId}/question-result/${meetingQuestionId}`} css={{ display: 'flex' }}>
<div
css={{
display: 'flex',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import { MutableRefObject } from 'react';

import { EmptyView } from '@/common/components';

import { ActionBar } from '../../../../common/components/ActionBar/ActionBar';
import { PreviousQuestionItem } from '../components/PreviousQuestion/PreviousQuestionItem';
import { PreviousQuestionList } from '../components/PreviousQuestion/PreviousQuestionList';
Expand All @@ -11,7 +13,12 @@ export const PreviousQuestionListContainer = () => {
const { previousQuestionList, targetRef, meetingId } = usePreviousQuestionListService();

if (!previousQuestionList || !previousQuestionList.length) {
return <ActionBar title="이전 질문" css={{ paddingTop: '8px' }} />;
return (
<>
<ActionBar title="이전 질문" css={{ paddingTop: '8px' }} />
<EmptyView title="이전 질문이 없어요!" style={{ height: '100vh' }} />
</>
);
}

return (
Expand Down

0 comments on commit 7300c1d

Please sign in to comment.