From 2aa3f944c8a592907989e26cc98032eea042af95 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Tue, 29 Aug 2023 15:30:21 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=91=EC=9B=90=20=EC=A0=84=EC=B2=B4?= =?UTF-8?q?=EB=B3=B4=EA=B8=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SodaLive/Sources/ContentView.swift | 3 + .../FanTalk/UserProfileFanTalkAllView.swift | 172 ++++++++++++++++++ 2 files changed, 175 insertions(+) create mode 100644 SodaLive/Sources/Explorer/Profile/FanTalk/UserProfileFanTalkAllView.swift diff --git a/SodaLive/Sources/ContentView.swift b/SodaLive/Sources/ContentView.swift index b803d1c..cdcf75c 100644 --- a/SodaLive/Sources/ContentView.swift +++ b/SodaLive/Sources/ContentView.swift @@ -154,6 +154,9 @@ struct ContentView: View { case .userProfileDonationAll(let userId): UserProfileDonationAllView(userId: userId) + case .userProfileFanTalkAll(let userId): + UserProfileFanTalkAllView(userId: userId) + default: EmptyView() .frame(width: 0, height: 0, alignment: .topLeading) diff --git a/SodaLive/Sources/Explorer/Profile/FanTalk/UserProfileFanTalkAllView.swift b/SodaLive/Sources/Explorer/Profile/FanTalk/UserProfileFanTalkAllView.swift new file mode 100644 index 0000000..5b4a9d5 --- /dev/null +++ b/SodaLive/Sources/Explorer/Profile/FanTalk/UserProfileFanTalkAllView.swift @@ -0,0 +1,172 @@ +// +// UserProfileFanTalkAllView.swift +// SodaLive +// +// Created by klaus on 2023/08/29. +// + +import SwiftUI +import Kingfisher + +struct UserProfileFanTalkAllView: View { + + let userId: Int + @StateObject var viewModel = UserProfileFanTalkViewModel() + + @State private var cheersContent: String = "" + + var body: some View { + GeometryReader { proxy in + BaseView(isLoading: $viewModel.isLoading) { + VStack(spacing: 0) { + DetailNavigationBar(title: "팬 Talk 전체보기") + + VStack(alignment: .leading, spacing: 0) { + HStack(spacing: 6.7) { + Text("응원") + .font(.custom(Font.medium.rawValue, size: 14.7)) + .foregroundColor(Color(hex: "eeeeee")) + + Text("\(viewModel.cheersTotalCount)") + .font(.custom(Font.medium.rawValue, size: 12)) + .foregroundColor(Color(hex: "777777")) + } + .padding(.top, 20) + + Rectangle() + .frame(height: 1) + .foregroundColor(Color(hex: "909090").opacity(0.5)) + .padding(.top, 13.3) + + HStack(spacing: 0) { + TextField("응원댓글을 입력하세요", text: $cheersContent) + .autocapitalization(.none) + .disableAutocorrection(true) + .font(.custom(Font.medium.rawValue, size: 13.3)) + .foregroundColor(Color(hex: "eeeeee")) + .accentColor(Color(hex: "9970ff")) + .keyboardType(.default) + .padding(.horizontal, 13.3) + + Spacer() + + Image("btn_message_send") + .resizable() + .frame(width: 35, height: 35) + .padding(6.7) + .onTapGesture { + hideKeyboard() + viewModel.writeCheers(creatorId: userId, cheersContent: cheersContent) + cheersContent = "" + } + } + .background(Color(hex: "232323")) + .cornerRadius(10) + .overlay( + RoundedRectangle(cornerRadius: 10) + .strokeBorder(lineWidth: 1) + .foregroundColor(Color(hex: "9970ff")) + ) + .padding(.top, 13.3) + + Rectangle() + .frame(height: 1) + .foregroundColor(Color(hex: "909090").opacity(0.5)) + .padding(.top, 13.3) + + ScrollView(.vertical, showsIndicators: false) { + LazyVStack(spacing: 20) { + if viewModel.cheersTotalCount > 0 { + ForEach(0.. 0 { + Rectangle() + .foregroundColor(Color(hex: "222222")) + .frame(width: proxy.size.width, height: 15.3) + } + } + .ignoresSafeArea() + } + + if viewModel.isShowCheersReportView { + CheersReportDialogView( + isShowing: $viewModel.isShowCheersReportView, + confirmAction: { reason in + viewModel.report(type: .CHEERS, reason: reason) + } + ) + } + } + } + } + } +}