From 4de4f997e6d304d7703d2b9e4dc6df06c3989251 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Fri, 24 Nov 2023 22:08:09 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=ED=95=84=20=EB=8B=A4=EC=9D=B4=EC=96=BC=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=20-=20=ED=8C=94=EB=A1=9C=EC=9E=89=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EC=9C=84=EC=B9=98=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LiveRoomUserProfileDialogView.swift | 105 +++++++----------- 1 file changed, 38 insertions(+), 67 deletions(-) diff --git a/SodaLive/Sources/Live/Room/Dialog/LiveRoomUserProfileDialogView.swift b/SodaLive/Sources/Live/Room/Dialog/LiveRoomUserProfileDialogView.swift index 75f91bf..517c0c7 100644 --- a/SodaLive/Sources/Live/Room/Dialog/LiveRoomUserProfileDialogView.swift +++ b/SodaLive/Sources/Live/Room/Dialog/LiveRoomUserProfileDialogView.swift @@ -40,7 +40,6 @@ struct LiveRoomUserProfileDialogView: View { isShowing = false } } - .padding(.top, 13.3) ScrollView(.vertical, showsIndicators: false) { VStack(alignment: .leading, spacing: 0) { @@ -57,6 +56,19 @@ struct LiveRoomUserProfileDialogView: View { .background(Color(hex: "555555")) .cornerRadius(23.3) + if let isFollowing = userProfile.isFollowing { + Image(isFollowing ? "btn_following" : "btn_follow") + .contentShape(Rectangle()) + .onTapGesture { + if isFollowing { + onClickUnFollow(userProfile.userId) + } else { + onClickFollow(userProfile.userId) + } + } + .padding(.leading, 13.3) + } + Spacer() Image("ic_seemore_vertical") @@ -70,53 +82,6 @@ struct LiveRoomUserProfileDialogView: View { } .padding(.top, 21.3) - HStack(spacing: 8) { - if let isFollwing = userProfile.isFollowing { - if isFollwing { - HStack(spacing: 4) { - Image("ic_alarm_selected") - .resizable() - .frame(width: 18.7, height: 18.7) - - Text("팔로잉") - .font(.custom(Font.bold.rawValue, size: 12)) - .foregroundColor(Color(hex: "ffffff")) - } - .padding(.vertical, 7.3) - .frame(maxWidth: .infinity) - .background(Color(hex: "3e1b93")) - .cornerRadius(16.7) - .overlay( - RoundedRectangle(cornerRadius: 16.7) - .strokeBorder(lineWidth: 1) - .foregroundColor(Color(hex: "9970ff")) - ) - .onTapGesture { onClickUnFollow(userProfile.userId) } - } else { - HStack(spacing: 4) { - Image("ic_alarm") - .resizable() - .frame(width: 18.7, height: 18.7) - - Text("팔로우") - .font(.custom(Font.bold.rawValue, size: 12)) - .foregroundColor(Color(hex: "ffffff")) - } - .padding(.vertical, 7.3) - .frame(maxWidth: .infinity) - .cornerRadius(16.7) - .overlay( - RoundedRectangle(cornerRadius: 16.7) - .strokeBorder(lineWidth: 1) - .foregroundColor(Color(hex: "9970ff")) - ) - .onTapGesture { onClickFollow(userProfile.userId) } - } - } - } - .fixedSize(horizontal: false, vertical: true) - .padding(.top, 21.3) - KFImage(URL(string: userProfile.profileUrl)) .resizable() .aspectRatio(CGSize(width: 1, height: 1), contentMode: .fill) @@ -208,31 +173,37 @@ struct LiveRoomUserProfileDialogView: View { .padding(.top, 21.3) } - Text(userProfile.tags) - .font(.custom(Font.medium.rawValue, size: 13.3)) - .foregroundColor(Color(hex: "9970ff")) - .lineSpacing(3) - .padding(.top, 21.3) + if let _ = userProfile.isFollowing, !userProfile.tags.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty { + Text(userProfile.tags) + .font(.custom(Font.medium.rawValue, size: 13.3)) + .foregroundColor(Color(hex: "9970ff")) + .lineSpacing(3) + .padding(.top, 21.3) + } - Text(userProfile.introduce) - .font(.custom(Font.medium.rawValue, size: 12)) - .foregroundColor(Color(hex: "909090")) - .lineLimit(introduceLineLimit) - .lineSpacing(3) - .fixedSize(horizontal: false, vertical: true) - .padding(.vertical, 20) - .onTapGesture { - if let _ = introduceLineLimit { - self.introduceLineLimit = nil - } else { - self.introduceLineLimit = 2 + if let _ = userProfile.isFollowing, !userProfile.introduce.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty { + Text(userProfile.introduce) + .font(.custom(Font.medium.rawValue, size: 12)) + .foregroundColor(Color(hex: "909090")) + .lineLimit(introduceLineLimit) + .lineSpacing(3) + .fixedSize(horizontal: false, vertical: true) + .padding(.top, 20) + .onTapGesture { + if let _ = introduceLineLimit { + self.introduceLineLimit = nil + } else { + self.introduceLineLimit = 2 + } } - } + } } } } .padding(.horizontal, 13.3) - .background(Color(hex: "222222").edgesIgnoringSafeArea(.all)) + .padding(.top, 13.3) + .padding(.bottom, 20) + .background(Color(hex: "222222")) .cornerRadius(8) if viewModel.isShowKickOutPopup {