Add notification badge count and MainTabView with notification tab FRE-4740 FRE-4739

- Add getUnreadCount() endpoint to NotificationsServiceProtocol
- Add NotificationUnreadCountResponse model
- Add badgeCount and fetchUnreadCount() to NotificationsViewModel
- Update markAsRead/markAllAsRead to decrement badge count
- Create MainTabView with Home, Challenges, Clubs, Notifications tabs
- Add unread badge on notification tab using .badge() modifier
- Support injected ViewModel in NotificationsView for shared state
- Add badge count tests to NotificationServiceTests
- Fetch unread count on app launch and tab switch

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-05-03 20:16:05 -04:00
parent 88d57a3389
commit cb55ad95e2
9 changed files with 279 additions and 1 deletions

View File

@@ -1,8 +1,12 @@
import SwiftUI
struct NotificationsView: View {
@StateObject private var viewModel = NotificationsViewModel()
@StateObject private var viewModel: NotificationsViewModel
@State private var showingRefreshIndicator = false
init(viewModel: NotificationsViewModel = NotificationsViewModel()) {
self._viewModel = StateObject(wrappedValue: viewModel)
}
var body: some View {
NavigationView {