Files
sodalive-ios/SodaLive/Sources/Content/Series/Content/SeriesContentListItemView.swift
Yu Sung 280e424385 커스텀 폰트 pretendard-medium, gmarket-medium를 사용하고 있던 것을 appFont 모디
파이어를 사용하여 한국어는 pretendard, 그 외에는 시스템 폰트를 사용하도록 수정
2026-01-23 03:09:20 +09:00

158 lines
5.2 KiB
Swift

//
// SeriesContentListItemView.swift
// SodaLive
//
// Created by klaus on 4/30/24.
//
import SwiftUI
import Kingfisher
struct SeriesContentListItemView: View {
let item: GetSeriesContentListItem
var body: some View {
VStack(spacing: 12) {
HStack(spacing: 11) {
KFImage(URL(string: item.coverImage))
.cancelOnDisappear(true)
.downsampling(size: CGSize(width: 66.7, height: 66.7))
.resizable()
.scaledToFill()
.frame(width: 66.7, height: 66.7)
.cornerRadius(5.3)
VStack(alignment: .leading, spacing: 2.7) {
HStack(spacing: 8) {
Text(item.duration)
.appFont(size: 10, weight: .medium)
.foregroundColor(Color.gray77)
.padding(2.7)
.background(Color.gray22)
.cornerRadius(2.6)
if item.isPointAvailable {
Text("포인트")
.appFont(size: 8, weight: .medium)
.foregroundColor(.white)
.padding(2.6)
.background(Color(hex: "7849bc"))
.cornerRadius(2.6)
}
}
Text(item.title)
.appFont(size: 12, weight: .medium)
.foregroundColor(Color.grayd2)
}
Spacer()
if item.isOwned {
Text("소장중")
.appFont(size: 13.3, weight: .medium)
.foregroundColor(Color.gray11)
.padding(.horizontal, 5.3)
.padding(.vertical, 2.7)
.background(Color(hex: "b1ef2c"))
.cornerRadius(2.6)
} else if item.isRented {
Text("대여중")
.appFont(size: 13.3, weight: .medium)
.foregroundColor(Color.white)
.padding(.horizontal, 5.3)
.padding(.vertical, 2.7)
.background(Color(hex: "660fd4"))
.cornerRadius(2.6)
} else if item.price > 0 {
HStack(spacing: 5.3) {
Image("ic_can")
Text("\(item.price)")
.appFont(size: 13.3, weight: .medium)
.foregroundColor(Color(hex: "909090"))
}
} else {
Text("무료")
.appFont(size: 13.3, weight: .medium)
.foregroundColor(Color.white)
.padding(.horizontal, 5.3)
.padding(.vertical, 2.7)
.background(Color(hex: "cf5c37"))
.cornerRadius(2.6)
}
}
Rectangle()
.foregroundColor(Color.gray59)
.frame(maxWidth: .infinity)
.frame(height: 0.5)
}
}
}
#Preview("무료") {
SeriesContentListItemView(
item: GetSeriesContentListItem(
contentId: 1,
title: "[무료] 두근두근 연애 연구부 EP1",
coverImage: "https://test-cf.sodalive.net/profile/default-profile.png",
releaseDate: "",
duration: "00:14:59",
price: 0,
isRented: false,
isOwned: false,
isPointAvailable: true
)
)
}
#Preview("유료") {
SeriesContentListItemView(
item: GetSeriesContentListItem(
contentId: 1,
title: "두근두근 연애 연구부 EP1",
coverImage: "https://test-cf.sodalive.net/profile/default-profile.png",
releaseDate: "",
duration: "00:14:59",
price: 100,
isRented: false,
isOwned: false,
isPointAvailable: true
)
)
}
#Preview("대여") {
SeriesContentListItemView(
item: GetSeriesContentListItem(
contentId: 1,
title: "두근두근 연애 연구부 EP1",
coverImage: "https://test-cf.sodalive.net/profile/default-profile.png",
releaseDate: "",
duration: "00:14:59",
price: 200,
isRented: true,
isOwned: false,
isPointAvailable: true
)
)
}
#Preview("소장") {
SeriesContentListItemView(
item: GetSeriesContentListItem(
contentId: 1,
title: "두근두근 연애 연구부 EP1",
coverImage: "https://test-cf.sodalive.net/profile/default-profile.png",
releaseDate: "",
duration: "00:14:59",
price: 300,
isRented: false,
isOwned: true,
isPointAvailable: true
)
)
}