콘텐츠 상세 - 콘텐츠 고정/해제 기능 추가
This commit is contained in:
@@ -219,7 +219,19 @@ struct ContentDetailView: View {
|
||||
VStack(spacing: 0) {
|
||||
ContentDetailMenuView(
|
||||
isShowing: $viewModel.isShowReportMenu,
|
||||
isPin: viewModel.audioContent!.isPin,
|
||||
isShowCreatorMenu: viewModel.audioContent!.creator.creatorId == UserDefaults.int(forKey: .userId),
|
||||
pinAction: {
|
||||
if viewModel.audioContent!.isPin {
|
||||
viewModel.unpinContent(contentId: contentId)
|
||||
} else {
|
||||
if viewModel.audioContent!.isAvailablePin {
|
||||
viewModel.pinContent(contentId: contentId)
|
||||
} else {
|
||||
viewModel.isShowNoticePinContentPopup = true
|
||||
}
|
||||
}
|
||||
},
|
||||
modifyAction: {
|
||||
if viewModel.audioContent!.creator.creatorId == UserDefaults.int(forKey: .userId) {
|
||||
AppState
|
||||
@@ -284,6 +296,21 @@ struct ContentDetailView: View {
|
||||
viewModel.donation(can: can, comment: comment)
|
||||
}
|
||||
}
|
||||
|
||||
if viewModel.isShowNoticePinContentPopup {
|
||||
SodaDialog(
|
||||
title: "고정 한도 도달",
|
||||
desc: "이 콘텐츠를 고정하시겠어요? " +
|
||||
"채널에 콘텐츠를 최대 3개까지 고정할 수 있습니다." +
|
||||
"이 콘텐츠를 고정하면 가장 오래된 콘텐츠가 대체됩니다.",
|
||||
confirmButtonTitle: "확인",
|
||||
confirmButtonAction: {
|
||||
viewModel.pinContent(contentId: contentId)
|
||||
},
|
||||
cancelButtonTitle: "취소",
|
||||
cancelButtonAction: {}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
.sheet(
|
||||
|
Reference in New Issue
Block a user