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