IceCubesApp/IceCubesApp/App/AppRouteur.swift

37 lines
1 KiB
Swift
Raw Normal View History

2022-11-29 10:46:02 +00:00
import SwiftUI
import Timeline
import Account
2022-12-22 09:53:36 +00:00
import Env
2022-12-18 19:30:19 +00:00
import Status
2022-12-20 08:37:07 +00:00
import DesignSystem
2022-11-29 10:46:02 +00:00
extension View {
func withAppRouteur() -> some View {
self.navigationDestination(for: RouteurDestinations.self) { destination in
switch destination {
case let .accountDetail(id):
2022-11-29 11:18:06 +00:00
AccountDetailView(accountId: id)
2022-12-17 12:37:46 +00:00
case let .accountDetailWithAccount(account):
AccountDetailView(account: account)
2022-11-29 10:46:02 +00:00
case let .statusDetail(id):
StatusDetailView(statusId: id)
2022-12-21 19:26:38 +00:00
case let .hashTag(tag, accountId):
TimelineView(timeline: .hashtag(tag: tag, accountId: accountId))
2022-12-23 17:47:19 +00:00
case let .following(id):
AccountsListView(accountId: id, mode: .following)
case let .followers(id):
AccountsListView(accountId: id, mode: .followers)
2022-11-29 10:46:02 +00:00
}
}
}
2022-12-20 08:37:07 +00:00
func withSheetDestinations(sheetDestinations: Binding<SheetDestinations?>) -> some View {
self.sheet(item: sheetDestinations) { destination in
switch destination {
case .statusEditor:
StatusEditorView()
2022-12-20 08:37:07 +00:00
}
}
}
2022-11-29 10:46:02 +00:00
}