응원글 전체보기 - 응원글 삭제기능 추가
This commit is contained in:
@@ -14,6 +14,7 @@ struct UserProfileFanTalkAllView: View {
|
||||
@StateObject var viewModel = UserProfileFanTalkViewModel()
|
||||
|
||||
@State private var cheersContent: String = ""
|
||||
@State private var cheersId: Int = 0
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { proxy in
|
||||
@@ -86,13 +87,16 @@ struct UserProfileFanTalkAllView: View {
|
||||
viewModel.writeCheersReply(parentCheersId: cheer.cheersId, creatorId: userId, cheersReplyContent: cheersReplyContent)
|
||||
},
|
||||
modifyCheer: { cheersId, cheersReplyContent in
|
||||
viewModel.modifyCheers(cheersId: cheersId, creatorId: userId, cheersReplyContent: cheersReplyContent)
|
||||
viewModel.modifyCheers(cheersId: cheersId, creatorId: userId, cheersContent: cheersReplyContent)
|
||||
},
|
||||
reportPopup: { cheersId in
|
||||
viewModel.reportCheersId = cheersId
|
||||
viewModel.isShowCheersReportMenu = true
|
||||
viewModel.isShowCheersReportView = true
|
||||
},
|
||||
onClickDelete: { _ in }
|
||||
onClickDelete: { cheersId in
|
||||
self.cheersId = cheersId
|
||||
viewModel.isShowCheersDeleteView = true
|
||||
}
|
||||
)
|
||||
.onAppear {
|
||||
if index == viewModel.cheersList.count - 1 {
|
||||
@@ -142,22 +146,6 @@ struct UserProfileFanTalkAllView: View {
|
||||
}
|
||||
|
||||
ZStack {
|
||||
if viewModel.isShowCheersReportMenu {
|
||||
VStack(spacing: 0) {
|
||||
CheersReportMenuView(
|
||||
isShowing: $viewModel.isShowCheersReportMenu,
|
||||
onClickReport: { viewModel.isShowCheersReportView = true }
|
||||
)
|
||||
|
||||
if proxy.safeAreaInsets.bottom > 0 {
|
||||
Rectangle()
|
||||
.foregroundColor(Color(hex: "222222"))
|
||||
.frame(width: proxy.size.width, height: 15.3)
|
||||
}
|
||||
}
|
||||
.ignoresSafeArea()
|
||||
}
|
||||
|
||||
if viewModel.isShowCheersReportView {
|
||||
CheersReportDialogView(
|
||||
isShowing: $viewModel.isShowCheersReportView,
|
||||
@@ -166,6 +154,23 @@ struct UserProfileFanTalkAllView: View {
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
if viewModel.isShowCheersDeleteView {
|
||||
if viewModel.isShowCheersDeleteView {
|
||||
SodaDialog(
|
||||
title: "응원글 삭제",
|
||||
desc: "삭제하시겠습니까?",
|
||||
confirmButtonTitle: "삭제",
|
||||
confirmButtonAction: {
|
||||
viewModel.modifyCheers(cheersId: cheersId, creatorId: userId, isActive: false)
|
||||
viewModel.isShowCheersDeleteView = false
|
||||
self.cheersId = 0
|
||||
},
|
||||
cancelButtonTitle: "취소",
|
||||
cancelButtonAction: { viewModel.isShowCheersDeleteView = false }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user