feat: ArticlePreview에 to(Link 주소) props 추가

This commit is contained in:
정기영 2024-07-22 13:02:36 +09:00
parent 898da6d111
commit 2e53c1b7d9
3 changed files with 6 additions and 2 deletions

View File

@ -1,13 +1,13 @@
import { Link } from 'react-router-dom';
import styles from './ArticlePreview.module.css';
export default function ArticlePreview({ title, contents = [] }) {
export default function ArticlePreview({ to, title, contents = [] }) {
// TODO:
return (
<div className={styles.wrapper}>
<div className={styles.header}>
<div className={styles.title}>{title}</div>
<Link to="/">ICON</Link>
<Link to={to}>ICON</Link>
</div>
<div className={styles.main}>
{contents.map((content) => {

View File

@ -22,10 +22,12 @@ export default function LearningLectureDetailPage() {
return (
<main className={styles.previews}>
<ArticlePreview
to="notice"
title="공지사항"
contents={notices}
/>
<ArticlePreview
to="qna"
title="Q&A"
contents={questions}
/>

View File

@ -24,10 +24,12 @@ export default function TeacherLectureDetailPage() {
<main className={styles.previews}>
{/* FIXME: 밑에 ArticlePreview 바꿔야함. 공지사항 Q&A 커리큘럼 으로 나눠서 작성할 수 있게 바꾸고 링크 상위 3개만 받고 링크 줄 수 있게 할지 말지. 이거 바꾸면 LearningLectureDetailPage도 똑같이 바꾸면 될듯*/}
<ArticlePreview
to="notice"
title="공지사항"
contents={notices}
/>
<ArticlePreview
to="qna"
title="Q&A"
contents={questions}
/>