IceCubesApp/Packages/DesignSystem/Sources/DesignSystem/Views/StatusEditorToolbarItem.swift

32 lines
734 B
Swift
Raw Normal View History

2022-12-29 16:22:07 +00:00
import SwiftUI
import Env
@MainActor
2022-12-29 16:22:07 +00:00
extension View {
public func statusEditorToolbarItem(routeurPath: RouterPath) -> some ToolbarContent {
ToolbarItem(placement: .navigationBarTrailing) {
Button {
routeurPath.presentedSheet = .newStatusEditor
} label: {
Image(systemName: "square.and.pencil")
}
}
}
}
public struct StatusEditorToolbarItem: ToolbarContent {
@EnvironmentObject private var routerPath: RouterPath
public init() { }
public var body: some ToolbarContent {
ToolbarItem(placement: .navigationBarTrailing) {
Button {
routerPath.presentedSheet = .newStatusEditor
} label: {
Image(systemName: "square.and.pencil")
}
}
}
}