feat(content): 추천 오디오 탭을 추가한다

This commit is contained in:
Yu Sung
2026-07-06 14:03:09 +09:00
parent f3cbf42328
commit b42ca61ce4
28 changed files with 1841 additions and 460 deletions

View File

@@ -172,7 +172,14 @@ struct MainView: View {
onTapFollowingSchedule: handleFollowingScheduleTap
)
case .content:
MainPlaceholderTabView(title: MainTab.content.title)
MainContentView(
onTapCanCharge: handleHomeCanChargeTap,
onTapSearch: handleHomeSearchTap,
onTapNotificationList: handleHomeNotificationListTap,
onTapContent: handleRecommendationContentTap,
onTapBanner: handleContentAudioBannerTap,
onTapSeries: handleContentOriginalSeriesTap
)
case .chat:
MainPlaceholderTabView(title: MainTab.chat.title)
case .my:
@@ -548,10 +555,45 @@ struct MainView: View {
openRecommendationBannerLink(item.link)
}
private func handleContentAudioBannerTap(_ item: AudioBannerResponse) {
if let eventItem = item.eventItem {
performRecommendationDetailAction {
appState.setAppStep(step: .eventDetail(event: eventItem))
}
return
}
if let creatorId = item.creatorId {
handleRecommendationCreatorTap(creatorId: creatorId)
return
}
if let seriesId = item.seriesId {
handleContentOriginalSeriesTap(seriesId: seriesId)
return
}
openRecommendationBannerLink(item.link)
}
private func handleContentOriginalSeriesTap(seriesId: Int) {
guard seriesId > 0 else { return }
performRecommendationDetailAction {
appState.setAppStep(step: .seriesDetail(seriesId: seriesId))
}
}
private func openRecommendationBannerLink(_ link: String?) {
guard let link = link?.trimmingCharacters(in: .whitespacesAndNewlines),
!link.isEmpty,
let url = URL(string: link),
!link.isEmpty else {
return
}
if AppDeepLinkHandler.handle(urlString: link) {
return
}
guard let url = URL(string: link),
UIApplication.shared.canOpenURL(url) else {
return
}