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

fix: 유저 질문 답변 목록 에러 수정 #142

Merged
merged 2 commits into from
Aug 25, 2024
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
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