feat(content): 추천 전체보기를 연결한다

This commit is contained in:
Yu Sung
2026-07-07 11:54:31 +09:00
parent b33aed94c6
commit 981c02a8e1
18 changed files with 1169 additions and 294 deletions

View File

@@ -7,6 +7,7 @@ struct MainContentView: View {
let onTapContent: (Int) -> Void
let onTapBanner: (AudioBannerResponse) -> Void
let onTapSeries: (Int) -> Void
let onTapNewAndHotAll: () -> Void
@State private var selectedTab: MainContentTab = .recommendation
@StateObject private var allViewModel = MainContentAllViewModel()
@@ -45,7 +46,12 @@ struct MainContentView: View {
MainContentRecommendationView(
onTapContent: onTapContent,
onTapBanner: onTapBanner,
onTapSeries: onTapSeries
onTapSeries: onTapSeries,
onTapLatestAudioAll: { applyAllTab(type: .audio, sort: .latest) },
onTapNewAndHotAll: onTapNewAndHotAll,
onTapVoiceOnOnlyAll: { applyAllTab(type: .original, sort: .latest) },
onTapFreeAudioAll: { applyAllTab(type: .free, sort: .popular) },
onTapPointAudioAll: { applyAllTab(type: .point, sort: .popular) }
)
case .ranking:
MainContentRankingView(onTapContent: onTapContent)
@@ -57,6 +63,11 @@ struct MainContentView: View {
)
}
}
private func applyAllTab(type: MainContentAllType, sort: ContentSort) {
selectedTab = .all
allViewModel.apply(type: type, sort: sort)
}
}
struct MainContentView_Previews: PreviewProvider {
@@ -67,7 +78,8 @@ struct MainContentView_Previews: PreviewProvider {
onTapNotificationList: {},
onTapContent: { _ in },
onTapBanner: { _ in },
onTapSeries: { _ in }
onTapSeries: { _ in },
onTapNewAndHotAll: {}
)
}
}