Skip to content

Commit

Permalink
Wire up button
Browse files Browse the repository at this point in the history
  • Loading branch information
ifosli committed Jul 8, 2024
1 parent 44964bd commit de57ec2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ public class PPOContainerViewController: PagedContainerViewController {

// TODO: Translate these strings (MBL-1558)
self.title = "Activity"
let ppoViewController = UIHostingController(rootView: PPOView())

let tabBarController = self.tabBarController as? RootTabBarViewController
let ppoViewController = UIHostingController(rootView: PPOView(tabBarController: tabBarController))
ppoViewController.title = "Project Alerts"

let activitiesViewController = ActivitiesViewController.instantiate()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import SwiftUI

struct PPOEmptyStateView: View {
weak var tabBarController: RootTabBarViewController?

private enum Constants {
public static let largePadding = 24.0
public static let horizontalPadding = 16.0
Expand Down Expand Up @@ -28,7 +30,7 @@ struct PPOEmptyStateView: View {
.multilineTextAlignment(.center)

Button {
print("Looking!")
self.tabBarController?.switchToProfile()
} label: {
Text("See all backed projects")
.frame(maxWidth: .infinity)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import SwiftUI

struct PPOView: View {
weak var tabBarController: RootTabBarViewController?
@StateObject private var viewModel = PPOViewModel()
var body: some View {
ScrollView {
// Text(self.viewModel.greeting)
// TODO: Show empty state view if user is logged in and has no PPO updates.
PPOEmptyStateView()
PPOEmptyStateView(tabBarController: self.tabBarController)
}
}
}
Expand Down

0 comments on commit de57ec2

Please sign in to comment.