fix(main): 최근 활동 이동을 보정한다

This commit is contained in:
Yu Sung
2026-07-30 16:13:32 +09:00
parent 0232cd4335
commit 3ae2dc19d6
7 changed files with 350 additions and 14 deletions

View File

@@ -27,6 +27,7 @@ struct RecommendationBannerResponse: Decodable, Hashable {
}
struct HomeActiveCreatorItem: Decodable, Hashable {
let creatorId: Int
let creatorNickname: String
let creatorProfileImage: String
let activityType: RecommendedActivityType
@@ -34,6 +35,32 @@ struct HomeActiveCreatorItem: Decodable, Hashable {
let targetId: Int?
}
enum HomeActiveCreatorTapDestination: Equatable {
case live(Int)
case creator(Int)
case content(Int)
case communityPost(Int)
}
extension HomeActiveCreatorItem {
var activeCreatorTapDestination: HomeActiveCreatorTapDestination? {
switch activityType {
case .live:
if let targetId {
return .live(targetId)
}
return creatorId > 0 ? .creator(creatorId) : nil
case .liveReplay, .audio:
return targetId.map(HomeActiveCreatorTapDestination.content)
case .community:
return targetId.map(HomeActiveCreatorTapDestination.communityPost)
case .unknown:
return nil
}
}
}
struct HomeCreatorItem: Decodable, Hashable {
let creatorId: Int
let creatorNickname: String