feat(content): 추천 전체보기를 연결한다
This commit is contained in:
@@ -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: {}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user