feat: ArticleDetail answer=null 추가

This commit is contained in:
정기영 2024-07-18 10:33:40 +09:00
parent e70d91e5b9
commit 889d0113f4
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@ import { Link } from 'react-router-dom';
import styles from './ArticleDetail.module.css';
import ArticleDetailAnswer from './ArticleDetailAnswer/ArticleDetailAnswer';
export default function ArticleDetail({ topic, title, author, content, answer }) {
export default function ArticleDetail({ topic, title, author, content, answer = null }) {
// TODO:
console.log(answer);
return (
@ -25,7 +25,7 @@ export default function ArticleDetail({ topic, title, author, content, answer })
<div>
<p className={styles.content}>{content}</p>
</div>
<ArticleDetailAnswer answer={answer} />
{answer && <ArticleDetailAnswer answer={answer} />}
</div>
);
}

View File

@ -3,7 +3,7 @@ import { SideBar, SideLink, SideItem } from '../../components/SideBar';
import { MaxWidthLayout } from '../../components/Layout';
import { ArticleDetail } from '../../components/Article';
export default function LearningLectureDetailPage() {
export default function QuestionDetailPage() {
const lecture = {
title: '정보처리기사 실기 완전정복',
tutor: '박정민',