From e5af4167f87cba97e9219e70ee44be5e36e27968 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Thu, 14 Dec 2023 18:35:43 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C=20=ED=83=AD=20-=20?= =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C=20=EC=A4=91=20=EC=95=84=EC=9D=B4?= =?UTF-8?q?=ED=85=9C=20UI=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Live/GetRoomListResponse.swift | 1 + .../Sources/Live/Now/LiveNowItemView.swift | 123 +++++++++++------- .../Sources/Live/Now/SectionLiveNowView.swift | 2 +- .../Reservation/LiveReservationItemView.swift | 1 + .../MyLiveReservationItemView.swift | 1 + 5 files changed, 78 insertions(+), 50 deletions(-) diff --git a/SodaLive/Sources/Live/GetRoomListResponse.swift b/SodaLive/Sources/Live/GetRoomListResponse.swift index ac5054b..a34559a 100644 --- a/SodaLive/Sources/Live/GetRoomListResponse.swift +++ b/SodaLive/Sources/Live/GetRoomListResponse.swift @@ -19,6 +19,7 @@ struct GetRoomListResponse: Decodable, Hashable { let price: Int let tags: [String] let channelName: String? + let creatorProfileImage: String let creatorNickname: String let creatorId: Int let isReservation: Bool diff --git a/SodaLive/Sources/Live/Now/LiveNowItemView.swift b/SodaLive/Sources/Live/Now/LiveNowItemView.swift index 7700a5a..3201e18 100644 --- a/SodaLive/Sources/Live/Now/LiveNowItemView.swift +++ b/SodaLive/Sources/Live/Now/LiveNowItemView.swift @@ -16,64 +16,88 @@ struct LiveNowItemView: View { let height: CGFloat = 176.7 var body: some View { - ZStack { - KFImage(URL(string: item.coverImageUrl)) - .resizable() - .scaledToFill() - .frame(width: width, height: height, alignment: .top) - .cornerRadius(4.7) - .clipped() - - LinearGradient( - colors: [Color.black.opacity(0.1), Color.black.opacity(0.8)], - startPoint: .top, - endPoint: .bottom - ) - - VStack(spacing: 0) { - HStack(spacing: 3.3) { - Text(item.price > 0 ? "유료" : "무료") - .font(.custom(Font.medium.rawValue, size: 12)) - .foregroundColor(Color.white) - .padding(.horizontal, 7.3) - .padding(.vertical, 4) - .background(Color(hex: item.price > 0 ? "881609" : "643bc8")) - .cornerRadius(10) + VStack(alignment: .leading, spacing: 8) { + ZStack { + KFImage(URL(string: item.coverImageUrl)) + .resizable() + .scaledToFill() + .frame(width: width, height: height, alignment: .top) + .cornerRadius(4.7) + .clipped() + + LinearGradient( + colors: [Color.black.opacity(0.1), Color.black.opacity(0.8)], + startPoint: .top, + endPoint: .bottom + ) + + VStack(alignment: .trailing, spacing: 0) { + HStack(spacing: 3.3) { + Text(item.price > 0 ? "유료" : "무료") + .font(.custom(Font.medium.rawValue, size: 12)) + .foregroundColor(Color.white) + .padding(.horizontal, 7.3) + .padding(.vertical, 4) + .background(Color(hex: item.price > 0 ? "881609" : "643bc8")) + .cornerRadius(10) + + Spacer() + + if item.isPrivateRoom { + Image("ic_lock") + .resizable() + .frame(width: 20, height: 20) + } + } + .padding(.horizontal, 3.3) + .padding(.top, 3.3) Spacer() - if item.isPrivateRoom { - Image("ic_lock") + HStack(spacing: 2.7) { + Image("ic_avatar") .resizable() .frame(width: 20, height: 20) + + Text("\(item.numberOfParticipate)") + .font(.custom(Font.medium.rawValue, size: 13.3)) + .foregroundColor(Color.white) } + .padding(.horizontal, 5.3) + .padding(.bottom, 2.7) + .background(Color(hex: "333333")) + .cornerRadius(13.3) + .padding(.trailing, 6.7) + .padding(.bottom, 6.7) } - .padding(.horizontal, 3.3) - .padding(.top, 3.3) + } + .frame(width: width, height: height) + + Text("\(item.title)") + .font(.custom(Font.medium.rawValue, size: 12)) + .foregroundColor(Color(hex: "eeeeee")) + .lineLimit(2) + .fixedSize(horizontal: false, vertical: true) + + if item.tags.count > 0 { + Text("\(item.tags.map { "#\($0)" }.joined(separator: " "))") + .font(.custom(Font.medium.rawValue, size: 11)) + .foregroundColor(Color(hex: "3bb9f1")) + } + + HStack(spacing: 5.3) { + KFImage(URL(string: item.creatorProfileImage)) + .resizable() + .scaledToFill() + .frame(width: 21.3, height: 21.3, alignment: .top) + .clipShape(Circle()) - Spacer() - - HStack(spacing: 0) { - Image("ic_avatar") - .resizable() - .frame(width: 20, height: 20) - - Text("\(item.numberOfParticipate)") - .font(.custom(Font.medium.rawValue, size: 13.3)) - .foregroundColor(Color.white) - .padding(.leading, 2.7) - - Spacer() - - Text("\(item.creatorNickname)") - .font(.custom(Font.medium.rawValue, size: 13.3)) - .foregroundColor(Color.white) - } - .padding(.horizontal, 6.7) - .padding(.bottom, 6.7) + Text("\(item.creatorNickname)") + .font(.custom(Font.medium.rawValue, size: 10)) + .foregroundColor(Color(hex: "777777")) } } - .frame(width: width, height: height) + .frame(width: width) } } @@ -82,7 +106,7 @@ struct LiveNowItemView_Previews: PreviewProvider { LiveNowItemView( item: GetRoomListResponse( roomId: 99, - title: "test", + title: "testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttest", content: "testtest", beginDateTime: "2022.05.23 Mon 03:00 PM", numberOfParticipate: 3, @@ -92,6 +116,7 @@ struct LiveNowItemView_Previews: PreviewProvider { price: 0, tags: ["팬미팅", "힐링"], channelName: nil, + creatorProfileImage: "https://test-cf.sodalive.net/profile/default-profile.png", creatorNickname: "user8", creatorId: 19, isReservation: false, diff --git a/SodaLive/Sources/Live/Now/SectionLiveNowView.swift b/SodaLive/Sources/Live/Now/SectionLiveNowView.swift index df04520..86af60e 100644 --- a/SodaLive/Sources/Live/Now/SectionLiveNowView.swift +++ b/SodaLive/Sources/Live/Now/SectionLiveNowView.swift @@ -15,7 +15,7 @@ struct SectionLiveNowView: View { let onTapCreateLive: () -> Void var body: some View { - VStack(spacing: 13.3) { + LazyVStack(spacing: 13.3) { HStack(spacing: 0) { Text("지금 ") .font(.custom(Font.bold.rawValue, size: 18.3)) diff --git a/SodaLive/Sources/Live/Reservation/LiveReservationItemView.swift b/SodaLive/Sources/Live/Reservation/LiveReservationItemView.swift index 547f7b8..302d7f1 100644 --- a/SodaLive/Sources/Live/Reservation/LiveReservationItemView.swift +++ b/SodaLive/Sources/Live/Reservation/LiveReservationItemView.swift @@ -103,6 +103,7 @@ struct LiveReservationItemView_Previews: PreviewProvider { price: 0, tags: ["팬미팅", "힐링"], channelName: nil, + creatorProfileImage: "https://test-cf.sodalive.net/profile/default-profile.png", creatorNickname: "user8", creatorId: 19, isReservation: false, diff --git a/SodaLive/Sources/Live/Reservation/MyLiveReservationItemView.swift b/SodaLive/Sources/Live/Reservation/MyLiveReservationItemView.swift index d30edb6..bcae61c 100644 --- a/SodaLive/Sources/Live/Reservation/MyLiveReservationItemView.swift +++ b/SodaLive/Sources/Live/Reservation/MyLiveReservationItemView.swift @@ -92,6 +92,7 @@ struct MyLiveReservationItemView_Previews: PreviewProvider { price: 0, tags: ["팬미팅", "힐링"], channelName: nil, + creatorProfileImage: "https://test-cf.sodalive.net/profile/default-profile.png", creatorNickname: "user8", creatorId: 19, isReservation: false,