From 27b87c9cbe36342dc665ff2177d11bb9597b3cac Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Wed, 14 Feb 2024 17:02:22 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20-=20=ED=81=AC=EB=A6=AC=EC=97=90=EC=9D=B4=ED=84=B0?= =?UTF-8?q?=EB=8A=94=20=EC=98=88=EC=95=BD=EC=9E=90(=EC=B0=B8=EC=97=AC?= =?UTF-8?q?=EC=9E=90)=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Live/Room/Detail/LiveDetailView.swift | 95 ++++++++++++++++++- 1 file changed, 94 insertions(+), 1 deletion(-) diff --git a/SodaLive/Sources/Live/Room/Detail/LiveDetailView.swift b/SodaLive/Sources/Live/Room/Detail/LiveDetailView.swift index 2e5b1b4..f306c67 100644 --- a/SodaLive/Sources/Live/Room/Detail/LiveDetailView.swift +++ b/SodaLive/Sources/Live/Room/Detail/LiveDetailView.swift @@ -118,9 +118,20 @@ struct LiveDetailView: View { .padding(.top, 16.7) .frame(width: proxy.size.width - 26.7) + if UserDefaults.int(forKey: .userId) == room.manager.id { + Rectangle() + .frame(height: 1) + .foregroundColor(Color.gray90.opacity(0.5)) + .padding(.top, 8) + .frame(width: proxy.size.width - 26.7) + + ParticipantView(room: room) + .frame(width: proxy.size.width - 26.7) + } + Rectangle() .frame(height: 1) - .foregroundColor(Color(hex: "909090").opacity(0.5)) + .foregroundColor(Color.gray90.opacity(0.5)) .padding(.top, 13.3) HStack(spacing: 13.3) { @@ -392,6 +403,88 @@ struct LiveDetailView: View { } } + @ViewBuilder + private func ParticipantView(room: GetRoomDetailResponse) -> some View { + if isExpandParticipantArea { + HStack(spacing: 0) { + Text(room.channelName.isNullOrBlank() ? "예약자" : "참가자") + .font(.custom(Font.medium.rawValue, size: 12)) + .foregroundColor(Color.graybb) + + Spacer() + + Text("\(room.numberOfParticipants)") + .font(.custom(Font.medium.rawValue, size: 12)) + .foregroundColor(Color.button) + + Text("/\(room.numberOfParticipantsTotal)") + .font(.custom(Font.medium.rawValue, size: 12)) + .foregroundColor(Color.graybb) + } + .padding(.top, 16.7) + + LazyVGrid(columns: columns) { + ForEach(room.participatingUsers, id: \.self) { user in + VStack(spacing: 6.7) { + KFImage(URL(string: user.profileImageUrl)) + .resizable() + .scaledToFill() + .frame(width: 46.7, height: 46.7, alignment: .top) + .clipShape(Circle()) + + Text(user.nickname) + .font(.custom(Font.medium.rawValue, size: 12)) + .foregroundColor(Color.graybb) + .lineLimit(1) + } + } + } + .padding(.top, 16.7) + } else { + let userCount = room.numberOfParticipants > 10 ? 10 : room.numberOfParticipants + + HStack(spacing: -13.3) { + ForEach(0.. 0 { + HStack(spacing: 6.7) { + Image(isExpandParticipantArea ? "ic_live_detail_top" : "ic_live_detail_bottom") + .resizable() + .frame(width: 20, height: 20) + + Text(isExpandParticipantArea ? "닫기" : "펼쳐보기") + .font(.custom(Font.medium.rawValue, size: 12)) + .foregroundColor(Color.graybb) + } + .padding(.top, 13.3) + .onTapGesture { + isExpandParticipantArea.toggle() + } + } + } + private func hideView() { if let close = onClickClose { close()