콘텐츠 리스트 - 가격, 시간 추가

This commit is contained in:
Yu Sung
2024-02-14 16:11:06 +09:00
parent 7d0c472885
commit 20cce36c16
3 changed files with 53 additions and 6 deletions

View File

@@ -19,11 +19,54 @@ struct ContentNewAllItemView: View {
ContentDetailView(contentId: item.contentId)
} label: {
VStack(alignment: .leading, spacing: 8) {
KFImage(URL(string: item.coverImageUrl))
.resizable()
.scaledToFill()
.frame(width: width, height: width, alignment: .top)
.cornerRadius(2.7)
ZStack(alignment: .bottom) {
KFImage(URL(string: item.coverImageUrl))
.resizable()
.scaledToFill()
.frame(width: width, height: width, alignment: .top)
.cornerRadius(2.7)
VStack(spacing: 0) {
Spacer()
HStack(spacing: 0) {
HStack(spacing: 2) {
if item.price > 0 {
Image("ic_card_can_gray")
Text("\(item.price)")
.font(.custom(Font.medium.rawValue, size: 8.3))
.foregroundColor(Color.white)
} else {
Text("무료")
.font(.custom(Font.medium.rawValue, size: 8.3))
.foregroundColor(Color.white)
}
}
.padding(3)
.background(Color(hex: "333333").opacity(0.7))
.cornerRadius(10)
.padding(.leading, 2.7)
.padding(.bottom, 2.7)
Spacer()
HStack(spacing: 2) {
Image("ic_card_time_small_gray")
Text(item.duration)
.font(.custom(Font.medium.rawValue, size: 8.3))
.foregroundColor(Color.white)
}
.padding(3)
.background(Color(hex: "333333").opacity(0.7))
.cornerRadius(10)
.padding(.trailing, 2.7)
.padding(.bottom, 2.7)
}
}
}
.frame(width: width, height: width)
Text(item.title)
.font(.custom(Font.medium.rawValue, size: 13.3))