diff --git a/SodaLive/Sources/Content/Detail/ContentDetailPurchaseButton.swift b/SodaLive/Sources/Content/Detail/ContentDetailPurchaseButton.swift index 4937f8e..143aba8 100644 --- a/SodaLive/Sources/Content/Detail/ContentDetailPurchaseButton.swift +++ b/SodaLive/Sources/Content/Detail/ContentDetailPurchaseButton.swift @@ -33,7 +33,7 @@ struct ContentDetailPurchaseButton: View { } .frame(maxWidth: .infinity) .frame(height: 48.7) - .background(Color(hex: "9970ff")) + .background(Color.button) .cornerRadius(5.3) .padding(.top, 18.3) } diff --git a/SodaLive/Sources/Content/Detail/ContentDetailView.swift b/SodaLive/Sources/Content/Detail/ContentDetailView.swift index 4830ea6..4a19e0f 100644 --- a/SodaLive/Sources/Content/Detail/ContentDetailView.swift +++ b/SodaLive/Sources/Content/Detail/ContentDetailView.swift @@ -107,10 +107,29 @@ struct ContentDetailView: View { !audioContent.existOrdered && audioContent.orderType == nil && audioContent.creator.creatorId != UserDefaults.int(forKey: .userId) { - ContentDetailPurchaseButton(price: audioContent.price, isOnlyRental: audioContent.isOnlyRental) - .contentShape(Rectangle()) - .padding(.horizontal, 13.3) - .onTapGesture { isShowOrderView = true } + if let _ = audioContent.totalContentCount, let remainingContentCount = audioContent.remainingContentCount, remainingContentCount <= 0 { + Text("해당 콘텐츠가 매진되었습니다.") + .font(.custom(Font.bold.rawValue, size: 13.3)) + .foregroundColor(.white) + .frame(maxWidth: .infinity) + .frame(height: 48.7) + .background(Color(hex: "525252")) + .cornerRadius(5.3) + .padding(.top, 18.3) + .padding(.horizontal, 13.3) + } else { + ContentDetailPurchaseButton(price: audioContent.price, isOnlyRental: audioContent.isOnlyRental) + .contentShape(Rectangle()) + .padding(.horizontal, 13.3) + .onTapGesture { + if let _ = audioContent.totalContentCount, let _ = audioContent.remainingContentCount { + viewModel.orderType = .KEEP + isShowOrderConfirmView = true + } else { + isShowOrderView = true + } + } + } } if audioContent.isCommentAvailable {