mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-26 15:02:39 +01:00
37 lines
982 B
Swift
37 lines
982 B
Swift
import SwiftUI
|
|
import Timeline
|
|
import Env
|
|
import Network
|
|
import Combine
|
|
|
|
struct TimelineTab: View {
|
|
@EnvironmentObject private var client: Client
|
|
@StateObject private var routeurPath = RouterPath()
|
|
@Binding var popToRootTab: IceCubesApp.Tab
|
|
|
|
var body: some View {
|
|
NavigationStack(path: $routeurPath.path) {
|
|
TimelineView()
|
|
.withAppRouteur()
|
|
.withSheetDestinations(sheetDestinations: $routeurPath.presentedSheet)
|
|
.toolbar {
|
|
if client.isAuth {
|
|
ToolbarItem(placement: .navigationBarLeading) {
|
|
Button {
|
|
routeurPath.presentedSheet = .statusEditor(replyToStatus: nil)
|
|
} label: {
|
|
Image(systemName: "square.and.pencil")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.environmentObject(routeurPath)
|
|
.onChange(of: $popToRootTab.wrappedValue) { popToRootTab in
|
|
if popToRootTab == .timeline {
|
|
routeurPath.path = []
|
|
}
|
|
}
|
|
}
|
|
}
|