diff --git a/SodaLive/Sources/Content/Detail/ContentDetailInfoLimitedEditionView.swift b/SodaLive/Sources/Content/Detail/ContentDetailInfoLimitedEditionView.swift index d94951d..a01ce27 100644 --- a/SodaLive/Sources/Content/Detail/ContentDetailInfoLimitedEditionView.swift +++ b/SodaLive/Sources/Content/Detail/ContentDetailInfoLimitedEditionView.swift @@ -36,6 +36,17 @@ struct ContentDetailInfoLimitedEditionView: View { .font(.custom(Font.medium.rawValue, size: 13.3)) .foregroundColor(Color.grayd2) .padding(.leading, 2.3) + } else if (remainingContentCount <= 0) { + Text("Sold Out") + .font(.custom(Font.medium.rawValue, size: 12)) + .foregroundColor(Color.grayd2) + .padding(.horizontal, 5.3) + .padding(.vertical, 3.3) + .overlay( + RoundedRectangle(cornerRadius: 2.6) + .stroke(lineWidth: 1) + .foregroundColor(Color.grayd2) + ) } else { Text("잔여수량") .font(.custom(Font.medium.rawValue, size: 13.3)) @@ -59,7 +70,7 @@ struct ContentDetailInfoLimitedEditionView: View { #Preview { ContentDetailInfoLimitedEditionView( totalContentCount: 10, - remainingContentCount: 3, - orderSequence: 5 + remainingContentCount: 0, + orderSequence: nil ) } diff --git a/SodaLive/Sources/Content/Detail/ContentDetailPlayView.swift b/SodaLive/Sources/Content/Detail/ContentDetailPlayView.swift index 09df67a..7de22ee 100644 --- a/SodaLive/Sources/Content/Detail/ContentDetailPlayView.swift +++ b/SodaLive/Sources/Content/Detail/ContentDetailPlayView.swift @@ -35,7 +35,17 @@ struct ContentDetailPlayView: View { ) .cornerRadius(10.7, corners: [.topLeft, .topRight]) - if audioContent.releaseDate == nil && !isAlertPreview || (isAlertPreview && audioContent.isActivePreview) { + if let _ = audioContent.totalContentCount, let remainingContentCount = audioContent.remainingContentCount, remainingContentCount <= 0, audioContent.creator.creatorId != UserDefaults.int(forKey: .userId), !isShowPreviewAlert { + Text("Sold Out") + .font(.custom(Font.bold.rawValue, size: 36.7)) + .foregroundColor(.white) + .frame( + width: screenSize().width - 26.7, + height: screenSize().width - 26.7, + alignment: .center + ) + .background(Color.black.opacity(0.6)) + } else if audioContent.releaseDate == nil && !isAlertPreview || (audioContent.isActivePreview && !audioContent.contentUrl.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty) { Image(isPlaying() ? "btn_audio_content_pause" : isAlertPreview ? "btn_audio_content_preview_play" : "btn_audio_content_play") .onTapGesture { if isPlaying() { @@ -56,7 +66,7 @@ struct ContentDetailPlayView: View { isShowPreviewAlert = true } } - } else { + } else if audioContent.releaseDate == nil { Text("해당 콘텐츠는 크리에이터의 요청으로\n미리듣기를 제공하지 않습니다.") .font(.custom(Font.medium.rawValue, size: 16.7)) .foregroundColor(Color.grayee)