mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-01-10 13:52:43 +01:00
34 lines
1.1 KiB
Swift
34 lines
1.1 KiB
Swift
import AppAccount
|
|
import DesignSystem
|
|
import Env
|
|
import SwiftUI
|
|
|
|
@MainActor
|
|
struct ToolbarTab: ToolbarContent {
|
|
@Environment(\.isSecondaryColumn) private var isSecondaryColumn: Bool
|
|
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
|
|
|
|
@Environment(UserPreferences.self) private var userPreferences
|
|
|
|
@Binding var routerPath: RouterPath
|
|
|
|
var body: some ToolbarContent {
|
|
if !isSecondaryColumn {
|
|
statusEditorToolbarItem(routerPath: routerPath,
|
|
visibility: userPreferences.postVisibility)
|
|
if UIDevice.current.userInterfaceIdiom != .pad ||
|
|
(UIDevice.current.userInterfaceIdiom == .pad && horizontalSizeClass == .compact)
|
|
{
|
|
ToolbarItem(placement: .navigationBarLeading) {
|
|
AppAccountsSelectorView(routerPath: routerPath)
|
|
}
|
|
}
|
|
}
|
|
if UIDevice.current.userInterfaceIdiom == .pad && horizontalSizeClass == .regular {
|
|
if (!isSecondaryColumn && !userPreferences.showiPadSecondaryColumn) || isSecondaryColumn {
|
|
SecondaryColumnToolbarItem()
|
|
}
|
|
}
|
|
}
|
|
}
|