mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-27 23:40:05 +01:00
4189a59cf6
* Initial iOS 17 + Observable migration * More Observation * More observation * Checkpoint * Checkpoint * Bump version to 1.8.0 * SwiftFormat * Fix home timeline switch on login * Fix sidebar routerPath * Fixes on detail view * Remove print changes * Simply detail view * More opt * Migrate DisplaySettingsLocalValues * Better post detail transition * Status detail animation finally right * Cleanup
50 lines
1.4 KiB
Swift
50 lines
1.4 KiB
Swift
import Account
|
|
import AppAccount
|
|
import Conversations
|
|
import DesignSystem
|
|
import Env
|
|
import Models
|
|
import Network
|
|
import Shimmer
|
|
import SwiftUI
|
|
|
|
struct MessagesTab: View {
|
|
@EnvironmentObject private var theme: Theme
|
|
@Environment(StreamWatcher.self) private var watcher
|
|
@Environment(Client.self) private var client
|
|
@Environment(CurrentAccount.self) private var currentAccount
|
|
@Environment(AppAccountsManager.self) private var appAccount
|
|
@State private var routerPath = RouterPath()
|
|
@Binding var popToRootTab: Tab
|
|
|
|
var body: some View {
|
|
NavigationStack(path: $routerPath.path) {
|
|
ConversationsListView()
|
|
.withAppRouter()
|
|
.withSheetDestinations(sheetDestinations: $routerPath.presentedSheet)
|
|
.toolbar {
|
|
if UIDevice.current.userInterfaceIdiom != .pad {
|
|
ToolbarItem(placement: .navigationBarLeading) {
|
|
AppAccountsSelectorView(routerPath: routerPath)
|
|
}
|
|
}
|
|
}
|
|
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
|
|
.id(client.id)
|
|
}
|
|
.onChange(of: $popToRootTab.wrappedValue) { _, newValue in
|
|
if newValue == .messages {
|
|
routerPath.path = []
|
|
}
|
|
}
|
|
.onChange(of: client.id) {
|
|
routerPath.path = []
|
|
}
|
|
.onAppear {
|
|
routerPath.client = client
|
|
}
|
|
.withSafariRouter()
|
|
.environment(routerPath)
|
|
}
|
|
}
|