새로운 콘텐츠 전체보기 페이지 추가
This commit is contained in:
56
SodaLive/Sources/Content/All/ContentNewAllItemView.swift
Normal file
56
SodaLive/Sources/Content/All/ContentNewAllItemView.swift
Normal file
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// ContentNewAllItemView.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 2023/09/27.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Kingfisher
|
||||
|
||||
struct ContentNewAllItemView: View {
|
||||
|
||||
let item: GetAudioContentMainItem
|
||||
|
||||
@State var width: CGFloat = 0
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
ZStack(alignment: .topLeading) {
|
||||
KFImage(URL(string: item.coverImageUrl))
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.frame(width: width, height: width, alignment: .top)
|
||||
.cornerRadius(2.7)
|
||||
}
|
||||
|
||||
Text(item.title)
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(Color(hex: "d2d2d2"))
|
||||
.frame(width: width, alignment: .leading)
|
||||
.multilineTextAlignment(.leading)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.lineLimit(2)
|
||||
|
||||
HStack(spacing: 5.3) {
|
||||
KFImage(URL(string: item.creatorProfileImageUrl))
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.frame(width: 21.3, height: 21.3)
|
||||
.clipShape(Circle())
|
||||
.onTapGesture { AppState.shared.setAppStep(step: .creatorDetail(userId: item.creatorId)) }
|
||||
|
||||
Text(item.creatorNickname)
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.foregroundColor(Color(hex: "777777"))
|
||||
.lineLimit(1)
|
||||
}
|
||||
.padding(.bottom, 10)
|
||||
}
|
||||
.frame(width: width, alignment: .leading)
|
||||
.onTapGesture { AppState.shared.setAppStep(step: .contentDetail(contentId: item.contentId)) }
|
||||
.onAppear {
|
||||
width = (screenSize().width - 40) / 2
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user