재생 목록 상세
- 삭제 기능 추가
This commit is contained in:
@@ -15,6 +15,9 @@ struct ContentPlaylistDetailView: View {
|
||||
@Binding var isShowing: Bool
|
||||
@Binding var reloadData: Bool
|
||||
|
||||
@State private var isShowPopupMenu = false
|
||||
@State private var isShowDeleteConfirm = false
|
||||
|
||||
var body: some View {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
VStack(spacing: 21.3) {
|
||||
@@ -37,6 +40,7 @@ struct ContentPlaylistDetailView: View {
|
||||
Image("ic_seemore_vertical_white")
|
||||
.padding(8)
|
||||
.onTapGesture {
|
||||
isShowPopupMenu = true
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 13.3)
|
||||
@@ -184,6 +188,61 @@ struct ContentPlaylistDetailView: View {
|
||||
.onAppear {
|
||||
viewModel.playlistId = playlistId
|
||||
}
|
||||
|
||||
if isShowPopupMenu {
|
||||
ZStack {
|
||||
Color.black
|
||||
.opacity(0.7)
|
||||
.ignoresSafeArea()
|
||||
.onTapGesture { isShowPopupMenu = false }
|
||||
|
||||
VStack(spacing: 0) {
|
||||
Spacer()
|
||||
|
||||
HStack(spacing: 13.3) {
|
||||
Text("삭제")
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(Color.grayee)
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.padding(.vertical, 8)
|
||||
.padding(.horizontal, 26.7)
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
isShowPopupMenu = false
|
||||
isShowDeleteConfirm = true
|
||||
}
|
||||
.padding(24)
|
||||
.background(Color.gray22)
|
||||
.cornerRadius(13.3, corners: [.topLeft, .topRight])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if isShowDeleteConfirm {
|
||||
ZStack {
|
||||
Color.black
|
||||
.opacity(0.7)
|
||||
.ignoresSafeArea()
|
||||
.onTapGesture { isShowDeleteConfirm = false }
|
||||
|
||||
SodaDialog(
|
||||
title: "재생 목록 삭제",
|
||||
desc: viewModel.response != nil ? "\(viewModel.response!.title)을 삭제하시겠습니까?" : "삭제하시겠습니까?",
|
||||
confirmButtonTitle: "삭제",
|
||||
confirmButtonAction: {
|
||||
isShowDeleteConfirm = false
|
||||
viewModel.deletePlaylist {
|
||||
reloadData = true
|
||||
isShowing = false
|
||||
}
|
||||
},
|
||||
cancelButtonTitle: "취소",
|
||||
cancelButtonAction: { isShowDeleteConfirm = false }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user