From 6cc469b27de75f6271e09cb7d13bf79d5c854b5d Mon Sep 17 00:00:00 2001 From: Byeonjinha Date: Tue, 21 Nov 2023 23:51:19 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=9B[chore]:=20=20=20=ED=82=A4=EB=B3=B4?= =?UTF-8?q?=EB=93=9C=20active=20=EC=8B=9C=20=ED=83=AD=EB=B0=94=20=EA=B3=A0?= =?UTF-8?q?=EC=A0=95,=20DetailView=20=EC=A2=8B=EC=95=84=EC=9A=94=20?= =?UTF-8?q?=EC=B7=A8=EC=86=8C=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core/Sources/UI/View/TabView/CoreView.swift | 5 +---- .../UI/View/TabView/FamousSayingDetailView.swift | 10 +++++++--- .../Feature/Search/Sources/UI/View/ExploreView.swift | 3 --- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/PingPong/Projects/Feature/Core/Sources/UI/View/TabView/CoreView.swift b/PingPong/Projects/Feature/Core/Sources/UI/View/TabView/CoreView.swift index 01f77454..01d32d94 100644 --- a/PingPong/Projects/Feature/Core/Sources/UI/View/TabView/CoreView.swift +++ b/PingPong/Projects/Feature/Core/Sources/UI/View/TabView/CoreView.swift @@ -42,8 +42,7 @@ public struct CoreView: View { } mainTabBar() -// .keyboardAdaptive() - + .ignoresSafeArea(.keyboard) } .modal(with: sheetManager, viewModel: viewModel) .onAppear { @@ -105,8 +104,6 @@ public struct CoreView: View { appState.isGoToProfileView = false }, authViewModel: authViewModel) -// - } } diff --git a/PingPong/Projects/Feature/Core/Sources/UI/View/TabView/FamousSayingDetailView.swift b/PingPong/Projects/Feature/Core/Sources/UI/View/TabView/FamousSayingDetailView.swift index 7979a6be..0978c87b 100644 --- a/PingPong/Projects/Feature/Core/Sources/UI/View/TabView/FamousSayingDetailView.swift +++ b/PingPong/Projects/Feature/Core/Sources/UI/View/TabView/FamousSayingDetailView.swift @@ -184,17 +184,23 @@ public struct FamousSayingDetailView: View { .padding(EdgeInsets(top: 0, leading: 0, bottom: 26, trailing: 16)) .foregroundColor(viewModel.selectedCard.isBookrmark ? colorSet.icon : colorSet.iconBackground) .onTapGesture { + print("??") if viewModel.selectedCard.isBookrmark { + print("isBook", viewModel.selectedCard.likeId) Task { if let likeId = viewModel.selectedCard.likeId { await viewModel.deleteLikeQuote(likeID: likeId) viewModel.selectedCard.isBookrmark = false + print(viewModel.selectedCard.isBookrmark) viewModel.removeLike(card: viewModel.selectedCard) } } } else { + print("isNotBook") Task { - await viewModel.quoteLikeRequest(userID: "\(authViewModel.userid)", quoteId: viewModel.selectedCard.qouteId, completion: {}) + await viewModel.quoteLikeRequest(userID: "\(authViewModel.userid)", quoteId: viewModel.selectedCard.qouteId, completion: { + viewModel.selectedCard.likeId = viewModel.homeBaseModel?.data + }) viewModel.selectedCard.isBookrmark = true viewModel.addLike(card: viewModel.selectedCard) } @@ -209,8 +215,6 @@ public struct FamousSayingDetailView: View { .onChange(of: viewModel.selectedCard.isBookrmark , perform: { newValue in homeViewModel.randomQuoteRequest(userID: "\(authViewModel.userid)") { - // 종아요일 때 - for quoteContent in homeViewModel.homeRandomQuoteModel?.data?.content ?? [] { let hashTags = viewModel.getHashtags(post: quoteContent) viewModel.cards.append(CardInfomation(qouteId: quoteContent.quoteID ?? .zero, hashtags: hashTags, image: "", title: quoteContent.content ?? "", sources: quoteContent.author ?? "", isBookrmark: newValue, likeId: quoteContent.likeID)) diff --git a/PingPong/Projects/Feature/Search/Sources/UI/View/ExploreView.swift b/PingPong/Projects/Feature/Search/Sources/UI/View/ExploreView.swift index 4dad436f..dcd4cd3e 100644 --- a/PingPong/Projects/Feature/Search/Sources/UI/View/ExploreView.swift +++ b/PingPong/Projects/Feature/Search/Sources/UI/View/ExploreView.swift @@ -57,7 +57,6 @@ public struct ExploreView: View { } .frame(height: UIScreen.main.bounds.height * 0.6) } - } } .task { @@ -99,7 +98,6 @@ public struct ExploreView: View { } } }) - } @@ -119,7 +117,6 @@ public struct ExploreView: View { .frame(width: 17, height: 17) .padding(15) .onTapGesture { - // viewModel.filterPostsByText() } } )