Skip to content

Commit

Permalink
[Feat] #192 - 신고하기 클릭 후 구글폼으로 이동하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
boogios committed Jun 19, 2024
1 parent 320be02 commit 642dcb8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ final class HomeViewController: UIViewController {
var hasAppearedBefore = false
var reportTargetNickname: String = ""
var relateText: String = ""
let warnUserURL = URL(string: StringLiterals.Network.warnUserGoogleFormURL)

var transparentReasonView = DontBePopupReasonView()
var deletePostPopupVC = DeletePopupViewController(viewModel: DeletePostViewModel(networkProvider: NetworkService()))
Expand All @@ -44,8 +45,6 @@ final class HomeViewController: UIViewController {
private lazy var fifthReason = self.transparentReasonView.fifthReasonView.radioButton.publisher(for: .touchUpInside).map { _ in }.eraseToAnyPublisher()
private lazy var sixthReason = self.transparentReasonView.sixthReasonView.radioButton.publisher(for: .touchUpInside).map { _ in }.eraseToAnyPublisher()
private lazy var isPushAllowed = PassthroughSubject<Bool, Never>()

let warnUserURL = NSURL(string: "\(StringLiterals.Network.warnUserGoogleFormURL)")

// MARK: - UI Components

Expand Down Expand Up @@ -745,6 +744,12 @@ extension HomeViewController: DontBePopupDelegate {
func confirmButtonTapped() {
reportPopupView.removeFromSuperview()

let warnView: SFSafariViewController
if let warnURL = self.warnUserURL {
warnView = SFSafariViewController(url: warnURL)
self.present(warnView, animated: true, completion: nil)
}

Task {
do {
if let accessToken = KeychainWrapper.loadToken(forKey: "accessToken") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,12 @@ extension MyPageViewController: DontBePopupDelegate {
} else {
rootView.reportPopupView.removeFromSuperview()

let warnView: SFSafariViewController
if let warnURL = self.warnUserURL {
warnView = SFSafariViewController(url: warnURL)
self.present(warnView, animated: true, completion: nil)
}

Task {
do {
if let accessToken = KeychainWrapper.loadToken(forKey: "accessToken") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ final class PostDetailViewController: UIViewController {

var collectionHeaderView: PostDetailCollectionHeaderView?

let warnUserURL = NSURL(string: "\(StringLiterals.Network.warnUserGoogleFormURL)")

let viewModel: PostDetailViewModel
private var cancelBag = CancelBag()

Expand All @@ -55,6 +53,7 @@ final class PostDetailViewController: UIViewController {
var contentText: String = ""
var reportTargetNickname: String = ""
var relateText: String = ""
let warnUserURL = URL(string: StringLiterals.Network.warnUserGoogleFormURL)

// MARK: - UI Components

Expand Down Expand Up @@ -1071,6 +1070,12 @@ extension PostDetailViewController: DontBePopupDelegate {
func confirmButtonTapped() {
reportPopupView.removeFromSuperview()

let warnView: SFSafariViewController
if let warnURL = self.warnUserURL {
warnView = SFSafariViewController(url: warnURL)
self.present(warnView, animated: true, completion: nil)
}

Task {
do {
if let accessToken = KeychainWrapper.loadToken(forKey: "accessToken") {
Expand Down

0 comments on commit 642dcb8

Please sign in to comment.