feat(home): 포인트 대여 콘텐츠 섹션 추가
This commit is contained in:
@@ -19,5 +19,6 @@ struct GetHomeResponse: Decodable {
|
||||
let contentRanking: [GetAudioContentRankingItem]
|
||||
let recommendChannelList: [RecommendChannelResponse]
|
||||
let freeContentList: [AudioContentMainItem]
|
||||
let pointAvailableContentList: [AudioContentMainItem]
|
||||
let curationList: [GetContentCurationResponse]
|
||||
}
|
||||
|
||||
@@ -303,6 +303,30 @@ struct HomeTabView: View {
|
||||
}
|
||||
}
|
||||
|
||||
if !viewModel.pointAvailableContentList.isEmpty {
|
||||
VStack(alignment: .leading, spacing: 16) {
|
||||
HStack(spacing: 0) {
|
||||
Text("포인트")
|
||||
.font(.custom(Font.preBold.rawValue, size: 24))
|
||||
.foregroundColor(.button)
|
||||
|
||||
Text(" 대여 콘텐츠")
|
||||
.font(.custom(Font.preBold.rawValue, size: 24))
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
.padding(.horizontal, 24)
|
||||
|
||||
ScrollView(.horizontal, showsIndicators: false) {
|
||||
LazyHStack(spacing: 16) {
|
||||
ForEach(0..<viewModel.pointAvailableContentList.count, id: \.self) { index in
|
||||
ContentItemView(item: viewModel.pointAvailableContentList[index])
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 24)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !viewModel.curationList.isEmpty {
|
||||
ForEach(0..<viewModel.curationList.count, id: \.self) { curationIndex in
|
||||
let curation = viewModel.curationList[curationIndex]
|
||||
|
||||
@@ -32,6 +32,7 @@ final class HomeTabViewModel: ObservableObject {
|
||||
@Published var contentRanking: [GetAudioContentRankingItem] = []
|
||||
@Published var recommendChannelList: [RecommendChannelResponse] = []
|
||||
@Published var freeContentList: [AudioContentMainItem] = []
|
||||
@Published var pointAvailableContentList: [AudioContentMainItem] = []
|
||||
@Published var curationList: [GetContentCurationResponse] = []
|
||||
|
||||
func fetchData() {
|
||||
@@ -64,6 +65,7 @@ final class HomeTabViewModel: ObservableObject {
|
||||
self.contentRanking = data.contentRanking
|
||||
self.recommendChannelList = data.recommendChannelList
|
||||
self.freeContentList = data.freeContentList
|
||||
self.pointAvailableContentList = data.pointAvailableContentList
|
||||
self.curationList = data.curationList
|
||||
} else {
|
||||
if let message = decoded.message {
|
||||
|
||||
Reference in New Issue
Block a user