fix(creator): 공지 상세 이동을 연결한다

This commit is contained in:
Yu Sung
2026-08-10 15:42:46 +09:00
parent c372d4a522
commit 00c40161c9
5 changed files with 145 additions and 61 deletions

View File

@@ -2,20 +2,14 @@ import SwiftUI
struct CreatorChannelNoticeSection: View {
let notices: [CreatorChannelCommunityPostResponse]
let onTapNotice: (Int) -> Void
let onTapComment: (Int) -> Void
let onTapPurchase: (CreatorChannelCommunityPostResponse) -> Void
let onTapDetail: (Int) -> Void
init(
notices: [CreatorChannelCommunityPostResponse],
onTapNotice: @escaping (Int) -> Void = { _ in },
onTapComment: @escaping (Int) -> Void = { _ in },
onTapPurchase: @escaping (CreatorChannelCommunityPostResponse) -> Void = { _ in }
onTapDetail: @escaping (Int) -> Void = { _ in }
) {
self.notices = notices
self.onTapNotice = onTapNotice
self.onTapComment = onTapComment
self.onTapPurchase = onTapPurchase
self.onTapDetail = onTapDetail
}
var body: some View {
@@ -28,14 +22,8 @@ struct CreatorChannelNoticeSection: View {
ForEach(notices) { notice in
CreatorChannelNoticeCard(
notice: notice,
onTapNotice: {
onTapNotice(notice.postId)
},
onTapComment: {
onTapComment(notice.postId)
},
onTapPurchase: {
onTapPurchase(notice)
onTapDetail: {
onTapDetail(notice.postId)
}
)
.frame(width: 374)
@@ -51,9 +39,7 @@ struct CreatorChannelNoticeSection: View {
private struct CreatorChannelNoticeCard: View {
let notice: CreatorChannelCommunityPostResponse
let onTapNotice: () -> Void
let onTapComment: () -> Void
let onTapPurchase: () -> Void
let onTapDetail: () -> Void
@StateObject private var playManager = CreatorCommunityMediaPlayerManager.shared
@StateObject private var contentPlayManager = ContentPlayManager.shared
@@ -69,7 +55,7 @@ private struct CreatorChannelNoticeCard: View {
.background(Color.gray900)
.clipShape(RoundedRectangle(cornerRadius: SodaSpacing.s14, style: .continuous))
.contentShape(Rectangle())
.onTapGesture(perform: onTapNotice)
.onTapGesture(perform: onTapDetail)
}
private var noticeLabel: some View {
@@ -164,40 +150,37 @@ private struct CreatorChannelNoticeCard: View {
}
private var paidLockOverlay: some View {
Button(action: onTapPurchase) {
ZStack {
Color.gray700.opacity(0.35)
ZStack {
Color.gray700.opacity(0.35)
VStack(spacing: SodaSpacing.s4) {
Image("ic_new_community_lock")
VStack(spacing: SodaSpacing.s4) {
Image("ic_new_community_lock")
.resizable()
.renderingMode(.template)
.foregroundColor(.white)
.frame(width: 24, height: 24)
HStack(spacing: SodaSpacing.s6) {
Image("ic_bar_cash")
.resizable()
.renderingMode(.template)
.foregroundColor(.white)
.frame(width: 24, height: 24)
.frame(width: 20, height: 20)
HStack(spacing: SodaSpacing.s6) {
Image("ic_bar_cash")
.resizable()
.frame(width: 20, height: 20)
Text("\(notice.price)")
.appFont(.body2)
.foregroundColor(.black)
}
.padding(SodaSpacing.s8)
.background(Color.white)
.clipShape(Capsule())
Text("\(notice.price)")
.appFont(.body2)
.foregroundColor(.black)
}
.padding(SodaSpacing.s8)
.background(Color.white)
.clipShape(Capsule())
}
}
.buttonStyle(.plain)
.frame(width: 92, height: 92)
.clipShape(RoundedRectangle(cornerRadius: SodaSpacing.s14, style: .continuous))
}
private var reactionBar: some View {
HStack(spacing: 15) {
Button(action: onTapComment) {
Button(action: onTapDetail) {
HStack(spacing: SodaSpacing.s4) {
Image("ic_feed_community_reply")
.resizable()

View File

@@ -57,7 +57,10 @@ struct CreatorChannelHomeView: View {
onTapDonate: onTapDonate
)
CreatorChannelNoticeSection(notices: response.notices)
CreatorChannelNoticeSection(
notices: response.notices,
onTapDetail: onTapCommunityDetail
)
CreatorChannelScheduleSection(
schedules: response.schedules,