File tree 8 files changed +49
-28
lines changed
mypage/MyPageMain/BookmarkedBoardsList
8 files changed +49
-28
lines changed Original file line number Diff line number Diff line change @@ -39,13 +39,14 @@ export default function BoardsList({
39
39
className = "w-full"
40
40
>
41
41
< FeedBoardCard
42
- userId = { board . writer }
42
+ boardId = { board . id }
43
+ userName = { board . writer }
43
44
content = { board . content }
44
45
imgs = { board . fileNames }
45
46
setShowModal = { setShowModal }
46
47
comments = { board . replyListDto }
47
48
commentsCount = { board . replyCount }
48
- boardId = { board . id }
49
+ likedCount = { board . likedCount }
49
50
/>
50
51
</ div >
51
52
) )
Original file line number Diff line number Diff line change @@ -37,10 +37,10 @@ export default function BookmarkedBoardsList() {
37
37
< MyBoardCard
38
38
userName = { board . writer }
39
39
content = { board . content }
40
- // TODO: 이미지 연결
41
- imgs = { [ ] }
42
- commentsCount = { board . replyCount }
40
+ imgs = { board . fileNames }
43
41
setShowModal = { setShowModal }
42
+ commentsCount = { board . replyCount }
43
+ likedCount = { board . likedCount }
44
44
/>
45
45
</ div >
46
46
) ) ,
Original file line number Diff line number Diff line change @@ -8,13 +8,15 @@ import Button from '../../Button';
8
8
export function BoardCardCommentWrapper ( {
9
9
children,
10
10
isModal = false ,
11
- commentsNum,
12
11
boardId,
12
+ commentsCount,
13
+ likedCount,
13
14
} : {
14
15
children : React . ReactNode ;
15
16
isModal ?: boolean ;
16
- commentsNum : number ;
17
17
boardId : number ;
18
+ commentsCount : number ;
19
+ likedCount : number ;
18
20
} ) {
19
21
const [ commentText , setCommentText ] = useState ( '' ) ;
20
22
const [ isUploading , setIsUploading ] = useState ( false ) ;
@@ -54,11 +56,11 @@ export function BoardCardCommentWrapper({
54
56
< FlexBox className = "gap-5" >
55
57
< FlexBox className = "gap-2 body3 text-grey-500" >
56
58
< div > 댓글</ div >
57
- < div > { commentsNum } </ div >
59
+ < div > { commentsCount } </ div >
58
60
</ FlexBox >
59
61
< FlexBox className = "gap-2 body3 text-grey-500" >
60
62
< div > 좋아요</ div >
61
- < div > 2 </ div >
63
+ < div > { likedCount } </ div >
62
64
</ FlexBox >
63
65
</ FlexBox >
64
66
{ isModal ? (
@@ -104,11 +106,13 @@ export function BoardCardCommentWrapper({
104
106
}
105
107
106
108
export function MyPageBoardCardCommentWrapper ( {
107
- commentsCount,
108
109
onClickModal,
110
+ commentsCount,
111
+ likedCount,
109
112
} : {
110
- commentsCount : number ;
111
113
onClickModal : ( ) => void ;
114
+ commentsCount : number ;
115
+ likedCount : number ;
112
116
} ) {
113
117
return (
114
118
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
@@ -127,7 +131,7 @@ export function MyPageBoardCardCommentWrapper({
127
131
</ FlexBox >
128
132
< FlexBox className = "gap-2 body3 text-grey-500" >
129
133
< div > 좋아요</ div >
130
- < div > 2 </ div >
134
+ < div > { likedCount } </ div >
131
135
</ FlexBox >
132
136
</ FlexBox >
133
137
</ FlexBox >
Original file line number Diff line number Diff line change @@ -3,18 +3,19 @@ import Avatar from '../../Avatar';
3
3
import FlexBox from '../../FlexBox' ;
4
4
import BoardCardDropdown from './BoardCardDropdown' ;
5
5
6
- export default function BoardCardHeader ( { userId } : { userId : string } ) {
6
+ export default function BoardCardHeader ( { userName } : { userName : string } ) {
7
7
return (
8
8
< FlexBox justify = "between" className = "w-full" >
9
9
< FlexBox className = "gap-[10px]" >
10
10
< Avatar
11
11
size = "xl"
12
+ // TODO : 유저 프로필 사진 연결!
12
13
image = "/Feed/desktop/tempProfilePic.svg"
13
- name = { String ( userId ) }
14
+ name = { String ( userName ) }
14
15
/>
15
16
< FlexBox direction = "column" align = "start" className = "gap-1" >
16
17
< FlexBox className = "gap-2" >
17
- < div className = "header4 text-grey-800" > { userId } </ div >
18
+ < div className = "header4 text-grey-800" > { userName } </ div >
18
19
</ FlexBox >
19
20
< div className = "caption2 text-grey-400" >
20
21
고양이 아무튼 자격증 보유중 ・ 3시간 전
Original file line number Diff line number Diff line change @@ -4,40 +4,43 @@ import { BoardCard } from '@/components/ui/BoardCard/BoardCardPackage';
4
4
import FlexBox from '../FlexBox' ;
5
5
6
6
interface FeedBoardCardProps {
7
- userId : string ;
7
+ boardId : number ;
8
+ userName : string ;
8
9
content : string ;
9
10
imgs : string [ ] ;
10
11
setShowModal : Dispatch < SetStateAction < boolean > > ;
11
12
comments : Comment [ ] | undefined ;
12
13
commentsCount : number ;
13
- boardId : number ;
14
+ likedCount : number ;
14
15
}
15
16
16
17
export default function FeedBoardCard ( {
17
- userId,
18
+ boardId,
19
+ userName,
18
20
content,
19
21
imgs,
20
22
setShowModal,
21
23
comments,
22
24
commentsCount,
23
- boardId ,
25
+ likedCount ,
24
26
} : FeedBoardCardProps ) {
25
27
return (
26
28
< FlexBox
27
29
direction = "column"
28
30
justify = "between"
29
31
className = "max-h-[500px] p-9 rounded-[10px] border-[1px] border-grey-200 gap-4"
30
32
>
31
- < BoardCard . Header userId = { userId } />
33
+ < BoardCard . Header userName = { userName } />
32
34
< BoardCard . Content
33
35
type = "mainPC"
34
36
content = { content }
35
37
imgs = { imgs }
36
38
onClickModal = { ( ) => setShowModal ( true ) }
37
39
>
38
40
< BoardCard . BoardCardCommentWrapper
39
- commentsNum = { commentsCount }
40
41
boardId = { boardId }
42
+ commentsCount = { commentsCount }
43
+ likedCount = { likedCount }
41
44
>
42
45
< FlexBox
43
46
direction = "column"
Original file line number Diff line number Diff line change @@ -2,32 +2,39 @@ import { Comment } from '@/types/types';
2
2
import { BoardCardModal } from '@/components/ui/BoardCard/BoardCardPackage/BoardCardModalPackage' ;
3
3
4
4
interface ModalBoardCardProps {
5
- userId : string ;
5
+ boardId : number ;
6
+ userName : string ;
6
7
imgs : string [ ] ;
7
8
content : string ;
8
9
comments : Comment [ ] | undefined ;
9
10
commentsCount : number ;
11
+ likedCount : number ;
10
12
}
11
13
export default function ModalBoardCard ( {
12
- userId,
14
+ boardId,
15
+ userName,
13
16
imgs,
14
17
content,
15
18
comments,
16
19
commentsCount,
20
+ likedCount,
17
21
} : ModalBoardCardProps ) {
18
22
return (
19
23
< BoardCardModal imgs = { imgs } >
20
- < BoardCardModal . Header userId = { userId } />
24
+ < BoardCardModal . Header userName = { userName } />
21
25
< BoardCardModal . Content type = "modal" content = { content } imgs = { imgs } >
22
26
< BoardCardModal . BoardCardCommentWrapper
23
- commentsNum = { commentsCount }
24
27
isModal
28
+ boardId = { boardId }
29
+ commentsCount = { commentsCount }
30
+ likedCount = { likedCount }
25
31
>
26
32
{ comments ?. map ( ( comment ) => (
27
33
< BoardCardModal . ModalComments
28
34
id = { comment . id }
29
35
userName = { comment . nickname }
30
36
content = { comment . content }
37
+ // TODO: 유저 프로필 사진 연결!
31
38
userImg = "/Feed/desktop/tempProfilePic.svg"
32
39
/>
33
40
) ) }
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ interface MyBoardCardProps {
7
7
imgs : string [ ] ;
8
8
setShowModal : Dispatch < SetStateAction < boolean > > ;
9
9
commentsCount : number ;
10
+ likedCount : number ;
10
11
}
11
12
12
13
export default function MyPageBoardCard ( {
@@ -15,19 +16,21 @@ export default function MyPageBoardCard({
15
16
imgs,
16
17
setShowModal,
17
18
commentsCount,
19
+ likedCount,
18
20
} : MyBoardCardProps ) {
19
21
return (
20
22
< BoardCard >
21
- < BoardCard . Header userId = { userName } />
23
+ < BoardCard . Header userName = { userName } />
22
24
< BoardCard . Content
23
25
type = "myPage"
24
26
content = { content }
25
27
imgs = { imgs }
26
28
onClickModal = { ( ) => setShowModal ( true ) }
27
29
>
28
30
< BoardCard . MyPageBoardCardCommentWrapper
29
- commentsCount = { commentsCount }
30
31
onClickModal = { ( ) => setShowModal ( true ) }
32
+ commentsCount = { commentsCount }
33
+ likedCount = { likedCount }
31
34
/>
32
35
</ BoardCard . Content >
33
36
</ BoardCard >
Original file line number Diff line number Diff line change @@ -32,11 +32,13 @@ export default function BoardModal({
32
32
</ FlexBox >
33
33
{ board ? (
34
34
< ModalBoardCard
35
- userId = { board . writer }
35
+ boardId = { board . id }
36
+ userName = { board . writer }
36
37
imgs = { board . fileNames }
37
38
content = { board . title }
38
39
comments = { comments }
39
40
commentsCount = { board . replyCount }
41
+ likedCount = { board . likedCount }
40
42
/>
41
43
) : (
42
44
< div > 내용이 없습니다.</ div >
You can’t perform that action at this time.
0 commit comments