From 15ea4fdbdf53b9cc5fcb191598f7fa9d75bdf202 Mon Sep 17 00:00:00 2001 From: Roy-wonji Date: Sun, 10 Dec 2023 19:31:52 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8[feat]:=20=20=20=EB=91=98=EB=9F=AC?= =?UTF-8?q?=EB=B3=B4=EA=B8=B0=20=EA=B8=B0=EB=8A=A5=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FamousSayingBakeCardView.swift | 3 +++ .../View/TabView/FamousSayingDetailView.swift | 17 +++++++++----- .../Sources/UI/View/HomeView/HomeView.swift | 3 +++ .../Search/Sources/UI/View/ExploreView.swift | 23 +++++++++++++++++++ 4 files changed, 40 insertions(+), 6 deletions(-) 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)