From 88a03ff5d5774408d1961bee0dfdd04c11bc1c55 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Fri, 17 Oct 2025 04:20:01 +0900 Subject: [PATCH] =?UTF-8?q?feat(creator-channel):=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=ED=95=84=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=ED=91=9C=EC=8B=9C=20?= =?UTF-8?q?=EB=B0=A9=EC=8B=9D=20=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20UI=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=20=EC=88=9C=EC=84=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ic_new_share.imageset/Contents.json | 21 + .../ic_new_share.imageset/ic_new_share.png | Bin 0 -> 408 bytes .../Profile/UserProfileCreatorView.swift | 1 - .../Explorer/Profile/UserProfileView.swift | 394 +++++++++--------- 4 files changed, 214 insertions(+), 202 deletions(-) create mode 100644 SodaLive/Resources/Assets.xcassets/ic_new_share.imageset/Contents.json create mode 100644 SodaLive/Resources/Assets.xcassets/ic_new_share.imageset/ic_new_share.png diff --git a/SodaLive/Resources/Assets.xcassets/ic_new_share.imageset/Contents.json b/SodaLive/Resources/Assets.xcassets/ic_new_share.imageset/Contents.json new file mode 100644 index 0000000..f4341be --- /dev/null +++ b/SodaLive/Resources/Assets.xcassets/ic_new_share.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "ic_new_share.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SodaLive/Resources/Assets.xcassets/ic_new_share.imageset/ic_new_share.png b/SodaLive/Resources/Assets.xcassets/ic_new_share.imageset/ic_new_share.png new file mode 100644 index 0000000000000000000000000000000000000000..89f28ab34bc6e5a68958b87153f00a4d20b85dd2 GIT binary patch literal 408 zcmV;J0cZY+P)HK~#7F;TNOjT0UUFDfE(X!(XJ={ID zpO*x=8Ox(Rxiiqna_pEjCth;bN^z*l#^N 0 { - ScrollView(.horizontal, showsIndicators: false) { - LazyHStack(spacing: 13.3) { - if UserDefaults.int(forKey: .userId) == creatorProfile.creator.creatorId { - CreatorCommunityWriteItemView() - .onTapGesture { - AppState.shared.setAppStep( - step: .creatorCommunityWrite( - onSuccess: creatorCommunityWriteSuccess - ) - ) - } - } - - ForEach(0.. 0 || - userId == UserDefaults.int(forKey: .userId) - { - UserProfileContentView( - userId: userId, - items: creatorProfile.contentList - ) - .padding(.top, 26.7) - .padding(.horizontal, 13.3) + ZStack(alignment: .top) { + VStack(spacing: 0) { + ScrollView(.vertical, showsIndicators: false) { + LazyVStack(spacing: 48) { + if let creatorProfile = viewModel.creatorProfile { + ZStack(alignment: .bottomLeading) { + KFImage(URL(string: creatorProfile.creator.profileUrl)) + .cancelOnDisappear(true) + .downsampling(size: CGSize(width: screenSize().width, height: screenSize().width)) + .resizable() + .aspectRatio(1, contentMode: .fill) + .frame(maxWidth: screenSize().width) + .clipped() } if creatorProfile.creator.creatorId == UserDefaults.int(forKey: .userId) || creatorProfile.liveRoomList.count > 0 { @@ -210,65 +95,153 @@ struct UserProfileView: View { ) } } - .padding(.top, 26.7) - .padding(.horizontal, 13.3) + } + + if creatorProfile.creator.creatorId == UserDefaults.int(forKey: .userId) || creatorProfile.contentList.count > 0 { + UserProfileContentView( + userId: userId, + items: creatorProfile.contentList + ) + } + + if viewModel.communityPostList.count > 0 { + ScrollView(.horizontal, showsIndicators: false) { + LazyHStack(spacing: 13.3) { + if UserDefaults.int(forKey: .userId) == creatorProfile.creator.creatorId { + CreatorCommunityWriteItemView() + .onTapGesture { + AppState.shared.setAppStep( + step: .creatorCommunityWrite( + onSuccess: creatorCommunityWriteSuccess + ) + ) + } + } + + ForEach(0.. 0 { - VStack(spacing: 26.7) { - UserProfileDonationView(userId: userId, donationRankingResponse: creatorProfile.userDonationRanking) - .padding(.horizontal, 13.3) - - Rectangle() - .frame(height: 6.7) - .foregroundColor(Color.gray90.opacity(0.5)) - } - .padding(.top, 26.7) + UserProfileDonationView(userId: userId, donationRankingResponse: creatorProfile.userDonationRanking) } + + UserProfileFanTalkView( + userId: userId, + cheers: creatorProfile.cheers, + errorPopup: { message in + viewModel.errorMessage = message + viewModel.isShowPopup = true + }, + reportPopup: { cheerId in + viewModel.cheersId = cheerId + viewModel.isShowCheersReportView = true + }, + deletePopup: { cheerId in + viewModel.cheersId = cheerId + viewModel.isShowCheersDeleteView = true + }, + profilePopup: { + self.memberId = $0 + self.isShowMemberProfilePopup = true + }, + isLoading: $viewModel.isLoading + ) } - - UserProfileFanTalkView( - userId: userId, - cheers: creatorProfile.cheers, - errorPopup: { message in - viewModel.errorMessage = message - viewModel.isShowPopup = true - }, - reportPopup: { cheerId in - viewModel.cheersId = cheerId - viewModel.isShowCheersReportView = true - }, - deletePopup: { cheerId in - viewModel.cheersId = cheerId - viewModel.isShowCheersDeleteView = true - }, - profilePopup: { - self.memberId = $0 - self.isShowMemberProfilePopup = true - }, - isLoading: $viewModel.isLoading - ) - .padding(.top, 26.7) } } } - } - .navigationTitle("") - .navigationBarBackButtonHidden() - .popup(isPresented: $viewModel.isShowPopup, type: .toast, position: .bottom, autohideIn: 2) { - HStack { - Spacer() - Text(viewModel.errorMessage) - .padding(.vertical, 13.3) - .frame(width: screenSize().width - 66.7, alignment: .center) - .font(.custom(Font.medium.rawValue, size: 12)) - .background(Color.button) - .foregroundColor(Color.white) - .multilineTextAlignment(.leading) - .cornerRadius(20) - .padding(.bottom, 66.7) + + HStack(spacing: 14) { + Button { + if presentationMode.wrappedValue.isPresented { + presentationMode.wrappedValue.dismiss() + } else { + AppState.shared.back() + } + } label: { + Image("ic_back") + .resizable() + .frame(width: 20, height: 20) + + Text(viewModel.navigationTitle) + .font(.custom(Font.preBold.rawValue, size: 20)) + .foregroundColor(Color.white) + } + Spacer() + + if let creatorProfile = viewModel.creatorProfile { + Image("ic_new_share") + .resizable() + .frame(width: 24, height: 24) + .onTapGesture { + viewModel.shareChannel( + userId: creatorProfile.creator.creatorId, + nickname: creatorProfile.creator.nickname, + profileImage: creatorProfile.creator.profileUrl + ) + } + } + + if userId != UserDefaults.int(forKey: .userId) { + Image("ic_seemore_vertical") + .resizable() + .frame(width: 24, height: 24) + .onTapGesture { + viewModel.isShowReportMenu = true + } + } } + .padding(.top, proxy.safeAreaInsets.top) + .padding(.horizontal, 24) + .frame(height: proxy.safeAreaInsets.top + 50) } ZStack { @@ -337,8 +310,7 @@ struct UserProfileView: View { .ignoresSafeArea() } - if let creatorProfile = viewModel.creatorProfile, - viewModel.isShowUesrBlockConfirm { + if let creatorProfile = viewModel.creatorProfile, viewModel.isShowUesrBlockConfirm { UserBlockConfirmDialogView( isShowing: $viewModel.isShowUesrBlockConfirm, nickname: creatorProfile.creator.nickname, @@ -369,32 +341,52 @@ struct UserProfileView: View { } } - if isShowFollowNotifyDialog { - CreatorFollowNotifyDialog( - isShowing: $isShowFollowNotifyDialog, - onClickNotifyAll: { - viewModel.creatorFollow(follow: true, notify: true) - }, - onClickNotifyNone: { - viewModel.creatorFollow(follow: true, notify: false) - }, - onClickUnFollow: { - viewModel.creatorFollow(follow: false, notify: false) + ZStack { + if isShowFollowNotifyDialog { + CreatorFollowNotifyDialog( + isShowing: $isShowFollowNotifyDialog, + onClickNotifyAll: { + viewModel.creatorFollow(follow: true, notify: true) + }, + onClickNotifyNone: { + viewModel.creatorFollow(follow: true, notify: false) + }, + onClickUnFollow: { + viewModel.creatorFollow(follow: false, notify: false) + } + ) + } + + if isShowRouletteSettings { + RouletteSettingsView(isShowing: $isShowRouletteSettings, availableActive: false) { _, message in + viewModel.errorMessage = message + viewModel.isShowPopup = true } - ) - } - - if isShowRouletteSettings { - RouletteSettingsView(isShowing: $isShowRouletteSettings, availableActive: false) { _, message in - viewModel.errorMessage = message - viewModel.isShowPopup = true + } + + if isShowMenuSettings { + MenuSettingsView(isShowing: $isShowMenuSettings) } } - - if isShowMenuSettings { - MenuSettingsView(isShowing: $isShowMenuSettings) + } + .navigationTitle("") + .navigationBarBackButtonHidden() + .popup(isPresented: $viewModel.isShowPopup, type: .toast, position: .bottom, autohideIn: 2) { + HStack { + Spacer() + Text(viewModel.errorMessage) + .padding(.vertical, 13.3) + .frame(width: screenSize().width - 66.7, alignment: .center) + .font(.custom(Font.medium.rawValue, size: 12)) + .background(Color.button) + .foregroundColor(Color.white) + .multilineTextAlignment(.leading) + .cornerRadius(20) + .padding(.bottom, 66.7) + Spacer() } } + .ignoresSafeArea() .sheet( isPresented: $viewModel.isShowShareView, onDismiss: { viewModel.shareMessage = "" },