fix(main): 현재 라이브 전체보기를 보정한다
This commit is contained in:
@@ -14,117 +14,92 @@ struct LiveNowAllItemView: View {
|
||||
let itemWidth: CGFloat
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
ZStack {
|
||||
KFImage(URL(string: item.coverImageUrl))
|
||||
.cancelOnDisappear(true)
|
||||
.downsampling(
|
||||
size: CGSize(
|
||||
width: itemWidth,
|
||||
height: itemWidth * 144 / 102
|
||||
)
|
||||
)
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.frame(width: itemWidth, height: itemWidth * 144 / 102, alignment: .center)
|
||||
.cornerRadius(4.7)
|
||||
.clipped()
|
||||
|
||||
LinearGradient(
|
||||
colors: [Color.black.opacity(0.1), Color.black.opacity(0.8)],
|
||||
startPoint: .top,
|
||||
endPoint: .bottom
|
||||
)
|
||||
|
||||
VStack(alignment: .trailing, spacing: 0) {
|
||||
HStack(spacing: 0) {
|
||||
HStack(spacing: 1) {
|
||||
if item.price > 0 {
|
||||
Image("ic_can_white")
|
||||
}
|
||||
|
||||
Text(item.price > 0 ? "\(item.price)" : I18n.CreateContent.free)
|
||||
.appFont(size: 12, weight: .medium)
|
||||
.foregroundColor(Color.white)
|
||||
}
|
||||
.padding(.horizontal, 7.3)
|
||||
.padding(.vertical, 4)
|
||||
.background(item.price > 0 ? Color.mainRed3 : Color.gray11)
|
||||
.cornerRadius(13.3)
|
||||
|
||||
Spacer()
|
||||
|
||||
if item.isPrivateRoom {
|
||||
Image("ic_lock")
|
||||
.resizable()
|
||||
.frame(width: 20, height: 20)
|
||||
.padding(2.7)
|
||||
.background(Color.gray33.opacity(0.7))
|
||||
.clipShape(Circle())
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 3.3)
|
||||
.padding(.top, 3.3)
|
||||
|
||||
Spacer()
|
||||
|
||||
if item.numberOfPeople - item.numberOfParticipate < 3 {
|
||||
HStack(spacing: 0) {
|
||||
Spacer()
|
||||
|
||||
HStack(spacing: 2) {
|
||||
Text(I18n.LiveNow.remaining)
|
||||
.appFont(size: 12, weight: .medium)
|
||||
.foregroundColor(Color.grayee)
|
||||
|
||||
Text("\(item.numberOfPeople - item.numberOfParticipate)")
|
||||
.appFont(size: 12, weight: .medium)
|
||||
.foregroundColor(Color.button)
|
||||
}
|
||||
.padding(.horizontal, 4)
|
||||
.padding(.vertical, 3)
|
||||
.background(Color.gray33.opacity(0.7))
|
||||
.cornerRadius(13.3)
|
||||
}
|
||||
.padding(.horizontal, 3.3)
|
||||
.padding(.bottom, 3.3)
|
||||
}
|
||||
HStack(alignment: .center, spacing: 14) {
|
||||
KFImage(URL(string: item.creatorProfileImage))
|
||||
.cancelOnDisappear(true)
|
||||
.downsampling(size: CGSize(width: 75, height: 75))
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.frame(width: 75, height: 75)
|
||||
.clipShape(Circle())
|
||||
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
HStack(spacing: 8) {
|
||||
liveTag
|
||||
|
||||
Text(startTimeText)
|
||||
.appFont(size: 14, weight: .regular)
|
||||
.foregroundColor(Color.gray500)
|
||||
}
|
||||
|
||||
Text(item.title)
|
||||
.appFont(size: 18, weight: .bold)
|
||||
.foregroundColor(.white)
|
||||
.lineLimit(1)
|
||||
.truncationMode(.tail)
|
||||
|
||||
Text(item.creatorNickname)
|
||||
.appFont(size: 14, weight: .regular)
|
||||
.foregroundColor(Color.gray500)
|
||||
.lineLimit(1)
|
||||
.truncationMode(.tail)
|
||||
}
|
||||
.frame(width: itemWidth, height: itemWidth * 144 / 102)
|
||||
|
||||
Text("\(item.title)")
|
||||
.appFont(size: 12, weight: .medium)
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
.lineLimit(2)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
|
||||
if item.tags.count > 0 {
|
||||
Text("\(item.tags.map { "#\($0)" }.joined(separator: " "))")
|
||||
.appFont(size: 11, weight: .medium)
|
||||
.foregroundColor(Color.button)
|
||||
}
|
||||
|
||||
HStack(spacing: 5.3) {
|
||||
KFImage(URL(string: item.creatorProfileImage))
|
||||
.cancelOnDisappear(true)
|
||||
.downsampling(
|
||||
size: CGSize(
|
||||
width: 21.3,
|
||||
height: 21.3
|
||||
)
|
||||
)
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.frame(width: 21.3, height: 21.3, alignment: .center)
|
||||
.clipShape(Circle())
|
||||
|
||||
Text("\(item.creatorNickname)")
|
||||
.appFont(size: 10, weight: .medium)
|
||||
.foregroundColor(Color.gray77)
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
|
||||
priceView
|
||||
}
|
||||
.frame(width: itemWidth)
|
||||
.frame(width: itemWidth, height: 99)
|
||||
}
|
||||
|
||||
private var liveTag: some View {
|
||||
HStack(spacing: 4) {
|
||||
Circle()
|
||||
.fill(Color.red400)
|
||||
.frame(width: 8, height: 8)
|
||||
|
||||
Text("LIVE")
|
||||
.appFont(size: 12, weight: .regular)
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
.padding(.horizontal, 4)
|
||||
.padding(.vertical, 2)
|
||||
.frame(height: 18)
|
||||
.background(Color.black)
|
||||
.clipShape(Capsule())
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var priceView: some View {
|
||||
if item.price > 0 {
|
||||
HStack(spacing: 2) {
|
||||
Image("ic_bar_cash")
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.frame(width: 18, height: 18)
|
||||
|
||||
Text("\(item.price)")
|
||||
.appFont(size: 14, weight: .regular)
|
||||
.foregroundColor(.white)
|
||||
.lineLimit(1)
|
||||
}
|
||||
.padding(.trailing, 7)
|
||||
.frame(width: 60, alignment: .trailing)
|
||||
} else {
|
||||
Text(I18n.CreateContent.free)
|
||||
.appFont(size: 14, weight: .regular)
|
||||
.foregroundColor(.white)
|
||||
.lineLimit(1)
|
||||
.padding(.trailing, 7)
|
||||
.frame(width: 60, alignment: .trailing)
|
||||
}
|
||||
}
|
||||
|
||||
private var startTimeText: String {
|
||||
guard let date = DateParser.parse(item.beginDateTimeUtc) else {
|
||||
return item.beginDateTimeUtc
|
||||
}
|
||||
|
||||
return date.convertDateFormat(dateFormat: "HH:mm")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user