feat: 링크 업데이트

This commit is contained in:
jhynsoo 2024-07-21 16:05:21 +09:00
parent 19b28f978e
commit c2838434c4
4 changed files with 28 additions and 38 deletions

View File

@ -10,7 +10,7 @@ export default function ArticleDetail({ topic, title, author = null, content, an
<header>
<div>
<Link
to={'/'}
to={'..'}
className={styles.backButton}
>
<div>-</div>

View File

@ -1,10 +1,10 @@
import { Link } from 'react-router-dom';
import styles from './ArticleLink.module.css';
export default function ArticleLink({ path, title, sub }) {
export default function ArticleLink({ to, title, sub }) {
return (
<Link
to={path}
to={to}
className={styles.articleLink}
>
<span className={styles.note}>{title}</span>

View File

@ -3,12 +3,10 @@ import ArticleBoard from '../../components/ArticleBoard/ArticleBoard';
export default function NoticeListPage() {
const notices = [
{},
{ title: '공지사항1', sub: '7-12 오전 11:40:57' },
{ title: '공지사하앙2', sub: '7-12 오전 11:40:57' },
{ title: '공지사하앙33', sub: '7-15 오전 11:40:57' },
{ title: '제목만 있는 경우' },
{ sub: '날짜만 있는 경우' },
{ id: 1, title: '공지사항1', sub: '7-12 오전 11:40:57' },
{ id: 2, title: '공지사하앙2', sub: '7-12 오전 11:40:57' },
{ id: 3, title: '공지사하앙33', sub: '7-15 오전 11:40:57' },
{ id: 4, title: '제목만 있는 경우' },
];
return (
@ -16,17 +14,14 @@ export default function NoticeListPage() {
title="공지사항"
canCreate={true}
>
{notices.map((notice) => {
if (notice.sub && notice.title) {
return (
<ArticleLink
key={`${notice.title}${notice.sub}`}
title={notice.title}
sub={notice.sub}
/>
);
}
})}
{notices.map((notice) => (
<ArticleLink
key={`${notice.title}${notice.sub}`}
title={notice.title}
sub={notice.sub}
to={`${notice.id}`}
/>
))}
</ArticleBoard>
);
}

View File

@ -2,13 +2,11 @@ import { ArticleLink } from '../../components/ArticleLink';
import ArticleBoard from '../../components/ArticleBoard/ArticleBoard';
export default function QuestionListPage() {
const notices = [
{},
{ title: 'Question1', sub: '7-12 오전 11:40:57' },
{ title: 'Question2', sub: '7-12 오전 11:40:57' },
{ title: '헷갈리는게 있어요', sub: '7-15 오전 11:40:57' },
{ title: '궁금궁금', sub: '7-15 오전 11:40:57' },
{ sub: '날짜만 있는 경우' },
const questions = [
{ id: 2, title: 'Question1', sub: '7-12 오전 11:40:57' },
{ id: 3, title: 'Question2', sub: '7-12 오전 11:40:57' },
{ id: 4, title: '헷갈리는게 있어요', sub: '7-15 오전 11:40:57' },
{ id: 5, title: '궁금궁금', sub: '7-15 오전 11:40:57' },
];
return (
@ -17,17 +15,14 @@ export default function QuestionListPage() {
canCreate={true}
createPath="/"
>
{notices.map((notice) => {
if (notice.sub && notice.title) {
return (
<ArticleLink
key={`${notice.title}${notice.sub}`}
title={notice.title}
sub={notice.sub}
/>
);
}
})}
{questions.map((question) => (
<ArticleLink
key={`${question.title}${question.sub}`}
title={question.title}
sub={question.sub}
to={`${question.id}`}
/>
))}
</ArticleBoard>
);
}