fix(main): 최근 활동 이동을 보정한다
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user