커뮤니티 게시물 등록 API 적용,

채널 프로필 API - 커뮤니티 게시물 추가
This commit is contained in:
Yu Sung
2023-12-20 00:10:16 +09:00
parent d393bb8f8b
commit d829399b05
15 changed files with 412 additions and 56 deletions

View File

@@ -6,29 +6,33 @@
//
import SwiftUI
import Kingfisher
struct CreatorCommunityItemView: View {
let item: GetCommunityPostListResponse
var body: some View {
VStack(alignment: .leading, spacing: 8) {
HStack(spacing: 11) {
Image("ic_place_holder")
KFImage(URL(string: item.creatorProfileUrl))
.resizable()
.frame(width: 40, height: 40)
.clipShape(Circle())
Text("민하나")
Text(item.creatorNickname)
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee"))
Spacer()
Text("1일")
Text(item.date)
.font(.custom(Font.light.rawValue, size: 13.3))
.foregroundColor(Color(hex: "777777"))
}
HStack(spacing: 0) {
Text("너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!너무 조하유 앞으로도 좋은 라이브 많이 들려주세요!")
Text(item.content)
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(Color(hex: "bbbbbb"))
.fixedSize(horizontal: false, vertical: true)
@@ -36,10 +40,12 @@ struct CreatorCommunityItemView: View {
Spacer()
Image("btn_plus_round_rect")
.resizable()
.frame(width: 53.3, height: 53.3)
.cornerRadius(4.7)
if let imageUrl = item.imageUrl {
KFImage(URL(string: imageUrl))
.resizable()
.frame(width: 53.3, height: 53.3)
.cornerRadius(4.7)
}
}
HStack(spacing: 13.3) {
@@ -48,7 +54,7 @@ struct CreatorCommunityItemView: View {
.resizable()
.frame(width: 13.3, height: 13.3)
Text("7,680")
Text("\(item.likeCount)")
.font(.custom(Font.medium.rawValue, size: 11))
.foregroundColor(Color(hex: "777777"))
}
@@ -58,7 +64,7 @@ struct CreatorCommunityItemView: View {
.resizable()
.frame(width: 13.3, height: 13.3)
Text("150")
Text("\(item.commentCount)")
.font(.custom(Font.medium.rawValue, size: 11))
.foregroundColor(Color(hex: "777777"))
}
@@ -73,6 +79,18 @@ struct CreatorCommunityItemView: View {
struct CreatorCommunityItemView_Previews: PreviewProvider {
static var previews: some View {
CreatorCommunityItemView()
CreatorCommunityItemView(
item: GetCommunityPostListResponse(
creatorNickname: "민하나",
creatorProfileUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
imageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
content: "안녕하세요",
date: "3일전",
isLike: false,
likeCount: 10,
commentCount: 0,
firstComment: nil
)
)
}
}