From 19f52d4a48861ce4b5841824e992eb23144a1852 Mon Sep 17 00:00:00 2001 From: jhynsoo Date: Wed, 15 May 2024 16:34:08 +0900 Subject: [PATCH 1/3] Feat: Add button components --- src/components/common/FilledButton.vue | 56 ++++++++++++++++++++++++++ src/components/common/TextButton.vue | 48 ++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 src/components/common/FilledButton.vue create mode 100644 src/components/common/TextButton.vue diff --git a/src/components/common/FilledButton.vue b/src/components/common/FilledButton.vue new file mode 100644 index 0000000..1d007ae --- /dev/null +++ b/src/components/common/FilledButton.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/src/components/common/TextButton.vue b/src/components/common/TextButton.vue new file mode 100644 index 0000000..7fc8ada --- /dev/null +++ b/src/components/common/TextButton.vue @@ -0,0 +1,48 @@ + + + + + From b88e2fe28a8aec867b41aea4e1240fb5787be36d Mon Sep 17 00:00:00 2001 From: jhynsoo Date: Wed, 15 May 2024 17:59:45 +0900 Subject: [PATCH 2/3] Feat: Add comment component --- src/components/article/CommentArea.vue | 23 ++++++++ src/components/article/CommentForm.vue | 81 ++++++++++++++++++++++++++ src/components/article/CommentItem.vue | 50 ++++++++++++++++ src/components/article/CommentList.vue | 33 ++--------- 4 files changed, 159 insertions(+), 28 deletions(-) create mode 100644 src/components/article/CommentArea.vue create mode 100644 src/components/article/CommentForm.vue create mode 100644 src/components/article/CommentItem.vue diff --git a/src/components/article/CommentArea.vue b/src/components/article/CommentArea.vue new file mode 100644 index 0000000..db30093 --- /dev/null +++ b/src/components/article/CommentArea.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/components/article/CommentForm.vue b/src/components/article/CommentForm.vue new file mode 100644 index 0000000..fca509f --- /dev/null +++ b/src/components/article/CommentForm.vue @@ -0,0 +1,81 @@ + + + + + diff --git a/src/components/article/CommentItem.vue b/src/components/article/CommentItem.vue new file mode 100644 index 0000000..bdaf265 --- /dev/null +++ b/src/components/article/CommentItem.vue @@ -0,0 +1,50 @@ + + + + + diff --git a/src/components/article/CommentList.vue b/src/components/article/CommentList.vue index 678e562..81e0ea0 100644 --- a/src/components/article/CommentList.vue +++ b/src/components/article/CommentList.vue @@ -1,41 +1,18 @@ From 443c9f1df41b1e5c4f86eb379ec0a3a54cf12834 Mon Sep 17 00:00:00 2001 From: jhynsoo Date: Wed, 15 May 2024 18:00:18 +0900 Subject: [PATCH 3/3] Design: Change article styles --- src/assets/base.css | 6 ++++- src/components/article/ArticleDetail.vue | 31 +++++++++++++++++++++--- src/components/article/ArticleForm.vue | 8 +++--- src/components/article/ArticleList.vue | 18 ++++++-------- src/components/article/BoardHeader.vue | 1 + src/components/article/CommentArea.vue | 13 +++++++++- src/components/article/CommentForm.vue | 1 + src/router/index.js | 4 +-- 8 files changed, 59 insertions(+), 23 deletions(-) diff --git a/src/assets/base.css b/src/assets/base.css index e99c4f2..156a713 100644 --- a/src/assets/base.css +++ b/src/assets/base.css @@ -89,7 +89,6 @@ body { color 0.5s, background-color 0.5s; line-height: 1.6; - font-size: 15px; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -116,4 +115,9 @@ textarea { border-radius: 8px; padding: 8px 12px; background-color: var(--color-background); + font-size: 16px; +} + +p { + white-space: pre; } diff --git a/src/components/article/ArticleDetail.vue b/src/components/article/ArticleDetail.vue index 6cc296a..225fc3b 100644 --- a/src/components/article/ArticleDetail.vue +++ b/src/components/article/ArticleDetail.vue @@ -3,16 +3,41 @@ import { ref } from 'vue'; import { useRoute } from 'vue-router'; import BoardHeader from './BoardHeader.vue'; import { getArticle } from '@/api/article'; -import CommentList from '@/components/article/CommentList.vue'; +import CommentArea from './CommentArea.vue'; const route = useRoute(); const id = Number(route.params.id); const article = ref({}); +const comments = ref([]); getArticle(id, ({ data }) => { article.value = data; }); + +// FIXME: remove mock data +setTimeout(() => { + article.value = { + title: '제목', + text: '내용', + author: '작성자', + date: '2024-04-11 13:12:14', + }; + comments.value = [ + { + id: 1, + nickname: '닉네임', + date: '2024-04-11 13:12:14', + text: '댓글 내용', + }, + { + id: 2, + nickname: '닉네임', + date: '2024-04-11 13:12:14', + text: '댓글 내용', + }, + ]; +}, 100);

{{ article.text }}

- - + diff --git a/src/components/article/ArticleForm.vue b/src/components/article/ArticleForm.vue index 0ef266d..b7b514a 100644 --- a/src/components/article/ArticleForm.vue +++ b/src/components/article/ArticleForm.vue @@ -89,12 +89,12 @@ form { } #title { - font-size: 1.25rem; + font-size: 20px; font-weight: bold; } #text { - font-size: 1rem; + font-size: 16px; min-height: 200px; } @@ -106,7 +106,7 @@ form { .errorMessage { color: var(--color-error); - font-size: 0.85rem; + font-size: 14px; } button { @@ -116,7 +116,7 @@ button { border: none; border-radius: 8px; cursor: pointer; - font-size: 1rem; + font-size: 16px; font-weight: bold; transition: scale 0.25s, diff --git a/src/components/article/ArticleList.vue b/src/components/article/ArticleList.vue index 4fe4736..fa74bbe 100644 --- a/src/components/article/ArticleList.vue +++ b/src/components/article/ArticleList.vue @@ -2,6 +2,7 @@ import { getArticles } from '@/api/article'; import { ref } from 'vue'; import { RouterLink } from 'vue-router'; +import FilledButton from '../common/FilledButton.vue'; const articles = ref([]); @@ -11,7 +12,9 @@ getArticles(({ data }) => (articles.value = data));