콘텐츠 메인, 콘텐츠 업로드 페이지 추가

This commit is contained in:
Yu Sung
2023-08-11 08:47:10 +09:00
parent 64b0380671
commit a167840162
33 changed files with 2190 additions and 1 deletions

View File

@@ -0,0 +1,78 @@
//
// ContentMainItemView.swift
// SodaLive
//
// Created by klaus on 2023/08/11.
//
import SwiftUI
import Kingfisher
struct ContentMainItemView: View {
let item: GetAudioContentMainItem
var body: some View {
VStack(alignment: .leading, spacing: 8) {
ZStack(alignment: .topLeading) {
KFImage(URL(string: item.coverImageUrl))
.resizable()
.scaledToFill()
.frame(width: 133.3, height: 133.3, alignment: .top)
.cornerRadius(2.7)
if item.isAdult {
Text("19")
.font(.custom(Font.bold.rawValue, size: 11.3))
.foregroundColor(Color.white)
.padding(4)
.background(Color(hex: "e53621"))
.clipShape(Circle())
.padding(.top, 4.3)
.padding(.leading, 4.3)
}
}
Text(item.title)
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "d2d2d2"))
.frame(width: 133.3, 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 { }
Text(item.creatorNickname)
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(Color(hex: "777777"))
.lineLimit(1)
}
.padding(.bottom, 10)
}
.frame(width: 133.3, alignment: .leading)
.onTapGesture { }
}
}
struct ContentMainItemView_Previews: PreviewProvider {
static var previews: some View {
ContentMainItemView(
item: GetAudioContentMainItem(
contentId: 2,
coverImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
title: "ㅓ처랴햐햫햐햐",
isAdult: true,
creatorId: 8,
creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
creatorNickname: "유저2"
)
)
}
}