커뮤니티 댓글, 팬토크, 콘텐츠 댓글

- 프로필 이미지 터치시 차단, 신고가 가능한 유저 프로필 표시
This commit is contained in:
Yu Sung
2024-09-07 03:58:52 +09:00
parent 17ead38524
commit 7c5b30335e
15 changed files with 537 additions and 53 deletions

View File

@@ -17,6 +17,7 @@ struct CreatorCommunityCommentItemView: View {
let modifyComment: (Int, String) -> Void
let onClickDelete: (Int) -> Void
let onClickProfile: (Int) -> Void
@State var isShowPopupMenu: Bool = false
@State var isModeModify: Bool = false
@@ -30,6 +31,11 @@ struct CreatorCommunityCommentItemView: View {
.resizable()
.frame(width: 40, height: 40)
.clipShape(Circle())
.onTapGesture {
if UserDefaults.int(forKey: .userId) != commentItem.writerId {
onClickProfile(commentItem.writerId)
}
}
VStack(alignment: .leading, spacing: 0) {
Text(commentItem.nickname)
@@ -38,7 +44,7 @@ struct CreatorCommunityCommentItemView: View {
Text(commentItem.date)
.font(.custom(Font.medium.rawValue, size: 10.3))
.foregroundColor(Color(hex: "525252"))
.foregroundColor(Color.gray52)
.padding(.top, 4)
}
@@ -57,8 +63,8 @@ struct CreatorCommunityCommentItemView: View {
.autocapitalization(.none)
.disableAutocorrection(true)
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee"))
.accentColor(Color(hex: "3bb9f1"))
.foregroundColor(Color.grayee)
.accentColor(Color.button)
.keyboardType(.default)
.padding(.horizontal, 13.3)

View File

@@ -17,6 +17,10 @@ struct CreatorCommunityCommentListView: View {
@State private var commentId: Int = 0
@State private var isShowDeletePopup: Bool = false
@State private var memberId: Int = 0
@State private var isShowMemberProfilePopup: Bool = false
@StateObject var viewModel = CreatorCommunityCommentListViewModel()
var body: some View {
@@ -115,6 +119,10 @@ struct CreatorCommunityCommentListView: View {
onClickDelete: {
commentId = $0
isShowDeletePopup = true
},
onClickProfile: {
memberId = $0
isShowMemberProfilePopup = true
}
)
.padding(.horizontal, 26.7)
@@ -147,6 +155,10 @@ struct CreatorCommunityCommentListView: View {
)
}
if isShowMemberProfilePopup {
MemberProfileDialog(isShowing: $isShowMemberProfilePopup, memberId: memberId)
}
if viewModel.isLoading {
LoadingView()
}

View File

@@ -20,6 +20,9 @@ struct CreatorCommunityCommentReplyView: View {
@State private var commentId: Int = 0
@State private var isShowDeletePopup: Bool = false
@State private var memberId: Int = 0
@State private var isShowMemberProfilePopup: Bool = false
var body: some View {
ZStack {
VStack(spacing: 0) {
@@ -98,7 +101,11 @@ struct CreatorCommunityCommentReplyView: View {
isReplyComment: true,
isShowPopupMenuButton: false,
modifyComment: { _, _ in },
onClickDelete: { _ in }
onClickDelete: { _ in },
onClickProfile: {
memberId = $0
isShowMemberProfilePopup = true
}
)
.padding(.horizontal, 26.7)
.padding(.bottom, 13.3)
@@ -120,6 +127,10 @@ struct CreatorCommunityCommentReplyView: View {
onClickDelete: {
commentId = $0
isShowDeletePopup = true
},
onClickProfile: {
memberId = $0
isShowMemberProfilePopup = true
}
)
.padding(.horizontal, 26.7)
@@ -154,6 +165,10 @@ struct CreatorCommunityCommentReplyView: View {
)
}
if isShowMemberProfilePopup {
MemberProfileDialog(isShowing: $isShowMemberProfilePopup, memberId: memberId)
}
if viewModel.isLoading {
LoadingView()
}