fix(main): 팔로잉 커뮤니티 상세로 이동한다

This commit is contained in:
Yu Sung
2026-07-12 05:54:02 +09:00
parent e717a12344
commit ec79e3ce8b
5 changed files with 67 additions and 21 deletions

View File

@@ -4,15 +4,18 @@ struct MainHomeFollowingNewsSection: View {
let recentNews: [FollowingNewsResponse]
let onTapCreator: (Int) -> Void
let onTapContent: (Int) -> Void
let onTapCommunityPost: (Int) -> Void
init(
recentNews: [FollowingNewsResponse],
onTapCreator: @escaping (Int) -> Void = { _ in },
onTapContent: @escaping (Int) -> Void = { _ in }
onTapContent: @escaping (Int) -> Void = { _ in },
onTapCommunityPost: @escaping (Int) -> Void = { _ in }
) {
self.recentNews = recentNews
self.onTapCreator = onTapCreator
self.onTapContent = onTapContent
self.onTapCommunityPost = onTapCommunityPost
}
var body: some View {
@@ -82,7 +85,13 @@ struct MainHomeFollowingNewsSection: View {
createdAt: communityPost.relativeCreatedAtText(),
isLike: false,
likeCount: communityPost.likeCount,
commentCount: communityPost.commentCount
commentCount: communityPost.commentCount,
onTapPost: {
onTapCommunityPost(communityPost.postId)
},
onTapComment: {
onTapCommunityPost(communityPost.postId)
}
)
}

View File

@@ -9,6 +9,7 @@ struct MainHomeFollowingView: View {
let onTapChatTab: () -> Void
let onTapChatRoom: (Int) -> Void
let onTapSchedule: (CreatorActivityType, Int) -> Void
let onTapCommunityPost: (Int) -> Void
@StateObject private var viewModel = MainHomeFollowingViewModel()
@@ -20,7 +21,8 @@ struct MainHomeFollowingView: View {
onTapFollowingAll: @escaping () -> Void = {},
onTapChatTab: @escaping () -> Void = {},
onTapChatRoom: @escaping (Int) -> Void = { _ in },
onTapSchedule: @escaping (CreatorActivityType, Int) -> Void = { _, _ in }
onTapSchedule: @escaping (CreatorActivityType, Int) -> Void = { _, _ in },
onTapCommunityPost: @escaping (Int) -> Void = { _ in }
) {
self.onTapLive = onTapLive
self.onTapCreator = onTapCreator
@@ -30,6 +32,7 @@ struct MainHomeFollowingView: View {
self.onTapChatTab = onTapChatTab
self.onTapChatRoom = onTapChatRoom
self.onTapSchedule = onTapSchedule
self.onTapCommunityPost = onTapCommunityPost
}
var body: some View {
@@ -93,7 +96,8 @@ struct MainHomeFollowingView: View {
MainHomeFollowingNewsSection(
recentNews: response.recentNews,
onTapCreator: onTapCreator,
onTapContent: onTapContent
onTapContent: onTapContent,
onTapCommunityPost: onTapCommunityPost
)
.padding(.top, 48)
}

View File

@@ -84,7 +84,8 @@ struct MainHomeView: View {
onTapFollowingAll: onTapFollowingAll,
onTapChatTab: onTapChatTab,
onTapChatRoom: onTapChatRoom,
onTapSchedule: onTapFollowingSchedule
onTapSchedule: onTapFollowingSchedule,
onTapCommunityPost: onTapCommunityPost
)
}
}