Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ struct NotificationsScreen: View {
@StateObject private var viewModel = ContactsViewModel()
@State private var selectedContact: ContactItem? = nil

let onBack: () -> Void

/// Read-state captured once at screen entry so rows don't jump
/// between sections while the user is looking at them; the marker
/// itself advances on exit (`markNotificationsViewed`).
Expand All @@ -29,10 +31,20 @@ struct NotificationsScreen: View {
var body: some View {
ZStack {
Color.dash.primaryBackground.ignoresSafeArea()
content

VStack(spacing: 0) {
NavigationBar(
leading: { NavigationBarElement.back.button { onBack() } },
central: {
Text(NSLocalizedString("Notifications", comment: "DashPay Notifications"))
.font(.subheadMedium)
.foregroundColor(.dash.primaryText)
}
)

content
}
}
.navigationTitle(NSLocalizedString("Notifications", comment: "DashPay Notifications"))
.navigationBarTitleDisplayMode(.inline)
.sheet(item: $selectedContact) { contact in
ContactProfileSheet(contact: contact)
}
Expand Down
9 changes: 7 additions & 2 deletions DashWallet/Sources/UI/Home/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,13 @@ class HomeViewController: DWBasePayViewController, NavigationBarDisplayable {

@objc func notificationAction() {
// Notifications are backed by the SwiftDashSDK contacts service.
let controller = UIHostingController(rootView: NotificationsScreen())
navigationController?.pushViewController(controller, animated: true)
guard let navigation = navigationController,
navigation.topViewController === self else { return }
let screen = NotificationsScreen(onBack: { [weak navigation] in
navigation?.popViewController(animated: true)
})
let controller = UIHostingController(rootView: screen)
navigation.pushViewController(controller, animated: true)
}

@objc func profileAction() {
Expand Down
Loading