Skip to content

Commit 889c30b

Browse files
committed
[FE-246]feat: 내 댓글 관리 페이지 레이아웃 개발
1 parent 36b676e commit 889c30b

1 file changed

Lines changed: 67 additions & 1 deletion

File tree

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,73 @@
1+
import BackButton from '@components/BackButton'
12
import React from 'react'
3+
import { useNavigate } from 'react-router-dom'
4+
import CommentSection from './CommentSection'
5+
6+
interface CommentType {
7+
writer: string
8+
title: string
9+
createdAt: string
10+
id: number
11+
}
212

313
function ManageComment() {
4-
return <div>댓글관리에용</div>
14+
const navigate = useNavigate()
15+
const COMMENTS = [
16+
{ id: 1, writer: '모승', title: '실험인데용', createdAt: '2022.10.01' },
17+
{ id: 2, writer: '모승', title: '실험인데용', createdAt: '2022.10.01' },
18+
{ id: 3, writer: '모승', title: '실험인데용', createdAt: '2022.10.01' },
19+
]
20+
const recordId = 270
21+
const ALL_POSTS = [1, 2, 3, 4, 5]
22+
23+
return (
24+
<div className="px-6 pt-4">
25+
<div className="flex justify-between pb-8">
26+
<BackButton />
27+
<p className="cursor-pointer text-xs font-medium text-primary-2">
28+
선택
29+
</p>
30+
</div>
31+
<div className="flex justify-end">
32+
<p>최신순</p>
33+
</div>
34+
<div>
35+
{ALL_POSTS.map((src) => (
36+
<section key={src} className="mt-4 flex flex-col items-start pr-4">
37+
<p className="mb-4">2022.12.01</p>
38+
<CommentSection
39+
parentCategoryId={1}
40+
recordId={350}
41+
colorName={`bg-icon-purple`}
42+
title={'실험인데요'}
43+
writer={'모송'}
44+
numOfComment={5}
45+
iconName={'gift'}
46+
/>
47+
<section className="flex w-full flex-col gap-2 pl-[56px]">
48+
{COMMENTS.map(({ writer, title, createdAt, id }: CommentType) => (
49+
<div key={id} className="w-full rounded-[8px] bg-grey-2 p-3">
50+
<div className="flex">
51+
<p className=" mr-2 text-xs font-medium">{writer}</p>
52+
<p className="text-xs font-normal text-grey-5">
53+
{createdAt}
54+
</p>
55+
</div>
56+
<p className="text-xs font-normal text-grey-8">{title}</p>
57+
</div>
58+
))}
59+
<p
60+
onClick={() => navigate(`/record/${recordId}`)}
61+
className="cursor-pointer text-xs font-normal text-grey-7"
62+
>
63+
전체보기
64+
</p>
65+
</section>
66+
</section>
67+
))}
68+
</div>
69+
</div>
70+
)
571
}
672

773
export default ManageComment

0 commit comments

Comments
 (0)