fix(creator): 팬Talk 액션 팝업을 정리한다

This commit is contained in:
Yu Sung
2026-07-07 15:44:45 +09:00
parent 75aa99768e
commit f2d589eca2
8 changed files with 170 additions and 78 deletions

View File

@@ -7,33 +7,13 @@ struct CreatorChannelReplyDetailActionPopup: View {
let onTapDelete: () -> Void
var body: some View {
VStack(alignment: .leading, spacing: 0) {
if canEdit {
actionButton(title: I18n.Explorer.edit, action: onTapEdit)
}
if canDelete {
actionButton(title: I18n.Common.delete, action: onTapDelete)
}
}
.background(Color.gray900)
.cornerRadius(14)
.overlay(
RoundedRectangle(cornerRadius: 14, style: .continuous)
.stroke(Color.gray700, lineWidth: 1)
CreatorChannelActionPopup(
canEdit: canEdit,
canDelete: canDelete,
onTapEdit: onTapEdit,
onTapDelete: onTapDelete,
editTitle: I18n.Explorer.editAction,
deleteTitle: I18n.Explorer.deleteAction
)
}
private func actionButton(title: String, action: @escaping () -> Void) -> some View {
Button(action: action) {
Text(title)
.appFont(size: 14, weight: .medium)
.foregroundColor(.white)
.lineLimit(1)
.frame(minWidth: 80, alignment: .leading)
.padding(.horizontal, SodaSpacing.s12)
.padding(.vertical, SodaSpacing.s8)
}
.buttonStyle(.plain)
}
}

View File

@@ -45,17 +45,18 @@ struct CreatorChannelReplyDetailView: View {
}
if viewModel.isShowDeleteDialog {
SodaDialog(
SodaV2ActionModal(
title: I18n.Common.commentDeleteTitle,
desc: I18n.Common.confirmDeleteQuestion,
confirmButtonTitle: I18n.Common.delete,
confirmButtonAction: viewModel.confirmDelete,
cancelButtonTitle: I18n.Common.cancel,
cancelButtonAction: {
viewModel.isShowDeleteDialog = false
viewModel.deletingItem = nil
},
textAlignment: .center
message: I18n.Common.confirmDeleteQuestion,
button1: SodaV2ActionModalButton(
label: I18n.Common.delete,
action: viewModel.confirmDelete
),
button2: SodaV2ActionModalButton(
label: I18n.Common.cancel,
action: dismissDeleteDialog
),
onDimmedTap: dismissDeleteDialog
)
}
}
@@ -65,4 +66,9 @@ struct CreatorChannelReplyDetailView: View {
}
.sodaToast(isPresented: $viewModel.isShowPopup, message: viewModel.errorMessage, autohideIn: 1)
}
private func dismissDeleteDialog() {
viewModel.isShowDeleteDialog = false
viewModel.deletingItem = nil
}
}