Skip to content

Commit

Permalink
✨[feat]: 둘러보기 기능추가 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy-wonji committed Dec 10, 2023
1 parent 98a9840 commit 15ea4fd
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ struct FamousSayingBakeCardView: View {
}
}
}
}
else {
viewModel.isLoginExplore = true
}
//TODO: 좋아요되도록 수정
// post.isBookrmark.toggle()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,20 +204,25 @@ public struct FamousSayingDetailView: View {
}
}
}
else {
viewModel.isLoginExplore = true
}
}
}
}
}
}
)
}.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))

}
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ public struct HomeView: View {
}
}
}
else {
viewModel.isLoginExplore = true
}
}
}
}
Expand Down
23 changes: 23 additions & 0 deletions PingPong/Projects/Feature/Search/Sources/UI/View/ExploreView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import SwiftUI
import Model
import Common
import Archive
import PopupView


public struct ExploreView: View {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 15ea4fd

Please sign in to comment.