Skip to content

Commit 53c0a1c

Browse files
committed
[chore]폴더구조 변경 comment 공유 컴포넌트화
1 parent 3f5aa8c commit 53c0a1c

File tree

7 files changed

+22
-15
lines changed

7 files changed

+22
-15
lines changed

src/app/community/[id]/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import CommentList from '@/domains/community/detail/comment/CommentList';
2-
import DetailComment from '@/domains/community/detail/comment/DetailComment';
1+
import CommentList from '@/domains/shared/comment/CommentList';
32
import DetailContent from '@/domains/community/detail/DetailContent';
43
import DetailHeader from '@/domains/community/detail/DetailHeader';
54
import DetailTitle from '@/domains/community/detail/DetailTitle';
65
import DetailTabDesktop from '@/domains/community/detail/tab/DetailTabDesktop';
76
import StarBg from '@/domains/shared/starBg/StarBg';
7+
import CommentHeader from '@/domains/shared/comment/CommentHeader';
88

99
function Page() {
1010
return (
@@ -14,8 +14,8 @@ function Page() {
1414
<DetailHeader />
1515
<DetailTitle />
1616
<DetailContent />
17-
<section className="mb-10">
18-
<DetailComment />
17+
<section className="mb-10 border-t-1 border-gray ">
18+
<CommentHeader />
1919
<CommentList />
2020
</section>
2121
</article>

src/app/community/write/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Category from '@/domains/community/write/Category';
12
import CompleteBtn from '@/domains/community/write/CompleteBtn';
23
import FormTitle from '@/domains/community/write/FormTitle';
34
import WriteForm from '@/domains/community/write/WriteForm';
@@ -11,6 +12,7 @@ function Page() {
1112
<CompleteBtn />
1213
<section>
1314
<FormTitle />
15+
<Category />
1416
<WriteForm />
1517
</section>
1618
</div>

src/domains/community/detail/DetailContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import DetailTabMobile from './tab/DetailTabMobile';
88

99
function DetailContent() {
1010
return (
11-
<section className="mt-5 flex flex-col items-start w-full gap-3 border-b-1 border-gray pb-10 relative">
11+
<section className="mt-5 flex flex-col items-start w-full gap-3 pb-10 relative">
1212
<figure className="flex items-center justify-center sm:justify-start mb-5 max-h-120">
1313
<Image src={prePost} alt="더미 이미지" height={600} className="sm:w-auto w-full" />
1414
</figure>
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import SelectBox from '@/domains/shared/select-box/SelectBox';
22

33
function Category() {
4-
return <div></div>;
4+
return (
5+
<div>
6+
<SelectBox option={['레시피', '팁', '질문', '자유']} title="카테고리" />
7+
</div>
8+
);
59
}
610

711
export default Category;

src/domains/community/detail/comment/DetailComment.tsx renamed to src/domains/shared/comment/CommentHeader.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import Button from '@/shared/components/button/Button';
22
import Input from '@/shared/components/InputBox/Input';
33

4-
function DetailComment() {
4+
function CommentHeader({ totalComment = false }: { totalComment?: boolean }) {
55
return (
66
<section aria-label="댓글" className="mt-6 w-full">
7+
{totalComment && <span>댓글 2</span>}
78
<div className="w-full relative mt-5">
89
<Input placeholder="댓글로 의견을 남겨주세요" id="community-comment" className="w-full" />
910
<Button
@@ -18,4 +19,4 @@ function DetailComment() {
1819
);
1920
}
2021

21-
export default DetailComment;
22+
export default CommentHeader;

src/domains/community/detail/comment/CommentList.tsx renamed to src/domains/shared/comment/CommentList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import CommentHeader from './CommentHeader';
1+
import CommentTitle from './CommentTitle';
22

33
function CommentList() {
44
return (
55
<ul aria-label="댓글 목록" className="flex flex-col mt-6">
66
<li className="border-b-1 border-gray py-3">
77
<article>
8-
<CommentHeader />
8+
<CommentTitle />
99
<div className="mt-4">
1010
<p>정말 대단하시네요</p>
1111
</div>
1212
</article>
1313
</li>
1414
<li className="border-b-1 border-gray py-3">
1515
<article>
16-
<CommentHeader />
16+
<CommentTitle />
1717
<div className="mt-4">
1818
<p>정말 대단하시네요</p>
1919
</div>

src/domains/community/detail/comment/CommentHeader.tsx renamed to src/domains/shared/comment/CommentTitle.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import EditDelete from '../EditDelete';
2-
import Profile from '../Profile';
1+
import EditDelete from '../../community/detail/EditDelete';
2+
import Profile from '../../community/detail/Profile';
33

4-
function CommentHeader() {
4+
function CommentTitle() {
55
return (
66
<div className="flex items-center justify-between">
77
<div className="flex items-center gap-3">
@@ -14,4 +14,4 @@ function CommentHeader() {
1414
);
1515
}
1616

17-
export default CommentHeader;
17+
export default CommentTitle;

0 commit comments

Comments
 (0)