diff --git a/PingPong/Projects/Feature/Bake/Sources/UI/HomeBakingView/FamousSayingBakeCardView.swift b/PingPong/Projects/Feature/Bake/Sources/UI/HomeBakingView/FamousSayingBakeCardView.swift index 75222e37..6f3b0c5b 100644 --- a/PingPong/Projects/Feature/Bake/Sources/UI/HomeBakingView/FamousSayingBakeCardView.swift +++ b/PingPong/Projects/Feature/Bake/Sources/UI/HomeBakingView/FamousSayingBakeCardView.swift @@ -334,6 +334,9 @@ struct FamousSayingBakeCardView: View { } } } + } + else { + viewModel.isLoginExplore = true } //TODO: 좋아요되도록 수정 // post.isBookrmark.toggle() 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 a60f3f38..66fe1426 100644 --- a/PingPong/Projects/Feature/Core/Sources/UI/View/TabView/FamousSayingDetailView.swift +++ b/PingPong/Projects/Feature/Core/Sources/UI/View/TabView/FamousSayingDetailView.swift @@ -204,6 +204,9 @@ public struct FamousSayingDetailView: View { } } } + else { + viewModel.isLoginExplore = true + } } } } @@ -211,13 +214,15 @@ public struct FamousSayingDetailView: View { } ) }.frame(width: UIScreen.screenWidth, height: UIScreen.screenHeight * 0.8) + .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)) - + if viewModel.isLoginCheck { + 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/Home/Sources/UI/View/HomeView/HomeView.swift b/PingPong/Projects/Feature/Home/Sources/UI/View/HomeView/HomeView.swift index f4ff08d3..440dec6f 100644 --- a/PingPong/Projects/Feature/Home/Sources/UI/View/HomeView/HomeView.swift +++ b/PingPong/Projects/Feature/Home/Sources/UI/View/HomeView/HomeView.swift @@ -339,6 +339,9 @@ public struct HomeView: View { } } } + else { + viewModel.isLoginExplore = true + } } } } diff --git a/PingPong/Projects/Feature/Search/Sources/UI/View/ExploreView.swift b/PingPong/Projects/Feature/Search/Sources/UI/View/ExploreView.swift index dcd4cd3e..f20b31eb 100644 --- a/PingPong/Projects/Feature/Search/Sources/UI/View/ExploreView.swift +++ b/PingPong/Projects/Feature/Search/Sources/UI/View/ExploreView.swift @@ -12,6 +12,7 @@ import SwiftUI import Model import Common import Archive +import PopupView public struct ExploreView: View { @@ -58,6 +59,28 @@ public struct ExploreView: View { .frame(height: UIScreen.main.bounds.height * 0.6) } } + + .popup(isPresented: $viewModel.isLoginExplore, view: { + isExPlorePOPUP( + image: .mainHomeLogo, + title: "로그인 하세요!", + subTitle: "로그인을 하시면 더 많을걸 사용하실수 있어요!", + confirmAction: { + viewModel.isExploreApp = false + }, + cancelAction: { + viewModel.isLoginExplore = false + }, + noImage: false, noImageButton: false) + }, customize: { popup in + popup + .type(.default) + .position(.bottom) + .animation(.easeIn) + .closeOnTap(true) + .closeOnTapOutside(true) + .backgroundColor(.basicBlackDimmed) + }) } .task { let moodParameter: [String] = viewModel.generateParameter(searchType: .situation)