feat(home): 팔로잉 탭 화면을 조립한다

This commit is contained in:
Yu Sung
2026-07-01 17:36:07 +09:00
parent 5b679389a6
commit f93e65372b
7 changed files with 175 additions and 35 deletions

View File

@@ -16,12 +16,12 @@ struct MainHomeFollowingNewsSection: View {
}
var body: some View {
if !recentNews.isEmpty {
if !renderableNews.isEmpty {
VStack(alignment: .leading, spacing: SodaSpacing.s14) {
SectionTitle(title: I18n.HomeFollowing.recentNewsTitle)
VStack(alignment: .leading, spacing: SodaSpacing.s8) {
ForEach(recentNews) { news in
ForEach(renderableNews) { news in
newsItemView(news)
}
}
@@ -30,6 +30,25 @@ struct MainHomeFollowingNewsSection: View {
}
}
private var renderableNews: [FollowingNewsResponse] {
recentNews.filter { news in
switch news.type {
case .creatorRanking:
return news.creatorRanking != nil
case .contentRanking:
return news.contentRanking != nil
case .communityPost:
return news.communityPost != nil
case .audioContent:
return news.audioContent != nil
case .photoContent:
return news.photoContent != nil
case .unknown:
return false
}
}
}
@ViewBuilder
private func newsItemView(_ news: FollowingNewsResponse) -> some View {
switch news.type {