패키지 폴더명 변경
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// CreatorCommunityCommentView.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 2023/12/15.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct CreatorCommunityCommentView: View {
|
||||
let commentCount: Int
|
||||
let commentList: [String]
|
||||
|
||||
let registerComment: (String) -> Void
|
||||
|
||||
@State private var comment = ""
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 11) {
|
||||
HStack(spacing: 5.3) {
|
||||
Text("댓글")
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.foregroundColor(.white)
|
||||
|
||||
Text("\(commentCount)")
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.foregroundColor(Color(hex: "909090"))
|
||||
|
||||
Spacer()
|
||||
}
|
||||
|
||||
HStack(spacing: 8) {
|
||||
Image("ic_place_holder")
|
||||
.resizable()
|
||||
.frame(width: 33.3, height: 33.3)
|
||||
.clipShape(Circle())
|
||||
|
||||
if commentCount > 0 {
|
||||
Text(commentList[0])
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.foregroundColor(Color(hex: "bbbbbb"))
|
||||
.lineLimit(1)
|
||||
.padding(.leading, 3)
|
||||
} else {
|
||||
HStack(spacing: 0) {
|
||||
TextField("댓글을 입력해 보세요.", text: $comment)
|
||||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(Color(hex: "eeeeee"))
|
||||
.accentColor(Color(hex: "3bb9f1"))
|
||||
.keyboardType(.default)
|
||||
.padding(.horizontal, 13.3)
|
||||
|
||||
Spacer()
|
||||
|
||||
Image("btn_message_send")
|
||||
.resizable()
|
||||
.frame(width: 35, height: 35)
|
||||
.padding(6.7)
|
||||
.onTapGesture {
|
||||
hideKeyboard()
|
||||
registerComment(comment)
|
||||
}
|
||||
}
|
||||
.background(Color(hex: "232323"))
|
||||
.cornerRadius(10)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 10)
|
||||
.strokeBorder(lineWidth: 1)
|
||||
.foregroundColor(Color(hex: "3bb9f1"))
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(11)
|
||||
.background(Color(hex: "ffffff").opacity(0.1))
|
||||
.cornerRadius(5.3)
|
||||
}
|
||||
}
|
||||
|
||||
struct CreatorCommunityCommentView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
CreatorCommunityCommentView(
|
||||
commentCount: 0,
|
||||
commentList: [
|
||||
"내용 읽어보니까 결혼해도 될것 같은데",
|
||||
"너무 조하유 앞으로도 좋은 라이브 많이 들려주세요"
|
||||
],
|
||||
registerComment: { _ in }
|
||||
)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user