From 5fc0f1789a3a96f4bdb9f27635fa9b7cd58a1ee5 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Tue, 4 Jun 2024 19:32:26 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BD=98=ED=85=90=EC=B8=A0=20=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20-=20=EC=86=8C=EC=9E=A5=EC=A4=91=20/=20?= =?UTF-8?q?=EB=8C=80=EC=97=AC=EC=A4=91=20/=20Sold=20Out=20=ED=91=9C?= =?UTF-8?q?=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Content/ContentListItemView.swift | 34 +++++++++++++++++-- .../Profile/GetCreatorProfileResponse.swift | 3 ++ .../Profile/UserProfileContentView.swift | 5 ++- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/SodaLive/Sources/Content/ContentListItemView.swift b/SodaLive/Sources/Content/ContentListItemView.swift index d9fc006..ed4306f 100644 --- a/SodaLive/Sources/Content/ContentListItemView.swift +++ b/SodaLive/Sources/Content/ContentListItemView.swift @@ -91,7 +91,34 @@ struct ContentListItemView: View { Spacer() - if item.price > 0 { + if item.isOwned { + Text("소장중") + .font(.custom(Font.medium.rawValue, size: 13.3)) + .foregroundColor(Color.gray11) + .padding(.horizontal, 5.3) + .padding(.vertical, 2.7) + .background(Color(hex: "b1ef2c")) + .cornerRadius(2.6) + } else if item.isRented { + Text("대여중") + .font(.custom(Font.medium.rawValue, size: 13.3)) + .foregroundColor(Color.white) + .padding(.horizontal, 5.3) + .padding(.vertical, 2.7) + .background(Color(hex: "660fd4")) + .cornerRadius(2.6) + } else if item.isSoldOut { + Text("Sold Out") + .font(.custom(Font.medium.rawValue, size: 13.3)) + .foregroundColor(Color.grayd2) + .padding(.horizontal, 5.3) + .padding(.vertical, 2.7) + .overlay( + RoundedRectangle(cornerRadius: 2.6) + .stroke(Color.grayd2, lineWidth: 1) + ) + .cornerRadius(2.6) + } else if item.price > 0 { HStack(spacing: 8) { Image("ic_can") .resizable() @@ -130,7 +157,10 @@ struct ContentListItemView_Previews: PreviewProvider { commentCount: 0, isPin: true, isAdult: false, - isScheduledToOpen: true + isScheduledToOpen: true, + isRented: false, + isOwned: false, + isSoldOut: true ) ) } diff --git a/SodaLive/Sources/Explorer/Profile/GetCreatorProfileResponse.swift b/SodaLive/Sources/Explorer/Profile/GetCreatorProfileResponse.swift index d8f71c5..632db8d 100644 --- a/SodaLive/Sources/Explorer/Profile/GetCreatorProfileResponse.swift +++ b/SodaLive/Sources/Explorer/Profile/GetCreatorProfileResponse.swift @@ -81,6 +81,9 @@ struct GetAudioContentListItem: Decodable { let isPin: Bool let isAdult: Bool let isScheduledToOpen: Bool + let isRented: Bool + let isOwned: Bool + let isSoldOut: Bool } struct GetCreatorActivitySummary: Decodable { diff --git a/SodaLive/Sources/Explorer/Profile/UserProfileContentView.swift b/SodaLive/Sources/Explorer/Profile/UserProfileContentView.swift index 35f0b3d..fede761 100644 --- a/SodaLive/Sources/Explorer/Profile/UserProfileContentView.swift +++ b/SodaLive/Sources/Explorer/Profile/UserProfileContentView.swift @@ -76,7 +76,10 @@ struct UserProfileContentView_Previews: PreviewProvider { commentCount: 0, isPin: true, isAdult: false, - isScheduledToOpen: false + isScheduledToOpen: false, + isRented: false, + isOwned: false, + isSoldOut: false ) ] )