-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathTabItemView.swift
More file actions
32 lines (31 loc) · 1.13 KB
/
TabItemView.swift
File metadata and controls
32 lines (31 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import SwiftUI
import KotlinSharedUI
extension TabItem {
@MainActor
@ViewBuilder
func view(
onNavigate: @escaping (Route) -> Void,
) -> some View {
switch onEnum(of: self) {
case .timelineTabItem(let timelineTabItem):
switch onEnum(of: timelineTabItem) {
case .HomeTimelineTabItem(let homeTimelineTabItem):
HomeTimelineScreen(accountType: homeTimelineTabItem.account, toServiceSelect: { onNavigate(.serviceSelect) })
default:
TimelineScreen(tabItem: timelineTabItem)
}
case .notificationTabItem:
NotificationScreen(accountType: self.account)
case .settingsTabItem:
SettingsScreen()
case .discoverTabItem(let discoverTabItem):
DiscoverScreen(accountType: discoverTabItem.account)
case .allListTabItem(let allListTabItem):
AllListScreen(accountType: allListTabItem.account)
case .feedsTabItem(let feedsTabItem):
AllFeedScreen(accountType: feedsTabItem.account)
default:
Text("Not done yet for \(self)")
}
}
}