지금 라이브 중 아이템 하단에 크리에이터가 설정한 언어와 관심사 1개 랜덤 표시
This commit is contained in:
@@ -23,91 +23,114 @@ struct LiveNowItemView: View {
|
|||||||
private var resolvedHeight: CGFloat {
|
private var resolvedHeight: CGFloat {
|
||||||
resolvedWidth * defaultHeight / defaultWidth
|
resolvedWidth * defaultHeight / defaultWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var tagsToShow: [String] {
|
||||||
|
Array(item.tags.prefix(2))
|
||||||
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack(alignment: .top) {
|
VStack(spacing: 8) {
|
||||||
HStack(spacing: 0) {
|
ZStack(alignment: .top) {
|
||||||
if item.isPrivateRoom {
|
HStack(spacing: 0) {
|
||||||
Image("ic_lock")
|
if item.isPrivateRoom {
|
||||||
.resizable()
|
Image("ic_lock")
|
||||||
.frame(width: 20, height: 20)
|
.resizable()
|
||||||
}
|
.frame(width: 20, height: 20)
|
||||||
|
|
||||||
Spacer()
|
|
||||||
}
|
|
||||||
|
|
||||||
VStack(spacing: 0) {
|
|
||||||
ZStack(alignment: .bottom) {
|
|
||||||
ZStack {
|
|
||||||
DownsampledKFImage(
|
|
||||||
url: URL(string: item.creatorProfileImage),
|
|
||||||
size: CGSize(width: 72, height: 72)
|
|
||||||
)
|
|
||||||
.clipShape(Circle())
|
|
||||||
}
|
|
||||||
.frame(width: 84, height: 84)
|
|
||||||
.overlay {
|
|
||||||
Circle()
|
|
||||||
.strokeBorder(lineWidth: 3)
|
|
||||||
.foregroundColor(.button)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Image("img_live")
|
Spacer()
|
||||||
.resizable()
|
|
||||||
.frame(width: 50, height: 18)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer()
|
VStack(spacing: 0) {
|
||||||
|
ZStack(alignment: .bottom) {
|
||||||
Text(item.creatorNickname)
|
ZStack {
|
||||||
.appFont(size: 16, weight: .regular)
|
DownsampledKFImage(
|
||||||
.foregroundColor(.white)
|
url: URL(string: item.creatorProfileImage),
|
||||||
.padding(.horizontal, 2)
|
size: CGSize(width: 72, height: 72)
|
||||||
|
)
|
||||||
Text(item.title)
|
.clipShape(Circle())
|
||||||
.appFont(size: 12, weight: .regular)
|
}
|
||||||
.foregroundColor(Color(hex: "#B0BEC5"))
|
.frame(width: 84, height: 84)
|
||||||
.lineLimit(1)
|
.overlay {
|
||||||
.truncationMode(.tail)
|
Circle()
|
||||||
.padding(.top, 4)
|
.strokeBorder(lineWidth: 3)
|
||||||
.padding(.horizontal, 2)
|
.foregroundColor(.button)
|
||||||
|
}
|
||||||
Spacer()
|
|
||||||
|
|
||||||
if item.price > 0 {
|
|
||||||
HStack(spacing: 2) {
|
|
||||||
Image("ic_can")
|
|
||||||
.resizable()
|
|
||||||
.scaledToFit()
|
|
||||||
.frame(width: 16)
|
|
||||||
|
|
||||||
Text("\(item.price)")
|
Image("img_live")
|
||||||
.appFont(size: 14, weight: .regular)
|
.resizable()
|
||||||
.foregroundColor(.white)
|
.frame(width: 50, height: 18)
|
||||||
}
|
}
|
||||||
.padding(.vertical, 4)
|
|
||||||
.frame(maxWidth: .infinity)
|
Spacer()
|
||||||
.background(Color(hex: "3b5ff1"))
|
|
||||||
.cornerRadius(999)
|
Text(item.creatorNickname)
|
||||||
.padding(.horizontal, 2)
|
.appFont(size: 16, weight: .regular)
|
||||||
.padding(.bottom, 2)
|
.foregroundColor(.white)
|
||||||
} else {
|
.padding(.horizontal, 2)
|
||||||
Text("무료")
|
|
||||||
.appFont(size: 14, weight: .regular)
|
Text(item.title)
|
||||||
.foregroundColor(Color(hex: "#263238"))
|
.appFont(size: 12, weight: .regular)
|
||||||
|
.foregroundColor(Color(hex: "#B0BEC5"))
|
||||||
|
.lineLimit(1)
|
||||||
|
.truncationMode(.tail)
|
||||||
|
.padding(.top, 4)
|
||||||
|
.padding(.horizontal, 2)
|
||||||
|
|
||||||
|
Spacer()
|
||||||
|
|
||||||
|
if item.price > 0 {
|
||||||
|
HStack(spacing: 2) {
|
||||||
|
Image("ic_can")
|
||||||
|
.resizable()
|
||||||
|
.scaledToFit()
|
||||||
|
.frame(width: 16)
|
||||||
|
|
||||||
|
Text("\(item.price)")
|
||||||
|
.appFont(size: 14, weight: .regular)
|
||||||
|
.foregroundColor(.white)
|
||||||
|
}
|
||||||
.padding(.vertical, 4)
|
.padding(.vertical, 4)
|
||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
.background(Color.white)
|
.background(Color(hex: "3b5ff1"))
|
||||||
.cornerRadius(999)
|
.cornerRadius(999)
|
||||||
.padding(.horizontal, 2)
|
.padding(.horizontal, 2)
|
||||||
.padding(.bottom, 2)
|
.padding(.bottom, 2)
|
||||||
|
} else {
|
||||||
|
Text("무료")
|
||||||
|
.appFont(size: 14, weight: .regular)
|
||||||
|
.foregroundColor(Color(hex: "#263238"))
|
||||||
|
.padding(.vertical, 4)
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
.background(Color.white)
|
||||||
|
.cornerRadius(999)
|
||||||
|
.padding(.horizontal, 2)
|
||||||
|
.padding(.bottom, 2)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.padding(10)
|
||||||
|
.frame(width: resolvedWidth, height: resolvedHeight, alignment: .top)
|
||||||
|
.background(Color(hex: "263238"))
|
||||||
|
.cornerRadius(16)
|
||||||
|
|
||||||
|
if !tagsToShow.isEmpty {
|
||||||
|
HStack(spacing: 4) {
|
||||||
|
ForEach(tagsToShow, id: \.self) { tag in
|
||||||
|
Text(tag)
|
||||||
|
.appFont(size: 12, weight: .regular)
|
||||||
|
.foregroundColor(.white)
|
||||||
|
.padding(.horizontal, 8)
|
||||||
|
.padding(.vertical, 4)
|
||||||
|
.background(Color(hex: "37474F"))
|
||||||
|
.cornerRadius(8)
|
||||||
|
}
|
||||||
|
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
|
.padding(.horizontal, 4)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.padding(10)
|
|
||||||
.frame(width: resolvedWidth, height: resolvedHeight, alignment: .top)
|
|
||||||
.background(Color(hex: "263238"))
|
|
||||||
.cornerRadius(16)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user